DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T x

⟦2f09ead8b⟧ TextFile

    Length: 2448 (0x990)
    Types: TextFile
    Names: »xbinlookup«

Derivation

└─⟦87ddcff64⟧ Bits:30001253 CPHDIST85 Tape, 1985 Autumn Conference Copenhagen
    └─ ⟦this⟧ »cph85dist/macintosh/xbin/xbinlookup« 

TextFile

Article 243 of net.sources.mac:
Relay-Version: version B 2.10.1 6/24/83 (MC840302); site diku.UUCP
Posting-Version: Notesfiles $Revision: 1.7.0.5 $; site uiucdcs
Path: diku!mcvax!seismo!harvard!think!mit-eddie!genrad!decvax!tektronix!uw-beaver!cornell!vax135!houxm!ihnp4!inuxc!pur-ee!uiucdcs!seefromline
From: liberte@uiucdcs.Uiuc.ARPA
Newsgroups: net.sources.mac
Subject: xbin lookup table
Message-ID: <101300003@uiucdcs>
Date: Fri, 12-Jul-85 09:04:00 GMT
Article-I.D.: uiucdcs.101300003
Posted: Fri Jul 12 09:04:00 1985
Date-Received: Mon, 15-Jul-85 06:09:12 GMT
Lines: 56
Nf-ID: #N:uiucdcs:101300003:000:1773
Nf-From: uiucdcs.Uiuc.ARPA!liberte    Jul 12 00:04:00 1985


A 30% improvement in speed results by using this indexed lookup table,
trlookup, instead of doing a linear search through tr.  This is for the
version of xbin.c which handles all previous BinHex formats.

Dan LaLiberte
liberte@uiucdcs.Uiuc.ARPA
ihnp4!uiucdcs!liberte

{I wont post xbin.shar unless I get 20 requests (by mail!) pronto.}


char tr[] = "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr";
/*	     0 123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
	     0                1               2               3 
trlookup is used to translate by direct lookup.  The input character
is an index into trlookup.  If the result is 0xFF, a bad char has been read.
Added by:  Dan LaLiberte, liberte@uiucdcs.Uiuc.ARPA, ihnp4!uiucdcs!liberte
*/
char trlookup[83] = { 	0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
			0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0xFF, 0xFF,
			0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0xFF,
			0x14, 0x15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
			0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
			0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0xFF,
			0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0xFF,
			0x2C, 0x2D, 0x2E, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF,
			0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0xFF,
			0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0xFF, 0xFF,
			0x3D, 0x3E, 0x3F };

/* q format -- decode one byte into 6 bit binary */
get6bits()
{
	register int c;
	register int tc;

	while (1) {
		c = getc(ifp);
		switch (c) {
		case '\n':
		case '\r':
			continue;
		case ':':
		case EOF:
			return EOF;
		default:
		 	tc = ((c-' ') < 83) ? trlookup[c-' '] : 0xff;
/*			fprintf(stderr, "c = '%c'  tc = %4x\n", c, tc); */
			if (tc != 0xff)
				return (tc);
			fprintf(stderr, "bad char: '%c'\n", c);
			return EOF;
		}
	}
}