Eric Biggers [Wed, 19 Dec 2012 02:09:59 +0000 (20:09 -0600)]
utf8_to_utf16(), utf16_to_utf8() changes
These two functions have been moved out of 'util.c' to a separate file
'encoding.c'. They also now return an integer error code because they can fail
for at least two reasons (no memory, and invalid UTF-8 or UTF-16LE character).
Eric Biggers [Tue, 18 Dec 2012 05:56:41 +0000 (23:56 -0600)]
mount_image.c: More message queue changes
Yet another rewrite of the message sending/receiving functions. Everything is
now sent through a generic message loop function with callbacks. At the same
time, another message has been introduced that is sent from the daemon to the
unmount process to provide its pid. Then, the unmount process can detect if the
filesystem daemon has crashed by polling this pid every second. (This should
solve the 10 minute timeout problem.)
Eric Biggers [Tue, 18 Dec 2012 00:22:00 +0000 (18:22 -0600)]
Allow in-place overwrites when unmounting read-write mounted WIM
- Add WIMLIB_UNMOUNT_FLAG_REBUILD and WIMLIB_UNMOUNT_FLAG_RECOMPRESS
- Make lock_wim() set a flag WIMStruct.wim_locked to prevent double-locks
- Maintain the inode list for each image through a read-write mount (not
strictly necessary yet, but makes sense to keep it correct)
- overwrite_wim_inplace(): Search for new streams by searching directly through
the lookup table for entries that are not located in the WIM being
overwritten.
The ad-hoc format of the unmount messages has been expanded with a header that
specifies the message size and the minimum and current version of the library
sending the message. This could potentially make things go smoother if the
messages are changed and unmounts are done with a different library version than
the mount is with.
Also, some code was refactored to reduce function length.
Eric Biggers [Sun, 16 Dec 2012 02:50:30 +0000 (20:50 -0600)]
Various cleanups
- wim_timestamp_to_str() instead of asctime(gmtime(wim_timestamp_to_unix()))
- inode_stream_lte() non-inline to save space
- new errors WIMLIB_ERR_CHAR_CONVERSION and WIMLIB_ERR_INVALID_PART_NUMBER
- write_xml_data(): Have libxml2 write directly to output file with UTF-16LE
encoding (no need for in-memory buffer and converting to UTF-16LE afterwards)
- read_header(): Validate total_parts and part_number
- Fix a couple potential integer overflows
- Fix some indentation and phase out more 'uint' uses
- Remove some unneeded DEBUG() statements
Eric Biggers [Sat, 15 Dec 2012 06:36:24 +0000 (00:36 -0600)]
XPRESS compressor: increase max match
XPRESS_MAX_MATCH was previously incorrectly set to 255, even though it can
really be up to 65538. This was fixed and the code for handling this was fixed,
so the XPRESS compressor can now output longer matches. (The decompressor could
already handle these longer matches.)
Eric Biggers [Sat, 24 Nov 2012 05:37:14 +0000 (23:37 -0600)]
main_writer_thread_proc(): Fix minor issues
- If a resource compresses to the same size or larger than the original size,
directly write it uncompressed with the main thread.
- Re-organize the code so as to not force the first resource to be compressed if
it doesn't need to be.
Eric Biggers [Wed, 21 Nov 2012 08:34:34 +0000 (02:34 -0600)]
Lots of changes
- Add progress functions
- Rename wimlib_mount() and wimlib_unmount() to wimlib_mount_image() and
wimlib_unmount_image()
- Remove wimlib_add_image_from_ntfs_volume() and
wimlib_apply_image_to_ntfs_volume() in favor of flags to wimlib_add_image()
and wimlib_extract_image()
- Add progress callback functions, and make them work for NTFS apply as well as
normal apply
- Consolidate some of the extraction code into extract_single_image().
- Make serial WIM reading work when applying to NTFS as well as in the normal
extraction mode.
- Update documentation in wimlib.h.
Eric Biggers [Tue, 20 Nov 2012 04:24:30 +0000 (22:24 -0600)]
Rewrite integrity calculation and checks
- Read and write 4096 bytes at a time
- Improve progress messages
- Allow copying some, but possibly not all, entries from the previous integrity
table.
Update the boot metadata resource entry in the WIM header as soon as
wimlib_set_boot_idx() is called. Otherwise, the correct entry is never updated
if wimlib_overwrite_xml_and_header() is called.