Delete now-unused zpipe code.

This commit is contained in:
Con Kolivas 2012-03-16 23:04:20 +11:00
parent 26433850b9
commit fbcf0fcfd4
4 changed files with 1 additions and 1904 deletions

View file

@ -31,8 +31,6 @@ lrztar_SCRIPTS = lrztar
noinst_LTLIBRARIES = libtmplrzip.la
libtmplrzip_la_SOURCES = \
zpipe.cpp \
zpipe.h \
lrzip_private.h \
liblrzip_private.h \
lrzip.c \
@ -53,6 +51,7 @@ libtmplrzip_la_SOURCES = \
sha4.h \
libzpaq/libzpaq.cpp \
libzpaq/libzpaq.h
libtmplrzip_la_LIBADD = lzma/C/liblzma.la

View file

@ -59,7 +59,6 @@
#include "lzma/C/LzmaLib.h"
#include "util.h"
#include "zpipe.h"
#include "lrzip.h"
@ -266,56 +265,6 @@ static int zpaq_compress_buf(rzip_control *control, struct compress_thread *cthr
return 0;
}
#if 0
static int zpaq_compress_buf(rzip_control *control, struct compress_thread *cthread, long thread)
{
uchar *c_buf = NULL;
size_t dlen = 0;
FILE *in, *out;
if (!lzo_compresses(control, cthread->s_buf, cthread->s_len))
return 0;
in = fmemopen(cthread->s_buf, cthread->s_len, "r");
if (unlikely(!in)) {
print_err("Failed to fmemopen in zpaq_compress_buf\n");
return -1;
}
out = open_memstream((char **)&c_buf, &dlen);
if (unlikely(!out)) {
fclose(in);
print_maxverbose("Failed to open_memstream in zpaq_compress_buf\n");
return -1;
}
zpipe_compress(in, out, control->msgout, cthread->s_len,
(int)(SHOW_PROGRESS), thread);
if (unlikely(memstream_update_buffer(out, &c_buf, &dlen))) {
fclose(in);
fclose(out);
fatal_return(("Failed to memstream_update_buffer in zpaq_compress_buf"), -1);
}
fclose(in);
fclose(out);
if (unlikely((i64)dlen >= cthread->c_len)) {
print_maxverbose("Incompressible block\n");
/* Incompressible, leave as CTYPE_NONE */
free(c_buf);
return 0;
}
cthread->c_len = dlen;
free(cthread->s_buf);
cthread->s_buf = c_buf;
cthread->c_type = CTYPE_ZPAQ;
return 0;
}
#endif
static int bzip2_compress_buf(rzip_control *control, struct compress_thread *cthread)
{
u32 dlen = cthread->s_len;
@ -567,48 +516,6 @@ out:
return ret;
}
#if 0
static int zpaq_decompress_buf(rzip_control *control, struct uncomp_thread *ucthread, long thread)
{
uchar *c_buf = NULL;
size_t dlen = 0;
FILE *in, *out;
in = fmemopen(ucthread->s_buf, ucthread->u_len, "r");
if (unlikely(!in)) {
print_err("Failed to fmemopen in zpaq_decompress_buf\n");
return -1;
}
out = open_memstream((char **)&c_buf, &dlen);
if (unlikely(!out)) {
print_err("Failed to open_memstream in zpaq_decompress_buf\n");
fclose(in);
return -1;
}
zpipe_decompress(in, out, control->msgout, ucthread->u_len, (int)(SHOW_PROGRESS), thread);
if (unlikely(memstream_update_buffer(out, &c_buf, &dlen))) {
fclose(in);
fclose(out);
fatal_return(("Failed to memstream_update_buffer in zpaq_decompress_buf"), -1);
}
fclose(in);
fclose(out);
if (unlikely((i64)dlen != ucthread->u_len)) {
print_err("Inconsistent length after decompression. Got %lld bytes, expected %lld\n", (i64)dlen, ucthread->u_len);
return -1;
}
free(ucthread->s_buf);
ucthread->s_buf = c_buf;
return 0;
}
#endif
static int bzip2_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_thread *ucthread)
{
u32 dlen = ucthread->u_len;

1772
zpipe.cpp

File diff suppressed because it is too large Load diff

37
zpipe.h
View file

@ -1,37 +0,0 @@
/* zpipe streaming file compressor v1.0
(C) 2009, Ocarina Networks, Inc.
Written by Matt Mahoney, matmahoney@yahoo.com, Sept. 29, 2009.
LICENSE
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 3 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 License for more details at
Visit <http://www.gnu.org/copyleft/gpl.html>.
*/
#ifndef ZPIPE_H
#define ZPIPE_H
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void zpipe_compress(FILE *in, FILE *out, FILE *msgout, long long int buf_len,
int progress, long thread);
void zpipe_decompress(FILE *in, FILE *out, FILE *msgout, long long int buf_len, int progress, long thread);
#ifdef __cplusplus
}
#endif
#endif