| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
#include "copyrite.h" |
|---|
| 18 |
#include "config.h" |
|---|
| 19 |
#include <string.h> |
|---|
| 20 |
#include <stdlib.h> |
|---|
| 21 |
#include <ctype.h> |
|---|
| 22 |
#include "conf.h" |
|---|
| 23 |
#include "externs.h" |
|---|
| 24 |
#include "mushdb.h" |
|---|
| 25 |
#include "mymalloc.h" |
|---|
| 26 |
#include "confmagic.h" |
|---|
| 27 |
#ifdef WIN32 |
|---|
| 28 |
#pragma warning( disable : 4244) |
|---|
| 29 |
#endif |
|---|
| 30 |
|
|---|
| 31 |
#define TABLE_SIZE 256 |
|---|
| 32 |
#define EOS 0 |
|---|
| 33 |
#define CHAR_BITS 8 |
|---|
| 34 |
#define CHAR_MASK 255 |
|---|
| 35 |
#define CODE_BITS 25 |
|---|
| 36 |
#ifndef SAMPLE_SIZE |
|---|
| 37 |
#define SAMPLE_SIZE 0 |
|---|
| 38 |
#endif |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
typedef unsigned long CType; |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
typedef struct cnode { |
|---|
| 48 |
struct cnode *left; |
|---|
| 49 |
struct cnode *right; |
|---|
| 50 |
unsigned char c; |
|---|
| 51 |
} CNode; |
|---|
| 52 |
|
|---|
| 53 |
static CNode *ctop; |
|---|
| 54 |
static CType ctable[TABLE_SIZE]; |
|---|
| 55 |
static char ltable[TABLE_SIZE]; |
|---|
| 56 |
|
|---|
| 57 |
slab *huffman_slab = NULL; |
|---|
| 58 |
|
|---|
| 59 |
static int fix_tree_depth(CNode *node, int height, int zeros); |
|---|
| 60 |
static void add_ones(CNode *node); |
|---|
| 61 |
static void build_ctable(CNode *root, CType code, int numbits); |
|---|
| 62 |
int init_compress(FILE * f); |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
unsigned char * |
|---|
| 81 |
text_compress(const char *s) |
|---|
| 82 |
{ |
|---|
| 83 |
CType stage; |
|---|
| 84 |
int bits = 0; |
|---|
| 85 |
const unsigned char *p; |
|---|
| 86 |
unsigned char *b, *buf; |
|---|
| 87 |
int needed_length; |
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
for (p = (const unsigned char *) s; p && *p; p++) |
|---|
| 91 |
bits += ltable[*p]; |
|---|
| 92 |
bits += CHAR_BITS * 2 - 1; |
|---|
| 93 |
needed_length = bits / CHAR_BITS; |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
p = (const unsigned char *) s; |
|---|
| 97 |
b = buf = (unsigned char *) malloc(needed_length); |
|---|
| 98 |
stage = 0; |
|---|
| 99 |
bits = 0; |
|---|
| 100 |
|
|---|
| 101 |
while (p && *p) { |
|---|
| 102 |
|
|---|
| 103 |
stage |= ctable[*p] << bits; |
|---|
| 104 |
bits += ltable[*p]; |
|---|
| 105 |
|
|---|
| 106 |
while (bits >= CHAR_BITS) { |
|---|
| 107 |
*b++ = stage & CHAR_MASK; |
|---|
| 108 |
stage = stage >> CHAR_BITS; |
|---|
| 109 |
bits -= CHAR_BITS; |
|---|
| 110 |
} |
|---|
| 111 |
p++; |
|---|
| 112 |
} |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
bits += ltable[EOS] + CHAR_BITS - 1; |
|---|
| 116 |
while (bits >= CHAR_BITS) { |
|---|
| 117 |
*b++ = stage & CHAR_MASK; |
|---|
| 118 |
stage = stage >> CHAR_BITS; |
|---|
| 119 |
bits -= CHAR_BITS; |
|---|
| 120 |
} |
|---|
| 121 |
|
|---|
| 122 |
return buf; |
|---|
| 123 |
} |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
#define WALK_TREE(bitpos) \ |
|---|
| 130 |
do { \ |
|---|
| 131 |
if (*p & (bitpos)) \ |
|---|
| 132 |
node = node->right; \ |
|---|
| 133 |
else \ |
|---|
| 134 |
node = node->left; \ |
|---|
| 135 |
if (!node->left && !node->right) { \ |
|---|
| 136 |
\ |
|---|
| 137 |
*b++ = node->c; \ |
|---|
| 138 |
if (!*p || ((long)(b - buf) >= (long)(sizeof(buf) - 1))) { \ |
|---|
| 139 |
*b++ = EOS; \ |
|---|
| 140 |
return buf; \ |
|---|
| 141 |
} \ |
|---|
| 142 |
if (node->c == EOS) \ |
|---|
| 143 |
return buf; \ |
|---|
| 144 |
node = ctop; \ |
|---|
| 145 |
} \ |
|---|
| 146 |
} while (0) |
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
char * |
|---|
| 167 |
text_uncompress(const unsigned char *s) |
|---|
| 168 |
{ |
|---|
| 169 |
|
|---|
| 170 |
static char buf[BUFFER_LEN]; |
|---|
| 171 |
const unsigned char *p; |
|---|
| 172 |
char *b; |
|---|
| 173 |
CNode *node; |
|---|
| 174 |
|
|---|
| 175 |
buf[0] = '\0'; |
|---|
| 176 |
if (!s || !*s) |
|---|
| 177 |
return buf; |
|---|
| 178 |
p = s; |
|---|
| 179 |
b = buf; |
|---|
| 180 |
|
|---|
| 181 |
node = ctop; |
|---|
| 182 |
for (;;) { |
|---|
| 183 |
WALK_TREE(1); |
|---|
| 184 |
WALK_TREE(2); |
|---|
| 185 |
WALK_TREE(4); |
|---|
| 186 |
WALK_TREE(8); |
|---|
| 187 |
WALK_TREE(16); |
|---|
| 188 |
WALK_TREE(32); |
|---|
| 189 |
WALK_TREE(64); |
|---|
| 190 |
WALK_TREE(128); |
|---|
| 191 |
p++; |
|---|
| 192 |
} |
|---|
| 193 |
} |
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
char * |
|---|
| 211 |
safe_uncompress(unsigned char const *s) |
|---|
| 212 |
{ |
|---|
| 213 |
return (char *) strdup((char *) uncompress(s)); |
|---|
| 214 |
} |
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
static int |
|---|
| 218 |
fix_tree_depth(CNode *node, int height, int zeros) |
|---|
| 219 |
{ |
|---|
| 220 |
int a, b; |
|---|
| 221 |
CNode *temp; |
|---|
| 222 |
|
|---|
| 223 |
if (!node) |
|---|
| 224 |
return height + (zeros > 2); |
|---|
| 225 |
a = fix_tree_depth(node->left, height + 1 + (zeros == 7), (zeros + 1) % 8); |
|---|
| 226 |
b = fix_tree_depth(node->right, height + 1, 0); |
|---|
| 227 |
if ((a > CODE_BITS) && (b < (a - 1))) { |
|---|
| 228 |
#ifdef STANDALONE |
|---|
| 229 |
printf("Rotate right at depth %d.\n", height); |
|---|
| 230 |
#endif |
|---|
| 231 |
temp = node->right; |
|---|
| 232 |
node->right = node->left; |
|---|
| 233 |
node->left = node->right->left; |
|---|
| 234 |
node->right->left = node->right->right; |
|---|
| 235 |
node->right->right = temp; |
|---|
| 236 |
a = fix_tree_depth(node->left, height + 1 + (zeros == 7), (zeros + 1) % 8); |
|---|
| 237 |
b = fix_tree_depth(node->right, height + 1, 0); |
|---|
| 238 |
} else if ((b > CODE_BITS) && (a < (b - 1))) { |
|---|
| 239 |
#ifdef STANDALONE |
|---|
| 240 |
printf("Rotate left at depth %d.\n", height); |
|---|
| 241 |
#endif |
|---|
| 242 |
temp = node->left; |
|---|
| 243 |
node->left = node->right; |
|---|
| 244 |
node->right = node->left->right; |
|---|
| 245 |
node->left->right = node->left->left; |
|---|
| 246 |
node->left->left = temp; |
|---|
| 247 |
a = fix_tree_depth(node->left, height + 1 + (zeros == 7), (zeros + 1) % 8); |
|---|
| 248 |
b = fix_tree_depth(node->right, height + 1, 0); |
|---|
| 249 |
} |
|---|
| 250 |
return ((a > b) ? a : b); |
|---|
| 251 |
} |
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
static void |
|---|
| 255 |
add_ones(CNode *node) |
|---|
| 256 |
{ |
|---|
| 257 |
int count; |
|---|
| 258 |
|
|---|
| 259 |
count = 0; |
|---|
| 260 |
do { |
|---|
| 261 |
if (node->right) |
|---|
| 262 |
add_ones(node->right); |
|---|
| 263 |
if ((count >= 7) || ((count >= 3) && !node->left && !node->right)) { |
|---|
| 264 |
ctop = slab_malloc(huffman_slab, node); |
|---|
| 265 |
if (!ctop) { |
|---|
| 266 |
do_rawlog(LT_ERR, |
|---|
| 267 |
"Cannot allocate memory for compression tree. Aborting."); |
|---|
| 268 |
exit(1); |
|---|
| 269 |
} |
|---|
| 270 |
ctop->left = node->left; |
|---|
| 271 |
ctop->right = node->right; |
|---|
| 272 |
ctop->c = node->c; |
|---|
| 273 |
node->left = (CNode *) NULL; |
|---|
| 274 |
node->right = ctop; |
|---|
| 275 |
node = ctop; |
|---|
| 276 |
count = 0; |
|---|
| 277 |
} |
|---|
| 278 |
node = node->left; |
|---|
| 279 |
count++; |
|---|
| 280 |
} while (node); |
|---|
| 281 |
} |
|---|
| 282 |
|
|---|
| 283 |
|
|---|
| 284 |
static void |
|---|
| 285 |
build_ctable(CNode *root, CType code, int numbits) |
|---|
| 286 |
{ |
|---|
| 287 |
#ifdef STANDALONE |
|---|
| 288 |
int i; |
|---|
| 289 |
#endif |
|---|
| 290 |
|
|---|
| 291 |
if (!root->left && !root->right) { |
|---|
| 292 |
ctable[root->c] = code; |
|---|
| 293 |
ltable[root->c] = numbits; |
|---|
| 294 |
#ifdef STANDALONE |
|---|
| 295 |
printf(isprint(root->c) ? "Code for '%c':\t" : "Code for %d:\t", root->c); |
|---|
| 296 |
for (i = 0; i < numbits; i++) |
|---|
| 297 |
printf("%d", (code >> i) & 1); |
|---|
| 298 |
printf("\n"); |
|---|
| 299 |
#endif |
|---|
| 300 |
if (numbits > CODE_BITS) { |
|---|
| 301 |
do_rawlog(LT_ERR, "Illegal compression code length (%d). Aborting.", |
|---|
| 302 |
numbits); |
|---|
| 303 |
exit(1); |
|---|
| 304 |
} |
|---|
| 305 |
} else { |
|---|
| 306 |
if (root->left) |
|---|
| 307 |
build_ctable(root->left, code | (0 << numbits), numbits + 1); |
|---|
| 308 |
if (root->right) |
|---|
| 309 |
build_ctable(root->right, code | (1 << numbits), numbits + 1); |
|---|
| 310 |
} |
|---|
| 311 |
} |
|---|
| 312 |
|
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 |
|
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
int |
|---|
| 325 |
init_compress(FILE * f) |
|---|
| 326 |
{ |
|---|
| 327 |
int total; |
|---|
| 328 |
unsigned char c; |
|---|
| 329 |
struct { |
|---|
| 330 |
long freq; |
|---|
| 331 |
CNode *node; |
|---|
| 332 |
} table[TABLE_SIZE]; |
|---|
| 333 |
int indx, count; |
|---|
| 334 |
long temp; |
|---|
| 335 |
CNode *node; |
|---|
| 336 |
|
|---|
| 337 |
#ifdef STANDALONE |
|---|
| 338 |
printf("init_compress: Part 1\n"); |
|---|
| 339 |
#endif |
|---|
| 340 |
|
|---|
| 341 |
huffman_slab = slab_create("huffman attribute compression", sizeof(CNode)); |
|---|
| 342 |
slab_set_opt(huffman_slab, SLAB_ALLOC_BEST_FIT, 1); |
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
for (total = 0; total < TABLE_SIZE; total++) { |
|---|
| 346 |
table[total].freq = 0; |
|---|
| 347 |
table[total].node = slab_malloc(huffman_slab, NULL); |
|---|
| 348 |
if (!table[total].node) { |
|---|
| 349 |
do_rawlog(LT_ERR, |
|---|
| 350 |
"Cannot allocate memory for compression tree. Aborting."); |
|---|
| 351 |
exit(1); |
|---|
| 352 |
} |
|---|
| 353 |
table[total].node->c = total; |
|---|
| 354 |
table[total].node->left = (CNode *) NULL; |
|---|
| 355 |
table[total].node->right = (CNode *) NULL; |
|---|
| 356 |
} |
|---|
| 357 |
|
|---|
| 358 |
#ifdef STANDALONE |
|---|
| 359 |
printf("init_compress: Part 2\n"); |
|---|
| 360 |
#endif |
|---|
| 361 |
|
|---|
| 362 |
|
|---|
| 363 |
if (f) { |
|---|
| 364 |
total = 0; |
|---|
| 365 |
while (!feof(f) && (!SAMPLE_SIZE || (total++ < SAMPLE_SIZE))) { |
|---|
| 366 |
c = fgetc(f); |
|---|
| 367 |
table[c].freq++; |
|---|
| 368 |
} |
|---|
| 369 |
} |
|---|
| 370 |
#ifdef STANDALONE |
|---|
| 371 |
for (indx = 0; indx < TABLE_SIZE; indx++) { |
|---|
| 372 |
printf(isprint(indx) ? "Frequency for '%c': %d\n" |
|---|
| 373 |
: "Frequency for %d: %d\n", (unsigned char) indx, table[indx].freq); |
|---|
| 374 |
} |
|---|
| 375 |
#endif |
|---|
| 376 |
|
|---|
| 377 |
#ifdef STANDALONE |
|---|
| 378 |
printf("init_compress: Part 3\n"); |
|---|
| 379 |
#endif |
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 |
table[']'].freq = table['['].freq; |
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
if (table[255].freq) |
|---|
| 396 |
table[255].freq--; |
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 |
|
|---|
| 400 |
|
|---|
| 401 |
table['\n'].freq /= 16; |
|---|
| 402 |
|
|---|
| 403 |
#ifdef STANDALONE |
|---|
| 404 |
printf("init_compress: Part 4(a)\n"); |
|---|
| 405 |
#endif |
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
|
|---|
| 410 |
|
|---|
| 411 |
for (indx = 2; indx < TABLE_SIZE; indx++) { |
|---|
| 412 |
for (count = indx; |
|---|
| 413 |
(count > 1) && (table[count - 1].freq < table[count].freq); count--) { |
|---|
| 414 |
temp = table[count].freq; |
|---|
| 415 |
table[count].freq = table[count - 1].freq; |
|---|
| 416 |
table[count - 1].freq = temp; |
|---|
| 417 |
node = table[count].node; |
|---|
| 418 |
table[count].node = table[count - 1].node; |
|---|
| 419 |
table[count - 1].node = node; |
|---|
| 420 |
} |
|---|
| 421 |
} |
|---|
| 422 |
|
|---|
| 423 |
#ifdef STANDALONE |
|---|
| 424 |
printf("init_compress: Part 4(b)\n"); |
|---|
| 425 |
#endif |
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 |
|
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 |
|
|---|
| 432 |
|
|---|
| 433 |
|
|---|
| 434 |
|
|---|
| 435 |
for (indx = TABLE_SIZE - 1; indx > 0; indx--) { |
|---|
| 436 |
#ifdef NEVER |
|---|
| 437 |
printf("Freq. table:\n"); |
|---|
| 438 |
for (count = indx; count >= 0; count--) |
|---|
| 439 |
printf("%3d: %d\t", table[count].node->c, table[count].freq); |
|---|
| 440 |
printf("\n"); |
|---|
| 441 |
#endif |
|---|
| 442 |
node = slab_malloc(huffman_slab, table[indx].node); |
|---|
| 443 |
if (!node) { |
|---|
| 444 |
do_rawlog(LT_ERR, |
|---|
| 445 |
"Cannot allocate memory for compression tree. Aborting."); |
|---|
| 446 |
exit(1); |
|---|
| 447 |
} |
|---|
| 448 |
node->left = table[indx].node; |
|---|
| 449 |
node->right = table[indx - 1].node; |
|---|
| 450 |
table[indx - 1].freq += table[indx].freq; |
|---|
| 451 |
table[indx - 1].node = node; |
|---|
| 452 |
for (count = indx - 1; |
|---|
| 453 |
(count > 1) && (table[count - 1].freq <= table[count].freq); count--) { |
|---|
| 454 |
temp = table[count].freq; |
|---|
| 455 |
table[count].freq = table[count - 1].freq; |
|---|
| 456 |
table[count - 1].freq = temp; |
|---|
| 457 |
node = table[count].node; |
|---|
| 458 |
table[count].node = table[count - 1].node; |
|---|
| 459 |
table[count - 1].node = node; |
|---|
| 460 |
} |
|---|
| 461 |
} |
|---|
| 462 |
|
|---|
| 463 |
#ifdef NEVER |
|---|
| 464 |
build_ctable(table[1].node, 0, 0); |
|---|
| 465 |
#endif |
|---|
| 466 |
|
|---|
| 467 |
#ifdef STANDALONE |
|---|
| 468 |
printf("init_compress: Part 4(c)\n"); |
|---|
| 469 |
#endif |
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
(void) fix_tree_depth(table[1].node, 0, 2); |
|---|
| 476 |
|
|---|
| 477 |
#ifdef STANDALONE |
|---|
| 478 |
printf("init_compress: Part 4(d)\n"); |
|---|
| 479 |
#endif |
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
node = table[1].node; |
|---|
| 490 |
for (count = 0; node->left && (count < 4); count++) |
|---|
| 491 |
node = node->left; |
|---|
| 492 |
ctop = slab_malloc(huffman_slab, node); |
|---|
| 493 |
if (!ctop) { |
|---|
| 494 |
do_rawlog(LT_ERR, "Cannot allocate memory for compression tree. Aborting."); |
|---|
| 495 |
exit(1); |
|---|
| 496 |
} |
|---|
| 497 |
ctop->left = node->left; |
|---|
| 498 |
ctop->right = node->right; |
|---|
| 499 |
ctop->c = node->c; |
|---|
| 500 |
node->left = (CNode *) NULL; |
|---|
| 501 |
node->right = ctop; |
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 |
add_ones(table[1].node); |
|---|
| 506 |
|
|---|
| 507 |
#ifdef STANDALONE |
|---|
| 508 |
printf("init_compress: Part 4(e)\n"); |
|---|
| 509 |
#endif |
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 |
node = table[1].node; |
|---|
| 514 |
for (count = 0; count < 8; count++) { |
|---|
| 515 |
if (!node->left) { |
|---|
| 516 |
ctop = slab_malloc(huffman_slab, node); |
|---|
| 517 |
if (!ctop) { |
|---|
| 518 |
do_rawlog(LT_ERR, |
|---|
| 519 |
"Cannot allocate memory for compression tree. Aborting."); |
|---|
| 520 |
exit(1); |
|---|
| 521 |
} |
|---|
| 522 |
ctop->left = (CNode *) NULL; |
|---|
| 523 |
ctop->right = (CNode *) NULL; |
|---|
| 524 |
ctop->c = EOS; |
|---|
| 525 |
node->left = ctop; |
|---|
| 526 |
} |
|---|
| 527 |
node = node->left; |
|---|
| 528 |
} |
|---|
| 529 |
|
|---|
| 530 |
#ifdef STANDALONE |
|---|
| 531 |
printf("init_compress: Part 5\n"); |
|---|
| 532 |
#endif |
|---|
| 533 |
|
|---|
| 534 |
|
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
ctop = table[1].node; |
|---|
| 539 |
build_ctable(ctop, 0, 0); |
|---|
| 540 |
|
|---|
| 541 |
#ifdef STANDALONE |
|---|
| 542 |
printf("init_compress: Done\n"); |
|---|
| 543 |
#endif |
|---|
| 544 |
|
|---|
| 545 |
|
|---|
| 546 |
return 0; |
|---|
| 547 |
} |
|---|
| 548 |
|
|---|
| 549 |
#ifdef STANDALONE |
|---|
| 550 |
void |
|---|
| 551 |
main(argc, argv) |
|---|
| 552 |
int argc; |
|---|
| 553 |
char *argv[]; |
|---|
| 554 |
{ |
|---|
| 555 |
FILE *input; |
|---|
|
|---|