9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@cse.psu.edu
Subject: Re: mothra (was Re: Abaco (was Re: [9fans] smacme))
Date: Sat, 15 Jul 2006 09:14:52 -0500	[thread overview]
Message-ID: <e81a7c1219fc5c13174298c682ec3cee@quanstro.net> (raw)
In-Reply-To: <2567471eab59cd635e41e3dcb6d19212@hamnavoe.com>

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

On Tue Jul 11 05:38:54 CDT 2006, 9fans@hamnavoe.com wrote:
> > I recall the pages on http://plan9.bell-labs.com/ were build rather with compatibility with mothra
> 
> Actually, the changes to the plan9 website earlier this year made it
> incompatible with mothra.  With a great effort of will I have restrained
> myself from complaining about this in 9fans.  

just admit it.  you'd rather code than complain. ☺

i've attached some diffs that allow .bz2 support.
there's also some (misguided?) cleanup in html.h.

> Instead I've updated mothra
> with support for the requisite features: charset=utf-8, more &entities,
> and .png images.
> 
> Just in case anyone besides me is still using mothra, the new version
> is now in /n/sources/extra/mothra.

thanks.  i still use it, but much less since the new version of abaco is working so well.
i'm even able to get wikipedia to work with a few changes to libhtml. (i've submitted
one patch and am collecting a second.)

- erik

[-- Attachment #2: mothra-diff --]
[-- Type: text/plain, Size: 3458 bytes --]

diff -c /n/sources/extra/mothra//filetype.c ./filetype.c
/n/sources/extra/mothra//filetype.c:22,36 - ./filetype.c:22,36
  	".gif",		GIF,
  	".jpe",		JPEG,
  	".jpg",		JPEG,
- 	".jpeg",	JPEG,
- 	".png",	PNG,
+ 	".jpeg",   	JPEG,
  	".pic",		PIC,
+ 	".png",		PNG,
  	".au",		AUDIO,
  	".tif",		TIFF,
- 	".tiff",	TIFF,
+ 	".tiff",     	TIFF,
  	".xbm",		XBM,
  	".txt",		PLAIN,
- 	".text",	PLAIN,
+ 	".text",    	PLAIN,
  	".ai",		POSTSCRIPT,
  	".eps",		POSTSCRIPT,
  	".ps",		POSTSCRIPT,
/n/sources/extra/mothra//filetype.c:51,56 - ./filetype.c:51,57
  	int len, kind, restore;
  	char *s;
  	len=strlen(name);
+
  	if(len>=2 && cistrcmp(name+len-2, ".Z")==0){
  		kind=COMPRESS;
  		len-=2;
/n/sources/extra/mothra//filetype.c:59,64 - ./filetype.c:60,69
  		kind=GUNZIP;
  		len-=3;
  	}
+ 	else if(len>=4 && cistrcmp(name+len-3, ".bz2")==0){
+ 		kind=BZIP2;
+ 		len-=4;
+ 	}
  	else
  		kind=0;
  	restore=name[len];
/n/sources/extra/mothra//filetype.c:99,104 - ./filetype.c:104,111
  	"compress",	COMPRESS,
  	"x-gzip",	GUNZIP,
  	"gzip",		GUNZIP,
+ 	"bzip2",		BZIP2,
+ 	"x-bzip",		BZIP2,
  	0,		0
  };
  int encoding2type(char *s){
diff -c /n/sources/extra/mothra//getpix.c ./getpix.c
/n/sources/extra/mothra//getpix.c:13,23 - ./getpix.c:13,23
  };
  Pix pix[NPIX];
  Pix *epix=pix;
- char *pixcmd[]={
+ char *pixcmd[CTYPEMASK+1]={
  [GIF]	"gif -9v",
  [JPEG]	"jpg -9v",
- [PNG]	"png -9v",
  [PIC]	"fb/3to1 /lib/fb/cmap/rgbv",
+ [PNG]	"png -9v",
  [TIFF]	"/sys/lib/mothra/tiffcvt",
  [XBM]	"fb/xbm2pic",
  };
/n/sources/extra/mothra//getpix.c:72,83 - ./getpix.c:72,78
  		}
  		return;
  	}
- 	if(url.type!=GIF
- 	&& url.type!=JPEG
- 	&& url.type!=PNG
- 	&& url.type!=PIC
- 	&& url.type!=TIFF
- 	&& url.type!=XBM){
+ 	if(pixcmd[CTYPEMASK & url.type] == 0){
  		werrstr("unknown image type");
  		goto Err;
  	}
Common subdirectories: /n/sources/extra/mothra//libpanel and ./libpanel
diff -c /n/sources/extra/mothra//mothra.h ./mothra.h
/n/sources/extra/mothra//mothra.h:52,84 - ./mothra.h:52,93
   * url reference types -- COMPRESS and GUNZIP are flags that can modify any other type
   * Changing these in a non-downward compatible way spoils cache entries
   */
- #define	GIF		1
- #define	HTML		2
- #define	JPEG		3
- #define	PIC		4
- #define	TIFF		5
- #define	AUDIO		6
- #define	PLAIN		7
- #define	XBM		8
- #define	POSTSCRIPT	9
- #define	FORWARD		10
- #define	PDF		11
- #define	SUFFIX		12
- #define ZIP		13	/* rm */
- #define PNG		14
- #define	COMPRESS	16
- #define	GUNZIP		32
- #define	COMPRESSION	(COMPRESS|GUNZIP)
+ enum {
+ 	GIF,
+ 	HTML,
+ 	JPEG,
+ 	PIC,
+ 	TIFF,
+ 	AUDIO,
+ 	PLAIN,
+ 	XBM,
+ 	POSTSCRIPT,
+ 	FORWARD,
+ 	PDF,
+ 	SUFFIX,
+ 	ZIP,			// rm
+ 	PNG,
+
+ 	CTYPEMASK	= 15,	// i.e. COMRESS-1
+ 	COMPRESS	= 16,
+ 	GUNZIP	= 32,
+ 	BZIP2		= 64,
+ 	COMPRESSION	= (COMPRESS|GUNZIP|BZIP2),
+ };
+
  /*
   * url access types
   */
- #define	HTTP		1
- #define	FTP		2
- #define	FILE		3
- #define	TELNET		4
- #define	MAILTO		5
- #define	EXEC		6
- #define	GOPHER		7
+ enum{
+ 	HTTP		= 1,
+ 	FTP,
+ 	FILE,
+ 	TELNET,
+ 	MAILTO,
+ 	EXEC,
+ 	GOPHER,
+ };
+
  /*
   *  authentication types
   */
/n/sources/extra/mothra//mothra.h:122,130 - ./mothra.h:131,133
  uchar cmap[256*3];
  RGB map[256];
  char version[];
- #ifndef brazil
- #	define	RFREND	0
- #endif
- #ifndef	nil
- #define	nil	0
- #endif

  reply	other threads:[~2006-07-15 14:14 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07 14:13 [9fans] smacme Ronald G Minnich
2006-07-07 14:20 ` Christoph Lohmann
2006-07-07 14:30   ` quanstro
2006-07-07 15:50     ` "Nils O. Selåsdal"
2006-07-07 15:52     ` Federico Benavento
2006-07-07 20:10       ` Brantley Coile
2006-07-07 14:30   ` Ronald G Minnich
2006-07-07 14:36   ` jmk
2006-07-07 14:54     ` Ronald G Minnich
2006-07-07 15:06       ` Latchesar Ionkov
2006-07-07 15:07         ` Ronald G Minnich
2006-07-07 15:16           ` andrey mirtchovski
2006-07-07 15:22             ` David Leimbach
2006-07-07 14:31 ` David Leimbach
2006-07-07 21:53   ` Abaco (was Re: [9fans] smacme) csant
2006-07-07 23:03     ` Federico G. Benavento
2006-07-07 23:18       ` csant
2006-07-08  0:31         ` Federico Benavento
2006-07-07 23:49       ` quanstro
2006-07-08  0:22         ` Steve Simon
2006-07-08  0:28         ` Federico Benavento
2006-07-08  0:43           ` quanstro
2006-07-08  1:08             ` Federico Benavento
2006-07-08  1:28               ` quanstro
2006-07-08  4:47                 ` Federico G. Benavento
2006-07-08 12:26                   ` quanstro
2006-07-08 13:02                     ` Federico G. Benavento
2006-07-08 13:09                       ` quanstro
2006-07-08 13:32                         ` Federico G. Benavento
2006-07-08 13:32                           ` quanstro
2006-07-08 13:38                             ` quanstro
2006-07-08 13:54                               ` Federico G. Benavento
2006-07-08 16:56                                 ` quanstro
2006-07-08 17:45                                   ` Federico G. Benavento
2006-07-08 17:39                                     ` quanstro
2006-07-08 18:12                                       ` Federico G. Benavento
2006-07-08 18:14                                         ` quanstro
2006-07-08 20:38                                   ` mattmobile
2006-07-08 19:39                                     ` quanstro
2006-07-08 22:18                                       ` mattmobile
2006-07-08 23:19                                         ` quanstro
2006-07-09  8:14                                         ` Sascha Retzki
2006-07-09  9:26                                           ` mattmobile
2006-07-09  9:26                                             ` [9fans] Re: Abaco csant
2006-07-09 10:59                                               ` mattmobile
2006-07-10  1:17                                                 ` quanstro
2006-07-10  9:12                                                   ` Charles Forsyth
2006-07-10  9:17                                                     ` LiteStar numnums
2006-07-10  9:34                                                       ` Charles Forsyth
2006-07-11  0:56                                                         ` quanstro
2006-07-10 21:25                                                     ` Caco
2006-07-11 10:37                                           ` mothra (was Re: Abaco (was Re: [9fans] smacme)) Richard Miller
2006-07-15 14:14                                             ` erik quanstrom [this message]
2006-07-16  8:33                                               ` csant
2006-07-17  5:05                                                 ` cej
2006-07-17  7:11                                                   ` uriel
2006-07-17  8:02                                                     ` erik quanstrom
2006-07-17  8:11                                                       ` erik quanstrom
2006-07-17 14:29                                                       ` jmk
2006-07-17  8:10                                                     ` cej
2006-07-17  7:45                                                   ` erik quanstrom
2006-07-17  8:15                                                     ` cej
2006-07-17  8:10                                                       ` erik quanstrom
2006-07-16 16:26                                               ` Richard Miller
2006-07-08  1:30             ` Abaco (was Re: [9fans] smacme) uriel
2006-07-08  2:52       ` Ronald G Minnich
2006-07-08  3:09         ` uriel
2006-07-08  3:18           ` Ronald G Minnich
2006-07-08 10:36       ` Sascha Retzki
2006-07-08 11:41         ` Federico G. Benavento
2006-07-07 15:21 ` [9fans] smacme Gabriel Diaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e81a7c1219fc5c13174298c682ec3cee@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).