Check-in [a666f280bd]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:WIP
Timelines: family | ancestors | new-driver-wip
Files: files | file ages | folders
SHA1:a666f280bde1e2e41fa05668611873b28171f28e
User & Date: rkeene 2020-04-22 18:27:00
Context
2020-04-22
18:27
WIP Leaf check-in: a666f280bd user: rkeene tags: new-driver-wip
2013-03-12
13:36
Updated to include comment in version script indicating that it is automatically generated Leaf check-in: 3c2ffdbe79 user: rkeene tags: new-driver
Changes

Changes to Docs/file_format.txt.

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	          first working URL is used)
	9         Cipher (Integer)
	10        No-op
	11        IDXDATA (Not used) ?
	12        SFX length (Not used) ?
	13        SHA256 of original file (binary)
------
ALGO values:
	0         Uncompressed
	1         RLE Compression
	2         Delta Compression
	3         Text Compression
	4         Zlib Compression
	5         Modified Zlib Compression
	6         Seminibble Encoding
	7         Range Encoding
	8         Second Modified Zlib Compression
	9         Bzip2 Compression
	10        Factor Compression
	11        Bitsums Compression
	12        Text RLE Compression
	13        LZO-1x Compression
	14        LZO-1y Compression
	15        LZO-2a Compression
	255       Reserved / Invalid







|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
48
49
50
51
52
53
54
55

















	          first working URL is used)
	9         Cipher (Integer)
	10        No-op
	11        IDXDATA (Not used) ?
	12        SFX length (Not used) ?
	13        SHA256 of original file (binary)
------
ALGO values:  Specified in "registration/compression"

















Changes to Makefile.in.

50
51
52
53
54
55
56
57
58
59


60
61

62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
..
81
82
83
84
85
86
87


88
89
90
91
	done >> libdact.vers
	echo '  local:' >> libdact.vers
	echo '          *;' >> libdact.vers
	echo '};' >> libdact.vers

## Build structures of registered components
### Compression algorithms
algorithms.h algorithms.c: algorithms.h.in algorithms.c.in registration/compression
	false



### Encryption algorithms
ciphers.h ciphers.c: ciphers.h.in ciphers.c.in registration/compression

	false

# Generic build rules
%.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -o "$@" -c "$^"

%_shr.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -o "$@" -c "$^"

# Dependencies

libdact_combined.o: libdact_combined.c
libdact_combined_shr.o: libdact_combined.c
libdact.o: libdact.c
libdact_shr.o: libdact.c

# Cleanup targets
clean:
................................................................................
	rm -f libdact_combined_shr.o libdact_combined.c

distclean: clean
	rm -f config.h Makefile libdact.syms
	rm -f config.status config.log

mrproper: distclean


	./build/autogen.sh distclean

# Make directive targets
.PHONY: all clean distclean mrproper







|
|

>
>

<
>










>







 







>
>




50
51
52
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
..
84
85
86
87
88
89
90
91
92
93
94
95
96
	done >> libdact.vers
	echo '  local:' >> libdact.vers
	echo '          *;' >> libdact.vers
	echo '};' >> libdact.vers

## Build structures of registered components
### Compression algorithms
algorithm-defs.h: registration/compression
	sed 's@#.*@@' registration/compression | grep -v '^ *$$' | awk '{ print "#define DACT_COMP_ALGO_" toupper($$2) "_ID " $$1 }' > algorithm-defs.h

builtin-algorithms.c: builtin-algorithms.c.in registration/compression

### Encryption algorithms

ciphers.h builtin-ciphers.c: ciphers.h.in builtin-ciphers.c.in registration/encryption
	false

# Generic build rules
%.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -o "$@" -c "$^"

%_shr.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -o "$@" -c "$^"

# Dependencies
algorithms.h: algorithm-defs.h
libdact_combined.o: libdact_combined.c
libdact_combined_shr.o: libdact_combined.c
libdact.o: libdact.c
libdact_shr.o: libdact.c

# Cleanup targets
clean:
................................................................................
	rm -f libdact_combined_shr.o libdact_combined.c

distclean: clean
	rm -f config.h Makefile libdact.syms
	rm -f config.status config.log

mrproper: distclean
	rm -f libdact.vers
	rm -f algorithm-defs.h builtin-algorithms.c
	./build/autogen.sh distclean

# Make directive targets
.PHONY: all clean distclean mrproper

Added algorithm-defs.h.

































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define DACT_COMP_ALGO_PLAIN_ID 0
#define DACT_COMP_ALGO_RLE_ID 1
#define DACT_COMP_ALGO_DELTA_ID 2
#define DACT_COMP_ALGO_TEXT_ID 3
#define DACT_COMP_ALGO_ZLIB_ID 4
#define DACT_COMP_ALGO_MZLIB_ID 5
#define DACT_COMP_ALGO_SNIBBLE_ID 6
#define DACT_COMP_ALGO_RANGE_ID 7
#define DACT_COMP_ALGO_MZLIB2_ID 8
#define DACT_COMP_ALGO_BZIP2_ID 9
#define DACT_COMP_ALGO_FACTOR_ID 10
#define DACT_COMP_ALGO_BITSUMS_ID 11
#define DACT_COMP_ALGO_TEXTRLE_ID 12
#define DACT_COMP_ALGO_LZOOX_ID 13
#define DACT_COMP_ALGO_LZOOY_ID 14
#define DACT_COMP_ALGO_LZOTA_ID 15

Changes to algorithms.h.

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

161
162
163
164

165
166
/*
 * Copyright (C) 2001, 2002, and 2003  Roy Keene
 *
 * 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
 * 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 <http://www.gnu.org/licenses/>.
 *
 *      email: dact@rkeene.org 
 */



#ifndef _ALGORITHMS_H
#define _ALOGIRTHMS_H
/*
	Algorithms!
*/



#include "dact.h"
#include "comp_plain.h"
#include "comp_rle.h"
#include "comp_delta.h"
#ifdef HAVE_LIBZ
#include "comp_zlib.h"
#include "comp_mzlib.h"
#include "comp_mzlib2.h"
#endif
#ifdef HAVE_LIBBZ2
#include "comp_bzlib.h"
#endif
#ifdef DEBUG
#include "comp_factor.h"
#include "comp_bitsums.h"
#include "comp_textrle.h"
#endif
#include "comp_snibble.h"
#include "comp_text.h"
#include "comp_fail.h"
#include "comp_lzoox.h"
#include "comp_lzooy.h"
#include "comp_lzota.h"

#ifdef __DACT_C
int (*(algorithms[256]))()={    comp_plain_algo,
                                comp_rle_algo,
                                comp_delta_algo,
				comp_text_algo,
#ifdef HAVE_LIBZ
				comp_zlib_algo,
				comp_mzlib_algo,
#else
				DACT_FAILED_ALGO,
				DACT_FAILED_ALGO,
#endif
				comp_snibble_algo,
				DACT_FAILED_ALGO,
#ifdef HAVE_LIBZ
				comp_mzlib2_algo,
#else
				DACT_FAILED_ALGO,
#endif
#ifdef HAVE_LIBBZ2
				comp_bzlib_algo,
#else
				DACT_FAILED_ALGO,
#endif
#ifdef DEBUG
				comp_factor_algo,
				comp_bitsums_algo,
				comp_textrle_algo,
#else
				DACT_FAILED_ALGO,
				DACT_FAILED_ALGO,
				DACT_FAILED_ALGO,
#endif
				comp_lzoox_algo,
				comp_lzooy_algo,
				comp_lzota_algo,
				NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
				NULL, NULL, 
                                NULL};




char *algorithm_names[256]={	"Uncompressed",
				"RLE Compression",
				"Delta Compression",
				"Text Compression",
#ifdef HAVE_LIBZ
				"Zlib Compression",
				"Modified Zlib Compression",
#else
				"Unsupported Algorithm (zlib)",
				"Unsupported Algorithm (mzlib)",
#endif
				"Seminibble Encoding",
				"Range Encoding",
#ifdef HAVE_LIBZ
				"Second Modified Zlib Compression",
#else
				"Unsupported Algorithm (mzlib2)",
#endif
#ifdef HAVE_LIBBZ2
				"Bzip2 Compression",
#else
				"Unsupported Algorithm (bzlib)",
#endif
#ifdef DEBUG
				"Factor Compression",
				"Bitsums Compression",
				"Text RLE Compression",
#else
				"Unsupported Algorithm (factor)",
				"Unsupported Algorithm (bitsums)",
				"Unsupported Algorithm (textrle)",
#endif
#ifdef HAVE_LIBLZO
				"LZO-1x Compression",
				"LZO-1y Compression",
				"LZO-2a Compression",
#else
				"Unsupported Algorithm (comp_lzoox)",
				"Unsupported Algorithm (comp_lzooy)",
				"Unsupported Algorithm (comp_lzota)",
#endif
				NULL

			};
#else
extern int (*(algorithms[256]))();
extern char *algorithm_names[256];

#endif
#endif

|







 







|

>
>

<
<
<
|
<

>
>
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
>
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
|
<
<
<
>

<
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

/*
 * Copyright (C) 2013  Roy Keene
 *
 * 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
 * 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 <http://www.gnu.org/licenses/>.
 *
 *      email: dact@rkeene.org
 */
#ifndef DACT_ALGORITHMS_H
#define DACT_ALGORITHMS_H 1




#include "algorithm-defs.h"


typedef enum {
	DACT_MODE_COMPR = 1,
	DACT_MODE_DECMP = 2
} dact_mode_t;


























































































struct dact_compression_algo {
	char *name;
	int id;











































	int (*function)(dact_mode_t mode, unsigned char *prev, unsigned char *block, unsigned char *out, int size, int bufsize);
};




#endif

Added builtin-algorithms.c.in.

Added libdact_combined.c.







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
int dact_register_hook() {
}

int dact_load_module() {
}

int dact_load_all_modules() {
}

int dact_set_option() {
}

int dact_parse_config() {
}

int dact_parse_cmdline() {
}

int dact_CtxDecompress() {
}

int dact_CtxCompress() {
}

int dact_BuffToBuffDecompress() {
}

int dact_BuffToBuffCompress() {
}

int dact_Decompress() {
}

int dact_Compress() {
}

Changes to registration/compression.


1















0 plain Plain compression














>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0 plain Uncompressed
1 rle RLE Compression
2 delta Delta Compression
3 text Text Compression
4 zlib Zlib Compression
5 mzlib Modified Zlib Compression
6 snibble Seminibble Encoding
7 range Range Encoding
8 mzlib2 Second Modified Zlib Compression
9 bzip2 Bzip2 Compression
10 factor Factor Compression
11 bitsums Bitsums Compression
12 textrle Text RLE Compression
13 lzoox LZO-1x Compression
14 lzooy LZO-1y Compression
15 lzota LZO-2a Compression