1 /* 2 * Copyright (C) 2001, 2002, and 2003 Roy Keene 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * email: dact@rkeene.org 19 */ 20 21 #ifndef _ALGORITHMS_H 22 #define _ALOGIRTHMS_H 23 /* 24 Algorithms! 25 */ 26 27 #include "dact.h" 28 #include "comp_plain.h" 29 #include "comp_rle.h" 30 #include "comp_delta.h" 31 #ifdef HAVE_LIBZ 32 #include "comp_zlib.h" 33 #include "comp_mzlib.h" 34 #include "comp_mzlib2.h" 35 #endif 36 #ifdef HAVE_LIBBZ2 37 #include "comp_bzlib.h" 38 #endif 39 #ifdef DEBUG 40 #include "comp_factor.h" 41 #include "comp_bitsums.h" 42 #include "comp_textrle.h" 43 #endif 44 #include "comp_snibble.h" 45 #include "comp_text.h" 46 #include "comp_fail.h" 47 #include "comp_lzoox.h" 48 #include "comp_lzooy.h" 49 #include "comp_lzota.h" 50 51 #ifdef __DACT_C 52 int (*(algorithms[256]))()={ comp_plain_algo, 53 comp_rle_algo, 54 comp_delta_algo, 55 comp_text_algo, 56 #ifdef HAVE_LIBZ 57 comp_zlib_algo, 58 comp_mzlib_algo, 59 #else 60 DACT_FAILED_ALGO, 61 DACT_FAILED_ALGO, 62 #endif 63 comp_snibble_algo, 64 DACT_FAILED_ALGO, 65 #ifdef HAVE_LIBZ 66 comp_mzlib2_algo, 67 #else 68 DACT_FAILED_ALGO, 69 #endif 70 #ifdef HAVE_LIBBZ2 71 comp_bzlib_algo, 72 #else 73 DACT_FAILED_ALGO, 74 #endif 75 #ifdef DEBUG 76 comp_factor_algo, 77 comp_bitsums_algo, 78 comp_textrle_algo, 79 #else 80 DACT_FAILED_ALGO, 81 DACT_FAILED_ALGO, 82 DACT_FAILED_ALGO, 83 #endif 84 comp_lzoox_algo, 85 comp_lzooy_algo, 86 comp_lzota_algo, 87 NULL, NULL, NULL, NULL, NULL, 88 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 89 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 91 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 92 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 93 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 94 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 95 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 96 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 97 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 98 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 99 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 100 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 101 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 102 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 103 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 104 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 105 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 106 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 107 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 108 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 109 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 110 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 111 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 112 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 113 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 114 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 115 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 116 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 117 NULL, NULL, 118 NULL}; 119 120 char *algorithm_names[256]={ "Uncompressed", 121 "RLE Compression", 122 "Delta Compression", 123 "Text Compression", 124 #ifdef HAVE_LIBZ 125 "Zlib Compression", 126 "Modified Zlib Compression", 127 #else 128 "Unsupported Algorithm (zlib)", 129 "Unsupported Algorithm (mzlib)", 130 #endif 131 "Seminibble Encoding", 132 "Range Encoding", 133 #ifdef HAVE_LIBZ 134 "Second Modified Zlib Compression", 135 #else 136 "Unsupported Algorithm (mzlib2)", 137 #endif 138 #ifdef HAVE_LIBBZ2 139 "Bzip2 Compression", 140 #else 141 "Unsupported Algorithm (bzlib)", 142 #endif 143 #ifdef DEBUG 144 "Factor Compression", 145 "Bitsums Compression", 146 "Text RLE Compression", 147 #else 148 "Unsupported Algorithm (factor)", 149 "Unsupported Algorithm (bitsums)", 150 "Unsupported Algorithm (textrle)", 151 #endif 152 #ifdef HAVE_LIBLZO 153 "LZO-1x Compression", 154 "LZO-1y Compression", 155 "LZO-2a Compression", 156 #else 157 "Unsupported Algorithm (comp_lzoox)", 158 "Unsupported Algorithm (comp_lzooy)", 159 "Unsupported Algorithm (comp_lzota)", 160 #endif 161 NULL 162 }; 163 #else 164 extern int (*(algorithms[256]))(); 165 extern char *algorithm_names[256]; 166 #endif 167 #endif |