Tag: 压缩

使用zLib进行错误缩放和膨胀

我正在尝试使用gcc在我的Linux(Ubuntu 8.04)中编译zpipe.c示例,但是我遇到了一些错误,请看一下: [ubuntu@eeepc:~/Desktop] gcc zpipe.c /tmp/ccczEQxz.o: In function `def’: zpipe.c:(.text+0x65): undefined reference to `deflateInit_’ zpipe.c:(.text+0xd3): undefined reference to `deflateEnd’ zpipe.c:(.text+0x150): undefined reference to `deflate’ zpipe.c:(.text+0x1e8): undefined reference to `deflateEnd’ zpipe.c:(.text+0x27b): undefined reference to `deflateEnd’ /tmp/ccczEQxz.o: In function `inf’: zpipe.c:(.text+0x314): undefined reference to `inflateInit_’ zpipe.c:(.text+0x382): undefined reference to `inflateEnd’ zpipe.c:(.text+0x3d7): undefined reference to `inflate’ zpipe.c:(.text+0x44b): undefined […]

低内存条件下的LZW压缩/解压缩

任何人都可以指出如何在低内存条件下(<2k)实现lzw压缩/解压缩。 那可能吗?

使用zlib解压缩zip文件

我有一个archive.zip,其中包含两个加密的“.txt”文件。 我想解压缩存档以检索这2个文件。 这是我到目前为止所做的: FILE *FileIn = fopen(“./archive.zip”, “rb”); if (FileIn) printf(“file opened\n”); else printf(“unable to open file\n”); fseek(FileIn, 0, SEEK_END); unsigned long FileInSize = ftell(FileIn); printf(“size of input compressed file : %u\n”, FileInSize); void *CompDataBuff = malloc(FileInSize); void *UnCompDataBuff = NULL; int fd = open (“archive.zip”, O_RDONLY); CompDataBuff = mmap(NULL, FileInSize, PROT_READ | PROT_WRITE, MAP_PRIVATE, […]