ports/devel/tcl-trf/files/patch-bz2
Mikhail Teterin 52b76e1327 Resurrect this port from the Attic based on the new version from the
author. As before, we modify the author's code to use either OpenSSL's
-lcrypto or BSD's -lmd /directly/ instead of compiling the bundled
definitions digests.

We also link with -lz and -lbz2 instead of dlopen-ing them at run-time.
2009-07-13 05:30:15 +00:00

166 lines
4.3 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- generic/bz2.c 2008-12-05 16:00:23.000000000 -0500
+++ generic/bz2.c 2008-12-23 15:31:04.000000000 -0500
@@ -28,4 +28,5 @@
*/
+#include <bzlib.h>
#include "transformInt.h"
@@ -223,5 +224,5 @@
}
- res = bz.bcompressInit (&c->state, o->level, 0, 0);
+ res = BZ2_bzCompressInit (&c->state, o->level, 0, 0);
if (res != BZ_OK) {
@@ -265,5 +266,5 @@
/* release conversion specific items here (BZ2) */
- bz.bcompressEnd (&c->state);
+ BZ2_bzCompressEnd (&c->state);
Tcl_Free ((char*) c->output_buffer);
Tcl_Free ((char*) c);
@@ -305,12 +306,12 @@
in = character;
- c->state.next_in = (unsigned char*) (Bytef*) &in;
+ c->state.next_in = &in;
c->state.avail_in = 1;
for (;;) {
- c->state.next_out = (unsigned char*) (Bytef*) c->output_buffer;
+ c->state.next_out = c->output_buffer;
c->state.avail_out = OUT_SIZE;
- res = bz.bcompress (&c->state, BZ_RUN);
+ res = BZ2_bzCompress (&c->state, BZ_RUN);
if (res < BZ_OK) {
@@ -373,12 +374,12 @@
int res;
- c->state.next_in = (unsigned char*) (Bytef*) buffer;
+ c->state.next_in = (char *)buffer;
c->state.avail_in = bufLen;
for (;;) {
- c->state.next_out = (unsigned char*) (Bytef*) c->output_buffer;
+ c->state.next_out = c->output_buffer;
c->state.avail_out = OUT_SIZE;
- res = bz.bcompress (&c->state, BZ_RUN);
+ res = BZ2_bzCompress (&c->state, BZ_RUN);
if (res < BZ_OK) {
@@ -439,12 +440,12 @@
int res;
- c->state.next_in = (unsigned char*) (Bytef*) NULL;
+ c->state.next_in = NULL;
c->state.avail_in = 0;
for (;;) {
- c->state.next_out = (unsigned char*) (Bytef*) c->output_buffer;
+ c->state.next_out = c->output_buffer;
c->state.avail_out = OUT_SIZE;
- res = bz.bcompress (&c->state, BZ_FINISH);
+ res = BZ2_bzCompress (&c->state, BZ_FINISH);
if (res < BZ_OK) {
@@ -499,5 +500,5 @@
/* execute conversion specific code here (BZ2) */
- /* bz.bcompressReset (&c->state); */
+ /* BZ2_bzCompressReset (&c->state); */
}
@@ -549,5 +550,5 @@
}
- res = bz.bdecompressInit (&c->state, 0, 0);
+ res = BZ2_bzDecompressInit (&c->state, 0, 0);
if (res != BZ_OK) {
@@ -593,5 +594,5 @@
/* release conversion specific items here (BZ2) */
- bz.bdecompressEnd (&c->state);
+ BZ2_bzDecompressEnd (&c->state);
Tcl_Free ((char*) c->output_buffer);
@@ -633,12 +634,12 @@
in = character;
- c->state.next_in = (unsigned char*) (Bytef*) &in;
+ c->state.next_in = &in;
c->state.avail_in = 1;
for (;;) {
- c->state.next_out = (unsigned char*) (Bytef*) c->output_buffer;
+ c->state.next_out = c->output_buffer;
c->state.avail_out = OUT_SIZE;
- res = bz.bdecompress (&c->state);
+ res = BZ2_bzDecompress (&c->state);
c->lastRes = res;
@@ -702,12 +703,12 @@
int res;
- c->state.next_in = (unsigned char*) (Bytef*) buffer;
+ c->state.next_in = (char *)buffer;
c->state.avail_in = bufLen;
for (;;) {
- c->state.next_out = (unsigned char*) (Bytef*) c->output_buffer;
+ c->state.next_out = c->output_buffer;
c->state.avail_out = OUT_SIZE;
- res = bz.bdecompress (&c->state);
+ res = BZ2_bzDecompress (&c->state);
c->lastRes = res;
@@ -774,14 +775,14 @@
}
- c->state.next_in = (unsigned char*) (Bytef*) c->output_buffer; /* fake out
- * 'inflate'
- */
+ c->state.next_in = c->output_buffer; /* fake out
+ * 'inflate'
+ */
c->state.avail_in = 0;
for (;;) {
- c->state.next_out = (unsigned char*) (Bytef*) c->output_buffer;
+ c->state.next_out = c->output_buffer;
c->state.avail_out = OUT_SIZE;
- res = bz.bdecompress (&c->state);
+ res = BZ2_bzDecompress (&c->state);
if ((res < BZ_OK) && (res != BZ_STREAM_END)) {
@@ -836,5 +837,5 @@
/* execute conversion specific code here (BZ2) */
- /* bz.bdecompressReset (&c->state); */
+ /* BZ2_bzDecompressReset (&c->state); */
}
--- generic/bz2_opt.c 2008-12-05 16:00:23.000000000 -0500
+++ generic/bz2_opt.c 2008-12-23 15:45:52.000000000 -0500
@@ -182,13 +182,4 @@
/*
- * 'bz2' is used, therefore load the required library.
- * And bail out if it is not available.
- */
-
- if (TCL_OK != TrfLoadBZ2lib (interp)) {
- return TCL_ERROR;
- }
-
- /*
* Now perform the real option check.
*/