[BusyBox-cvs] busybox/archival/libunarchive decompress_bunzip2.c, 1.4, 1.5

Erik Andersen andersen at busybox.net
Sat Oct 18 01:58:39 UTC 2003

Update of /var/cvs/busybox/archival/libunarchive
In directory winder:/tmp/cvs-serv1168

Modified Files:
Log Message:
Rob Landley's new micro-bunzip version 3.  Rob writes:

The API for using partial writes, as described in my last message, sucked.

So here's a patch against my last patch that changes things so that
write_bunzip_data calls read_bunzip_data itself behind the scenes whenever
necessary.  So usage is now just start_bunzip(), write_bunzip_data() until it
returns a negative number, and then the cleanup at the end of

It adds 32 bytes to the executable, but it should allow the caller (tar) to be
simplified enough to compensate.  Total -Os stripped exe size now 6856 bytes.


P.S.  I attached the whole C file so you don't have to keep incremental
patches straight if you don't want to. :)

P.S.  In the version I'm banging on now, I've simplified the license to just
LGPL.  I read the OSL a bit more closely and the patent termination clause
would have bit IBM in their counter-suit of SCO if the code in question had
been OSL instead of GPL, and I've decided I just don't want to beta-test
legal code right now.

Index: decompress_bunzip2.c
RCS file: /var/cvs/busybox/archival/libunarchive/decompress_bunzip2.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- decompress_bunzip2.c	19 Mar 2003 09:11:25 -0000	1.4
+++ decompress_bunzip2.c	18 Oct 2003 01:58:35 -0000	1.5
@@ -1,1658 +1,531 @@
-  This file is a part of bzip2 and/or libbzip2, a program and
-  library for lossless, block-sorting data compression.
-  Copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-  1. Redistributions of source code must retain the above copyright
[...2076 lines suppressed...]
-			break;
-		}
-	}
-	close(src_fd);
-	if (dst_fd != fileno(stdout)) {
-		close(dst_fd);
-	}
-	return TRUE;
+#warning FIXME
+#if 0
+/* Dumb little test thing, decompress stdin to stdout */
+int main(int argc, char *argv[])
+	char *c=uncompressStream(0,1);
+	fprintf(stderr,"\n%s\n", c ? c : "Completed OK");

More information about the busybox-cvs mailing list