#include <patchfile.h>
Protected Member Functions | |
PT (Buffer) _buffer | |
Protected Attributes | |
bool | _initiated |
PN_uint16 | _version_number |
HashVal | _MD5_ofSource |
PN_uint32 | _source_file_length |
HashVal | _MD5_ofResult |
PN_uint32 | _result_file_length |
int | _total_bytes_processed |
ifstream | _patch_stream |
ofstream | _write_stream |
ifstream | _origfile_stream |
Filename | _patch_file |
Filename | _orig_file |
Filename | _temp_file |
Static Protected Attributes | |
const PN_uint32 | _v0_magic_number = 0xfeebfaab |
const PN_uint32 | _magic_number = 0xfeebfaac |
const PN_uint16 | _current_version = 2 |
Private Member Functions | |
Patchfile (PT(Buffer) buffer) | |
~Patchfile (void) | |
bool | build (Filename file_orig, Filename file_new, Filename patch_name) |
int | read_header (const Filename &patch_file) |
int | initiate (const Filename &patch_file, const Filename &file) |
int | run (void) |
bool | apply (Filename &patch_file, Filename &file) |
INLINE float | get_progress (void) const |
INLINE void | set_footprint_length (int length) |
INLINE int | get_footprint_length () |
INLINE void | reset_footprint_length () |
INLINE bool | has_source_hash () const |
INLINE const HashVal & | get_source_hash () const |
INLINE const HashVal & | get_result_hash () const |
int | internal_read_header (const Filename &patch_file) |
void | init (PT(Buffer) buffer) |
void | cleanup (void) |
void | build_hash_link_tables (const char *buffer_orig, PN_uint32 length_orig, PN_uint32 *hash_table, PN_uint32 *link_table) |
PN_uint16 | calc_hash (const char *buffer) |
void | find_longest_match (PN_uint32 new_pos, PN_uint32 ©_pos, PN_uint16 ©_length, PN_uint32 *hash_table, PN_uint32 *link_table, const char *buffer_orig, PN_uint32 length_orig, const char *buffer_new, PN_uint32 length_new) |
PN_uint32 | calc_match_length (const char *buf1, const char *buf2, PN_uint32 max_length) |
void | emit_ADD (ofstream &write_stream, PN_uint16 length, const char *buffer, PN_uint32 ADD_pos) |
void | emit_COPY (ofstream &write_stream, PN_uint16 length, PN_uint32 COPY_pos, PN_uint32 last_copy_pos, PN_uint32 ADD_pos) |
Private Attributes | |
PUBLISHED | __pad0__: Patchfile(void) |
PN_uint32 | _footprint_length |
Static Private Attributes | |
const PN_uint32 | _HASHTABLESIZE = PN_uint32(1) << 16 |
const PN_uint32 | _DEFAULT_FOOTPRINT_LENGTH = 9 |
const PN_uint32 | _NULL_VALUE = PN_uint32(0) - 1 |
const PN_uint32 | _MAX_RUN_LENGTH = (PN_uint32(1) << 16) - 1 |
|
Definition at line 112 of file patchfile.cxx. |
|
Definition at line 138 of file patchfile.cxx. References _initiated, and cleanup(). |
|
Definition at line 439 of file patchfile.cxx. References EU_success, initiate(), and run(). Referenced by main(). |
|
Definition at line 793 of file patchfile.cxx. References _current_version, _footprint_length, _HASHTABLESIZE, _magic_number, _MD5_ofResult, _MD5_ofSource, _result_file_length, _source_file_length, StreamWriter::add_uint16(), StreamWriter::add_uint32(), build_hash_link_tables(), emit_ADD(), emit_COPY(), END_PROFILE, find_longest_match(), HashVal::get_value(), md5_a_buffer(), NULL, PN_uint16, PN_uint32, and START_PROFILE. Referenced by main(). |
|
Definition at line 578 of file patchfile.cxx. References _footprint_length, _HASHTABLESIZE, _NULL_VALUE, calc_hash(), END_PROFILE, PN_uint16, PN_uint32, START_PROFILE, and t. Referenced by build(). |
|
--> TRIED MD5, was not worth it for the execution-time hit on 800Mhz PC Definition at line 530 of file patchfile.cxx. References _footprint_length, buffer, HashVal::get_value(), md5_a_buffer(), and PN_uint16. Referenced by build_hash_link_tables(), and find_longest_match(). |
|
Definition at line 676 of file patchfile.cxx. References length, and PN_uint32. Referenced by find_longest_match(). |
|
Definition at line 149 of file patchfile.cxx. References _initiated, _origfile_stream, _patch_stream, and _write_stream. Referenced by run(), and ~Patchfile(). |
|
Definition at line 738 of file patchfile.cxx. References StreamWriter::add_uint16(), StreamWriter::append_data(), buffer, and length. Referenced by build(). |
|
Definition at line 761 of file patchfile.cxx. References StreamWriter::add_int32(), StreamWriter::add_uint16(), length, and PN_int32. Referenced by build(). |
|
Definition at line 692 of file patchfile.cxx. References _MAX_RUN_LENGTH, _NULL_VALUE, calc_hash(), calc_match_length(), PN_uint16, and PN_uint32. Referenced by build(). |
|
|
|
|
|
|
|
Referenced by run(). |
|
Referenced by run(). |
|
Definition at line 122 of file patchfile.cxx. References _initiated, _version_number, buffer, and reset_footprint_length(). Referenced by Patchfile(). |
|
Definition at line 184 of file patchfile.cxx. References _initiated, _orig_file, _origfile_stream, _temp_file, _total_bytes_processed, _write_stream, EU_error_abort, get_write_error(), internal_read_header(), and NULL. Referenced by apply(), and Patcher::initiate(). |
|
Definition at line 459 of file patchfile.cxx. References _current_version, _magic_number, _MD5_ofResult, _MD5_ofSource, _patch_file, _patch_stream, _result_file_length, _source_file_length, _v0_header_length, _v0_magic_number, _version_number, EU_error_file_invalid, EU_success, StreamReader::get_uint16(), StreamReader::get_uint32(), get_write_error(), PN_uint32, and HashVal::set_value(). Referenced by initiate(), and read_header(). |
|
|
|
Definition at line 243 of file patchfile.cxx. References _patch_stream, EU_error_abort, and internal_read_header(). |
|
Referenced by init(). |
|
Definition at line 262 of file patchfile.cxx. References _initiated, _MD5_ofResult, _orig_file, _origfile_stream, _patch_file, _patch_stream, _result_file_length, _temp_file, _total_bytes_processed, _version_number, _write_stream, cleanup(), EU_error_abort, EU_error_invalid_checksum, EU_error_write_file_rename, EU_ok, EU_success, StreamReader::get_int32(), get_source_hash(), StreamReader::get_uint16(), has_source_hash(), keep_temporary_files, md5_a_file(), PN_int32, PN_uint16, and PN_uint32. Referenced by apply(), and Patcher::run(). |
|
|
|
Definition at line 56 of file patchfile.h. |
|
Definition at line 88 of file patchfile.cxx. Referenced by build(), and internal_read_header(). |
|
Definition at line 91 of file patchfile.cxx. |
|
Definition at line 104 of file patchfile.h. Referenced by build(), build_hash_link_tables(), and calc_hash(). |
|
Definition at line 90 of file patchfile.cxx. Referenced by build(), and build_hash_link_tables(). |
|
Definition at line 110 of file patchfile.h. Referenced by cleanup(), init(), initiate(), run(), and ~Patchfile(). |
|
Definition at line 84 of file patchfile.cxx. Referenced by build(), and internal_read_header(). |
|
Definition at line 93 of file patchfile.cxx. Referenced by find_longest_match(). |
|
Definition at line 117 of file patchfile.h. Referenced by build(), internal_read_header(), and run(). |
|
Definition at line 114 of file patchfile.h. Referenced by build(), and internal_read_header(). |
|
Definition at line 92 of file patchfile.cxx. Referenced by build_hash_link_tables(), and find_longest_match(). |
|
Definition at line 126 of file patchfile.h. Referenced by initiate(), and run(). |
|
Definition at line 123 of file patchfile.h. Referenced by cleanup(), initiate(), and run(). |
|
Definition at line 125 of file patchfile.h. Referenced by internal_read_header(), and run(). |
|
Definition at line 121 of file patchfile.h. Referenced by cleanup(), internal_read_header(), read_header(), and run(). |
|
Definition at line 118 of file patchfile.h. Referenced by build(), internal_read_header(), and run(). |
|
Definition at line 115 of file patchfile.h. Referenced by build(), and internal_read_header(). |
|
Definition at line 127 of file patchfile.h. Referenced by initiate(), and run(). |
|
Definition at line 119 of file patchfile.h. Referenced by initiate(), and run(). |
|
Definition at line 83 of file patchfile.cxx. Referenced by internal_read_header(). |
|
Definition at line 112 of file patchfile.h. Referenced by init(), internal_read_header(), and run(). |
|
Definition at line 122 of file patchfile.h. Referenced by cleanup(), initiate(), and run(). |