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 m

⟦42eb75f42⟧ TextFile

    Length: 798 (0x31e)
    Types: TextFile
    Names: »mktable.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z« 
        └─⟦2109abc41⟧ 
            └─ ⟦this⟧ »./X.V10R4/xdvi/mktable.c« 

TextFile

#ifndef lint
static char *mktable_c = "$Header: mktable.c,v 10.5 86/02/01 15:44:59 tony Rel $";
#endif 	lint

#include <stdio.h>

char reverse_byte[0x100] = { 0 };

main()
{
	seed_table();
	fill_in_table();
	print_table();
}

seed_table()
{
	int i = 0;
	int j = 0x100/2;
	int b = 0;

	for (;;) {
		reverse_byte[i] = b;
		if (j == 0)
			break;
		i = 2*i + 1;
		b = b + j;
		j = j/2;
	}
}

fill_in_table()
{
	int b;

	for (b = 1; b < 0x100-2; b += 1)
		reverse_byte[b+1] =
			reverse_byte[b] ^ reverse_byte[b^(b+1)];
}

print_table()
{
	int b;

	printf("char reverse_byte[0x100] = {\n\t");
	b = 0;
	for (;;) {
		printf("0x%02x", reverse_byte[b] & 0xff);
		b += 1;
		if (b == 0x100) {
			printf("\n};\n");
			return;
		} else if (b % 8 == 0) {
			printf(",\n\t");
		} else {
			printf(", ");
		}
	}
}