summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxdelta3/Makefile5
-rwxr-xr-xxdelta3/setup.py2
-rwxr-xr-xxdelta3/xdelta3-main.h2
-rwxr-xr-xxdelta3/xdelta3-regtest.py38
-rwxr-xr-xxdelta3/xdelta3.h4
-rwxr-xr-xxdelta3/xdelta3.prj31
-rwxr-xr-xxdelta3/xdelta3.swig44
7 files changed, 69 insertions, 57 deletions
diff --git a/xdelta3/Makefile b/xdelta3/Makefile
index e5e5eeb..4b25ab7 100755
--- a/xdelta3/Makefile
+++ b/xdelta3/Makefile
@@ -38,11 +38,11 @@ PYTGT = build/lib.linux-i686-2.4/xdelta3.so
38 38
39PYFILES = xdelta3-regtest.py setup.py 39PYFILES = xdelta3-regtest.py setup.py
40 40
41EXTRA = Makefile COPYING linkxd3lib.c badcopy.c \ 41EXTRA = Makefile COPYING linkxd3lib.c badcopy.c xdelta3.swig \
42 draft-korn-vcdiff.txt xdelta3.vcproj badcopy.vcproj 42 draft-korn-vcdiff.txt xdelta3.vcproj badcopy.vcproj
43 43
44# $Format: "REL=$Xdelta3Version$" $ 44# $Format: "REL=$Xdelta3Version$" $
45REL=0n 45REL=0o
46RELDIR = xdelta3$(REL) 46RELDIR = xdelta3$(REL)
47 47
48all: xdelta3-debug xdelta3 $(PYTGT) 48all: xdelta3-debug xdelta3 $(PYTGT)
@@ -113,7 +113,6 @@ xdelta3_wrap.o: xdelta3_wrap.c
113 113
114xdelta3module.so: xdelta3_wrap.o xdelta3.o 114xdelta3module.so: xdelta3_wrap.o xdelta3.o
115 ld -shared xdelta3.o xdelta3_wrap.o -o xdelta3module.so /usr/lib/libpython2.4.so 115 ld -shared xdelta3.o xdelta3_wrap.o -o xdelta3module.so /usr/lib/libpython2.4.so
116 cp -f xdelta3module.so /usr/lib/python2.4/site-packages/xdelta3module.so
117 116
118xdelta3-decoder: $(SOURCES) 117xdelta3-decoder: $(SOURCES)
119 $(CC) -O2 -Wall -Wshadow xdelta3.c \ 118 $(CC) -O2 -Wall -Wshadow xdelta3.c \
diff --git a/xdelta3/setup.py b/xdelta3/setup.py
index 24b80de..d7f11c4 100755
--- a/xdelta3/setup.py
+++ b/xdelta3/setup.py
@@ -52,7 +52,7 @@ xdelta3_ext = Extension('xdelta3main',
52 ]) 52 ])
53 53
54# $Format: "REL='$Xdelta3Version$'" $ 54# $Format: "REL='$Xdelta3Version$'" $
55REL='0n' 55REL='0o'
56 56
57# This provides xdelta3.main(), which calls the xdelta3 command-line main() 57# This provides xdelta3.main(), which calls the xdelta3 command-line main()
58# from python. 58# from python.
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h
index 8db266d..9e47d61 100755
--- a/xdelta3/xdelta3-main.h
+++ b/xdelta3/xdelta3-main.h
@@ -326,7 +326,7 @@ static int
326main_version (void) 326main_version (void)
327{ 327{
328 /* $Format: " P(RINT \"VERSION=3.$Xdelta3Version$\\n\");" $ */ 328 /* $Format: " P(RINT \"VERSION=3.$Xdelta3Version$\\n\");" $ */
329 P(RINT "VERSION=3.0n\n"); 329 P(RINT "VERSION=3.0o\n");
330 return EXIT_SUCCESS; 330 return EXIT_SUCCESS;
331} 331}
332 332
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py
index 33f0715..1b84940 100755
--- a/xdelta3/xdelta3-regtest.py
+++ b/xdelta3/xdelta3-regtest.py
@@ -44,10 +44,10 @@ MAX_RUN = 1000 * 1000 * 10
44 44
45# How many results per round 45# How many results per round
46MAX_RESULTS = 100 46MAX_RESULTS = 100
47KEEP_P = (0.3) 47KEEP_P = (0.5)
48FAST_P = (0.0) 48FAST_P = (0.0)
49SLOW_P = (0.0) 49SLOW_P = (0.0)
50FILE_P = (0.50) 50FILE_P = (0.30)
51 51
52CONFIG_ORDER = [ 'large_look', 52CONFIG_ORDER = [ 'large_look',
53 'large_step', 53 'large_step',
@@ -62,16 +62,16 @@ CONFIG_ORDER = [ 'large_look',
62 62
63def INPUT_SPEC(rand): 63def INPUT_SPEC(rand):
64 return { 64 return {
65 'large_look' : lambda d: rand.choice([9]), 65 'large_look' : lambda d: rand.choice([9, 11, 13, 15]),
66 'large_step' : lambda d: rand.choice([4, 5]), 66 'large_step' : lambda d: rand.choice([11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ]),
67 67
68 'small_chain' : lambda d: rand.randrange(4, 65, 4), 68 'small_chain' : lambda d: rand.choice([1]),
69 'small_lchain' : lambda d: rand.randrange(1, 17, 1), 69 'small_lchain' : lambda d: rand.choice([1]),
70 70
71 'max_lazy' : lambda d: rand.choice([18]), 71 'max_lazy' : lambda d: rand.choice([9, 13, 18]),
72 'long_enough' : lambda d: rand.choice([35]), 72 'long_enough' : lambda d: rand.choice([9, 13, 18]),
73 73
74 'small_look' : lambda d: 4, 74 'small_look' : lambda d: rand.choice([4]),
75 'promote' : lambda d: 0, 75 'promote' : lambda d: 0,
76 'trylazy' : lambda d: 1, 76 'trylazy' : lambda d: 1,
77 'ssmatch' : lambda d: 0, 77 'ssmatch' : lambda d: 0,
@@ -782,12 +782,8 @@ class RandomTester:
782 t_rect = time_major - 1.0 782 t_rect = time_major - 1.0
783 s_rect = size_minor - 1.0 783 s_rect = size_minor - 1.0
784 784
785 assert(time_major >= size_minor)
786
787 rect_ratio = s_rect / t_rect 785 rect_ratio = s_rect / t_rect
788 786
789 assert(rect_ratio <= 1.000001)
790
791 for test in self.results: 787 for test in self.results:
792 788
793 # Transform the major min/max region linearly to normalize the 789 # Transform the major min/max region linearly to normalize the
@@ -851,6 +847,7 @@ class RandomTester:
851 test_totals[c].append(test) 847 test_totals[c].append(test)
852 #end 848 #end
853 s = 0.0 849 s = 0.0
850 self.results.append(test)
854 r.append(test.config()) 851 r.append(test.config())
855 all_r = test_totals[c] 852 all_r = test_totals[c]
856 for t in all_r: 853 for t in all_r:
@@ -867,7 +864,6 @@ class RandomTester:
867 print 'Score: %0.6f %s (%.1f%s%s)' % \ 864 print 'Score: %0.6f %s (%.1f%s%s)' % \
868 (test.score, test, s / len(all_r), stars, (len(all_r) > 2) and (' in %d' % len(all_r)) or "") 865 (test.score, test, s / len(all_r), stars, (len(all_r) > 2) and (' in %d' % len(all_r)) or "")
869 #end 866 #end
870
871 867
872 return r 868 return r
873 #end 869 #end
@@ -887,19 +883,27 @@ if __name__ == "__main__":
887 try: 883 try:
888 RunCommand(['rm', '-rf', TMPDIR]) 884 RunCommand(['rm', '-rf', TMPDIR])
889 os.mkdir(TMPDIR) 885 os.mkdir(TMPDIR)
890 rcsf = Test() 886 #rcsf = Test()
891 configs = [] 887 configs = []
892 888
893 while 1: 889 while 1:
894 #f1 = '/tmp/big.1' 890 #f1 = '/tmp/big.1'
895 #f2 = '/tmp/big.2' 891 #f2 = '/tmp/big.2'
896 test = RandomTester(configs) 892 test = RandomTester(configs)
897 f1, f2 = test.MakeBigFiles(rcsf) 893 #f1, f2 = test.MakeBigFiles(rcsf)
898 while not test.HasEnoughResults(): 894 while not test.HasEnoughResults():
895 f1 = '/tmp/WESNOTH_tmp/wesnoth-1.1.12.tar'
896 f2 = '/tmp/WESNOTH_tmp/wesnoth-1.1.13.tar'
897 #f1 = '/tmp/big.1'
898 #f2 = '/tmp/big.2'
899 test.RandomBigRun(f1, f2) 899 test.RandomBigRun(f1, f2)
900 #end 900 #end
901 configs = test.ScoreTests() 901 configs = test.ScoreTests()
902 test.Reset() 902
903 #test.Reset()
904 test.results = test.results[0:len(configs)]
905 configs = []
906 #break
903 #end 907 #end
904 #end 908 #end
905 909
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h
index 7f9d7ab..ca8d7c9 100755
--- a/xdelta3/xdelta3.h
+++ b/xdelta3/xdelta3.h
@@ -832,7 +832,7 @@ int xd3_encode_memory (const uint8_t *input,
832 usize_t input_size, 832 usize_t input_size,
833 const uint8_t *source, 833 const uint8_t *source,
834 usize_t source_size, 834 usize_t source_size,
835 uint8_t *output, 835 uint8_t *output_buffer,
836 usize_t *output_size, 836 usize_t *output_size,
837 usize_t avail_output, 837 usize_t avail_output,
838 int flags); 838 int flags);
@@ -842,7 +842,7 @@ int xd3_decode_memory (const uint8_t *input,
842 usize_t input_size, 842 usize_t input_size,
843 const uint8_t *source, 843 const uint8_t *source,
844 usize_t source_size, 844 usize_t source_size,
845 uint8_t *output, 845 uint8_t *output_buf,
846 usize_t *output_size, 846 usize_t *output_size,
847 usize_t avail_output, 847 usize_t avail_output,
848 int flags); 848 int flags);
diff --git a/xdelta3/xdelta3.prj b/xdelta3/xdelta3.prj
index 67bb489..a1a3fb9 100755
--- a/xdelta3/xdelta3.prj
+++ b/xdelta3/xdelta3.prj
@@ -1,34 +1,34 @@
1;; -*- Prcs -*- 1;; -*- Prcs -*-
2(Created-By-Prcs-Version 1 3 4) 2(Created-By-Prcs-Version 1 3 4)
3(Project-Description "") 3(Project-Description "")
4(Project-Version xdelta3 0 13) 4(Project-Version xdelta3 0 14)
5(Parent-Version xdelta3 0 12) 5(Parent-Version xdelta3 0 13)
6(Version-Log "fix /dont_run_xdelta3_test_as_root stupid") 6(Version-Log "add FASTEST, update DEFAULT compression levels")
7(New-Version-Log "") 7(New-Version-Log "")
8(Checkin-Time "Sun, 04 Feb 2007 02:47:02 -0800") 8(Checkin-Time "Wed, 07 Feb 2007 03:07:16 -0800")
9(Checkin-Login jmacd) 9(Checkin-Login jmacd)
10(Populate-Ignore ()) 10(Populate-Ignore ())
11(Project-Keywords 11(Project-Keywords
12 (Xdelta3Version "0n") 12 (Xdelta3Version "0o")
13 ) 13 )
14(Files 14(Files
15 (COPYING (xdelta3/b/29_COPYING 1.1 644)) 15 (COPYING (xdelta3/b/29_COPYING 1.1 644))
16 16
17 (xdelta3-cfgs.h (xdelta3/9_xdelta3-cf 1.4 744)) 17 (xdelta3-cfgs.h (xdelta3/9_xdelta3-cf 1.5 744))
18 (xdelta3-decode.h (xdelta3/b/30_xdelta3-de 1.4 744)) 18 (xdelta3-decode.h (xdelta3/b/30_xdelta3-de 1.4 744))
19 (xdelta3-djw.h (xdelta3/8_xdelta3-dj 1.5 744)) 19 (xdelta3-djw.h (xdelta3/8_xdelta3-dj 1.5 744))
20 (xdelta3-fgk.h (xdelta3/7_xdelta3-fg 1.3 744)) 20 (xdelta3-fgk.h (xdelta3/7_xdelta3-fg 1.3 744))
21 (xdelta3-list.h (xdelta3/6_xdelta3-li 1.3 644)) 21 (xdelta3-list.h (xdelta3/6_xdelta3-li 1.3 644))
22 (xdelta3-main.h (xdelta3/5_xdelta3-ma 1.8 744)) 22 (xdelta3-main.h (xdelta3/5_xdelta3-ma 1.9 744))
23 (xdelta3-python.h (xdelta3/4_xdelta3-py 1.3 644)) 23 (xdelta3-python.h (xdelta3/4_xdelta3-py 1.4 744))
24 (xdelta3-regtest.py (xdelta3/10_xdelta3-re 1.7 744)) 24 (xdelta3-regtest.py (xdelta3/10_xdelta3-re 1.8 744))
25 (xdelta3-second.h (xdelta3/3_xdelta3-se 1.4 744)) 25 (xdelta3-second.h (xdelta3/3_xdelta3-se 1.4 744))
26 (xdelta3-test.h (xdelta3/2_xdelta3-te 1.7 744)) 26 (xdelta3-test.h (xdelta3/2_xdelta3-te 1.8 744))
27 (xdelta3.c (xdelta3/16_xdelta3.c 1.7 744)) 27 (xdelta3.c (xdelta3/16_xdelta3.c 1.8 744))
28 (xdelta3.h (xdelta3/1_xdelta3.h 1.6 744)) 28 (xdelta3.h (xdelta3/1_xdelta3.h 1.7 744))
29 29
30 (Makefile (xdelta3/0_Makefile 1.6 744)) 30 (Makefile (xdelta3/0_Makefile 1.7 744))
31 (setup.py (xdelta3/11_setup.py 1.3 744)) 31 (setup.py (xdelta3/11_setup.py 1.4 744))
32 32
33 (draft-korn-vcdiff.txt (xdelta3/b/22_draft-korn 1.1 644)) 33 (draft-korn-vcdiff.txt (xdelta3/b/22_draft-korn 1.1 644))
34 34
@@ -39,6 +39,9 @@
39 (README (xdelta3/b/31_README 1.1 744)) 39 (README (xdelta3/b/31_README 1.1 744))
40 (badcopy.vcproj (xdelta3/b/32_badcopy.vc 1.1 744)) 40 (badcopy.vcproj (xdelta3/b/32_badcopy.vc 1.1 744))
41 (xdelta3.vcproj (xdelta3/b/33_xdelta3.vc 1.2 744)) 41 (xdelta3.vcproj (xdelta3/b/33_xdelta3.vc 1.2 744))
42
43 (xdelta3.swig (xdelta3/b/27_xdelta3.sw 1.1 744))
44
42) 45)
43(Merge-Parents) 46(Merge-Parents)
44(New-Merge-Parents) 47(New-Merge-Parents)
diff --git a/xdelta3/xdelta3.swig b/xdelta3/xdelta3.swig
index 4397b9d..9546e42 100755
--- a/xdelta3/xdelta3.swig
+++ b/xdelta3/xdelta3.swig
@@ -1,29 +1,35 @@
1%module xdelta3 1%module xdelta3
2%import cstring.i
2%{ 3%{
3#include "xdelta3.h" 4#include "xdelta3.h"
4 5
5DL_EXPORT(void) initxdelta3 (void) 6#undef SWIG_init
6{ 7#undef SWIG_name
7 SWIG_init(); 8
8} 9#define SWIG_init initxdelta3
10#define SWIG_name "xdelta3"
9 11
10%} 12%}
11 13
12int xd3_encode_memory (const uint8_t *input, 14%cstring_input_binary(const char *input, unsigned int input_size);
13 usize_t input_size, 15%cstring_input_binary(const char *source, unsigned int source_size);
14 const uint8_t *source, 16%cstring_output_withsize(char *output_buf, unsigned int avail_output);
15 usize_t source_size,
16 uint8_t *output,
17 usize_t *output_size,
18 usize_t avail_output,
19 int flags);
20 17
21int xd3_decode_memory (const uint8_t *input, 18int xd3_encode_memory (const char *input,
22 usize_t input_size, 19 unsigned int input_size,
23 const uint8_t *source, 20 const char *source,
24 usize_t source_size, 21 unsigned int source_size,
25 uint8_t *output, 22 char *output_buf,
26 usize_t *output_size, 23 unsigned int *OUTPUT,
27 usize_t avail_output, 24 unsigned int avail_output,
28 int flags); 25 int flags);
29 26
27int xd3_decode_memory (const char *input,
28 unsigned int input_size,
29 const char *source,
30 unsigned int source_size,
31 char *output_buf,
32 unsigned int *OUTPUT,
33 unsigned int avail_output,
34 int flags);
35