author | mickeyl <mickeyl> | 2004-04-05 13:49:07 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-05 13:49:07 (UTC) |
commit | f44b1d4abe82cfb74db68bffcaf240f6f6134708 (patch) (unidiff) | |
tree | c150abb3cbc842fd930d3ab7543a0b34ec3145ad /rsync | |
parent | 997a521a3ee84f614e2781a663911096ffb4a91a (diff) | |
download | opie-f44b1d4abe82cfb74db68bffcaf240f6f6134708.zip opie-f44b1d4abe82cfb74db68bffcaf240f6f6134708.tar.gz opie-f44b1d4abe82cfb74db68bffcaf240f6f6134708.tar.bz2 |
use opie debugging
-rw-r--r-- | rsync/qrsync.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rsync/qrsync.cpp b/rsync/qrsync.cpp index fe5f1bc..a2dbafc 100644 --- a/rsync/qrsync.cpp +++ b/rsync/qrsync.cpp | |||
@@ -2,12 +2,17 @@ | |||
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | extern "C" { | 3 | extern "C" { |
4 | #include "rsync.h" | 4 | #include "rsync.h" |
5 | } | 5 | } |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | 7 | ||
8 | /* OPIE */ | ||
9 | #include <opie2/odebug.h> | ||
10 | using namespace Opie::Core; | ||
11 | |||
12 | /* QT */ | ||
8 | #include <qfile.h> | 13 | #include <qfile.h> |
9 | 14 | ||
10 | static const char *rdiffNewFile = "/tmp/rdiff/result"; | 15 | static const char *rdiffNewFile = "/tmp/rdiff/result"; |
11 | static size_t block_len = RS_DEFAULT_BLOCK_LEN; | 16 | static size_t block_len = RS_DEFAULT_BLOCK_LEN; |
12 | static size_t strong_len = RS_DEFAULT_STRONG_LEN; | 17 | static size_t strong_len = RS_DEFAULT_STRONG_LEN; |
13 | 18 | ||
@@ -42,21 +47,21 @@ void QRsync::generateDiff( QString baseFile, QString sigFile, QString deltaFile | |||
42 | sig_file = fopen(sigFile.latin1(), "rb"); | 47 | sig_file = fopen(sigFile.latin1(), "rb"); |
43 | new_file = fopen(baseFile.latin1(), "rb"); | 48 | new_file = fopen(baseFile.latin1(), "rb"); |
44 | delta_file = fopen(deltaFile.latin1(), "wb"); | 49 | delta_file = fopen(deltaFile.latin1(), "wb"); |
45 | 50 | ||
46 | result = rs_loadsig_file(sig_file, &sumset, 0); | 51 | result = rs_loadsig_file(sig_file, &sumset, 0); |
47 | if (result != RS_DONE) { | 52 | if (result != RS_DONE) { |
48 | qDebug( "rdiffGenDiff: loading of sig file failed, error=%d", result ); | 53 | odebug << "rdiffGenDiff: loading of sig file failed, error=" << result << "" << oendl; |
49 | } else { | 54 | } else { |
50 | result = rs_build_hash_table(sumset); | 55 | result = rs_build_hash_table(sumset); |
51 | if ( result != RS_DONE) { | 56 | if ( result != RS_DONE) { |
52 | qDebug( "rdiffGenDiff: building of hash table failed, error=%d", result ); | 57 | odebug << "rdiffGenDiff: building of hash table failed, error=" << result << "" << oendl; |
53 | } else { | 58 | } else { |
54 | result = rs_delta_file(sumset, new_file, delta_file, 0); | 59 | result = rs_delta_file(sumset, new_file, delta_file, 0); |
55 | if ( result != RS_DONE) { | 60 | if ( result != RS_DONE) { |
56 | qDebug( "rdiffGenDiff: writing of diff file failed, error=%d", result ); | 61 | odebug << "rdiffGenDiff: writing of diff file failed, error=" << result << "" << oendl; |
57 | } | 62 | } |
58 | } | 63 | } |
59 | } | 64 | } |
60 | 65 | ||
61 | if ( sumset ) | 66 | if ( sumset ) |
62 | rs_free_sumset( sumset ); | 67 | rs_free_sumset( sumset ); |
@@ -85,13 +90,13 @@ void QRsync::applyDiff( QString baseFile, QString deltaFile ) | |||
85 | 90 | ||
86 | fclose( basis_file ); | 91 | fclose( basis_file ); |
87 | fclose( delta_file ); | 92 | fclose( delta_file ); |
88 | fclose( new_file ); | 93 | fclose( new_file ); |
89 | 94 | ||
90 | if (result != RS_DONE) { | 95 | if (result != RS_DONE) { |
91 | qDebug( "rdiffApplyDiff failed with result %d", result ); | 96 | odebug << "rdiffApplyDiff failed with result " << result << "" << oendl; |
92 | return; | 97 | return; |
93 | } | 98 | } |
94 | 99 | ||
95 | 100 | ||
96 | #ifdef Q_WS_WIN | 101 | #ifdef Q_WS_WIN |
97 | QDir dir; | 102 | QDir dir; |