lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV bzip2 support in Lynx?


From: David Woolley
Subject: Re: LYNX-DEV bzip2 support in Lynx?
Date: Mon, 17 Nov 1997 22:51:05 +0000 (GMT)

> 
> After checking out bzip2, a better compression tool than gzip that is
> GPL'd (http://www.muraroa.demon.co.uk/), I was wondering how to make
> lynx support these files. bzip2's interface is purposely similar to
> gzip's so it would seemingly be very easy to do.

As far as I can see it is a simple localised change to HTFWriter.c;
you should be able to make it without any real knowledge of C.

The above will work for HTTP.  You also need to make some changes, still
localised, but maybe a little more messy, in HTFile.c, for local files, and
HTFTP.c for FTP.  This is the code you need to change in HTFile.c:

                if ((len = strlen(localname)) > 2) {
                    if (localname[len - 1] == 'Z' &&
                        localname[len - 2] == '.') {
                        StrAllocCopy(cp, localname);
                        cp[len - 2] = '\0';
                        format = HTFileFormat(cp, &encoding);
                        FREE(cp);
                        format = HTCharsetFormat(format, anchor);
                        StrAllocCopy(anchor->content_type, format->name);
                        StrAllocCopy(anchor->content_encoding, "x-compress");
                        format = HTAtom_for("www/compressed");
                    } else if ((len > 3) &&
                               !strcasecomp((char *)&localname[len - 2],
                                            "gz") &&
                               localname[len - 3] == '.') {
                        StrAllocCopy(cp, localname);
                        cp[len - 3] = '\0';
                        format = HTFileFormat(cp, &encoding);
                        FREE(cp);
                        format = HTCharsetFormat(format, anchor);
                        StrAllocCopy(anchor->content_type, format->name);
                        StrAllocCopy(anchor->content_encoding, "x-gzip");
                        format = HTAtom_for("www/compressed");
                    }


even this is stereotyped, so you should be able to do a cut and paste change
(repeat from "else if" with appropriate name and size changes).

You should change the VMS branch of the code if you intend to pass the new
version to anyone else.

Code taken from 2.7; the latest version might differ.
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]