/*********************************************************** append.c -- append to archive ***********************************************************/ #include "lharc.h" #include "intrface.h" #ifdef NEED_INCREMENTAL_INDICATOR #define MAX_INDICATOR_COUNT 64 long indicator_count; long indicator_threshold; #endif extern int quiet; extern int compress_method; extern long int reading_size; extern unsigned short dicbit; struct interfacing interface; int encode_lzhuf (infp, outfp, size, original_size_var, packed_size_var, name,hdr_method) FILE *infp; FILE *outfp; long size; long *original_size_var; long *packed_size_var; char *name; char *hdr_method; { static int method = -1; if (method < 0) { method = compress_method; if (method > 0) method = encode_alloc(method); } interface.method = method; if (interface.method > 0) { interface.infile = infp; interface.outfile = outfp; interface.original = size; start_indicator (name, size, "Freezing",1< 100) pcnt = 100; /* (^_^) */ #ifdef NEED_INCREMENTAL_INDICATOR printf ("\r%s\t- %s(%d%%)\n", name, msg, pcnt); #else printf ("%s\n", msg); #endif fflush (stdout); } void finish_indicator (name, msg) char *name; char *msg; { if (quiet) return; #ifdef NEED_INCREMENTAL_INDICATOR printf ("\r%s\t- %s\n", name, msg); #else printf ("%s\n", msg); #endif fflush (stdout); }