/* Copyright (C) 1998 BJ Eirich (aka vecna) 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 Lic 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include char c[100]; FILE *f; char *jalblkasd; char byte, *t; short word; int quad; int bufsize=0; unsigned char *csrc, *cb; void EmitC (unsigned char c) { *csrc++=c; bufsize++; } void Compress(unsigned char *p, int len) { int i; unsigned char byt,samect; unsigned char repcode; csrc=cb; i=0; bufsize=0; do { byt=p[i++]; samect=1; while (samect<254 && i3 || byt == 0xFF) { repcode=0xFF; EmitC(repcode); repcode=(char) samect; EmitC(repcode); } EmitC(byt); } while (i