[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev bzip2 compressed files (was Re: NLS tweaks for 282dev4)
From: |
Nelson Henry Eric |
Subject: |
lynx-dev bzip2 compressed files (was Re: NLS tweaks for 282dev4) |
Date: |
Tue, 24 Nov 1998 19:41:16 +0900 (JST) |
> If you just want your bzipped file displayed by most,
If that's all I wanted, there'd be no need to use Lynx. :-)
Anyway, bzip2 has made tremendous strides since this discussion began
over a year ago. With the speed of decompression bzip2 has achieved, I
strongly urge that Lynx be modified to properly handle bzip2-compressed
files. The appended patch, granted not done in decent programming style,
will allow that support for http-served files. (Thanks to Bela!)
__Henry
*** lynx2-8-2/src/HTFWriter.c.orig Tue Nov 24 10:06:22 1998
--- lynx2-8-2/src/HTFWriter.c Tue Nov 24 10:33:12 1998
***************
*** 156,163 ****
* and remove any previous uncompressed copy. - FM
*/
StrAllocCopy(path, me->anchor->FileCache);
! if ((len = strlen(path)) > 2) {
! if (!strcasecomp(&path[len-2], "gz")) {
#ifdef USE_ZLIB
if (!skip_loadfile) {
use_gzread = YES;
--- 156,166 ----
* and remove any previous uncompressed copy. - FM
*/
StrAllocCopy(path, me->anchor->FileCache);
! if ((len = strlen(path)) > 3) {
! if (!strcasecomp(&path[len-3], "bz2")) {
! path[len-4] = '\0';
! remove(path);
! } else if (!strcasecomp(&path[len-2], "gz")) {
#ifdef USE_ZLIB
if (!skip_loadfile) {
use_gzread = YES;
***************
*** 856,862 ****
* We have a presentation mapping for it. - FM
*/
can_present = TRUE;
! if (!strcasecomp(anchor->content_encoding, "x-gzip") ||
!strcasecomp(anchor->content_encoding, "gzip")) {
/*
* It's compressed with the modern gzip. - FM
--- 859,870 ----
* We have a presentation mapping for it. - FM
*/
can_present = TRUE;
! if (!strcasecomp(anchor->content_encoding, "x-bzip2") ||
! !strcasecomp(anchor->content_encoding, "bzip")) {
! StrAllocCopy(uncompress_mask, BZIP2_PATH);
! StrAllocCat(uncompress_mask, " -d %s");
! compress_suffix = "bz2";
! } else if (!strcasecomp(anchor->content_encoding, "x-gzip") ||
!strcasecomp(anchor->content_encoding, "gzip")) {
/*
* It's compressed with the modern gzip. - FM
*** lynx2-8-2/userdefs.h.orig Tue Nov 24 08:56:36 1998
--- lynx2-8-2/userdefs.h Tue Nov 24 10:37:41 1998
***************
*** 1261,1266 ****
--- 1261,1267 ----
*/
#define UNCOMPRESS_PATH "gzip -d"
#define GZIP_PATH "gzip"
+ #define BZIP2_PATH "bzip2"
#else
***************
*** 1282,1287 ****
--- 1283,1289 ----
#define UUDECODE_PATH "uudecode"
#define ZCAT_PATH "zcat"
#define GZIP_PATH "gzip"
+ #define BZIP2_PATH "bzip2"
#define INSTALL_PATH "install"
#define TAR_PATH "tar"
#define TOUCH_PATH "touch"
*** lynx2-8-2/configure.orig Tue Nov 24 12:26:06 1998
--- lynx2-8-2/configure Tue Nov 24 12:43:13 1998
***************
*** 4177,4182 ****
--- 4177,4253 ----
+ test -z "$BZIP2" && BZIP2=bzip2
+ if test "$with_full_paths" = yes ; then
+ set dummy bzip2; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+ echo "configure:4185: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_path_BZIP2'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ case "$BZIP2" in
+ /*)
+ ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_BZIP2="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_BZIP2" && ac_cv_path_BZIP2="$BZIP2"
+ ;;
+ esac
+ fi
+ BZIP2="$ac_cv_path_BZIP2"
+ if test -n "$BZIP2"; then
+ echo "$ac_t""$BZIP2" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+
+ else
+ echo $ac_n "checking for bzip2""... $ac_c" 1>&6
+ echo "configure:4216: checking for bzip2" >&5
+ echo "$ac_t""$BZIP2" 1>&6
+ fi
+
+ cf_path_prog=""
+ cf_path_args=""
+ IFS="${IFS= }"; cf_save_ifs="$IFS"
+ case $host_os in #(vi
+ os2*) #(vi
+ IFS="${IFS};"
+ ;;
+ *)
+ IFS="${IFS}:"
+ ;;
+ esac
+ for cf_temp in $ac_cv_path_BZIP2
+ do
+ if test -z "$cf_path_prog" ; then
+ cf_path_prog="$cf_temp"
+ elif test -z "$cf_path_args" ; then
+ cf_path_args="$cf_temp"
+ else
+ cf_path_args="$cf_path_args $cf_temp"
+ fi
+ done
+ IFS="$cf_save_ifs"
+
+ cat >> confdefs.h <<EOF
+ #define BZIP2_PATH "$cf_path_prog"
+ EOF
+
+ test -n "$cf_path_args" && cat >> confdefs.h <<EOF
+ #define BZIP2_ARGS "$cf_path_args"
+ EOF
+
+
test -z "$UUDECODE" && UUDECODE=uudecode
if test "$with_full_paths" = yes ; then
# Extract the first word of "uudecode", so it can be a program name
with args.
*** lynx2-8-2/configure.in.orig Tue Nov 24 17:10:22 1998
--- lynx2-8-2/configure.in Tue Nov 24 17:11:17 1998
***************
*** 163,168 ****
--- 163,169 ----
CF_PATH_PROG(TOUCH, touch)
CF_PATH_PROG(UNCOMPRESS,gunzip)
CF_PATH_PROG(UNZIP, unzip)
+ CF_PATH_PROG(BZIP2, bzip2)
CF_PATH_PROG(UUDECODE, uudecode)
CF_PATH_PROG(ZCAT, zcat)
CF_PATH_PROG(ZIP, zip)
*** lynx2-8-2/config.hin.orig Tue Nov 24 17:13:18 1998
--- lynx2-8-2/config.hin Tue Nov 24 17:14:39 1998
***************
*** 138,143 ****
--- 138,144 ----
#undef UNDERLINE_LINKS /* CF_ARG_ENABLE(underlines) */
#undef UNIX
#undef UNZIP_PATH /* CF_PATH_PROG(unzip) */
+ #undef BZIP2_PATH /* CF_PATH_PROG(bzip2) */
#undef USE_COLOR_STYLE /* CF_ARG_ENABLE(color-style) */
#undef USE_DEFAULT_COLORS /* CF_ARG_ENABLE(default-colors) */
#undef USE_EXTERNALS /* CF_ARG_ENABLE(externs) */
- lynx-dev bzip2 compressed files (was Re: NLS tweaks for 282dev4),
Nelson Henry Eric <=