Index: trunk/minix/commands/autil/Makefile
===================================================================
--- trunk/minix/commands/autil/Makefile	(revision 9)
+++ 	(revision )
@@ -1,26 +1,0 @@
-# Makefile for commands/autil
-
-CC = exec cc
-CFLAGS	= -I. -D_MINIX -D_POSIX_SOURCE -wo
-CCLD	= $(CC) -i $(CFLAGS)
-
-all:	anm asize
-
-anm:	anm.c rd.c rd_arhdr.c rd_bytes.c rd_unsig2.c
-	$(CCLD) -o $@ $?
-	install -S 32kw $@
-
-asize:	asize.c
-	$(CCLD) -o $@ $?
-	install -S 4kw $@
-
-install:	/usr/bin/anm /usr/bin/asize
-
-/usr/bin/anm:	anm
-	install -cs -o bin $? $@
-
-/usr/bin/asize:	asize
-	install -cs -o bin $? $@
-
-clean:
-	rm -f anm asize core
Index: trunk/minix/commands/autil/anm.c
===================================================================
--- trunk/minix/commands/autil/anm.c	(revision 9)
+++ 	(revision )
@@ -1,339 +1,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id: anm.c,v 1.2 2005/06/23 09:50:54 philip Exp $ */
-/*
-**	print symbol tables for
-**	ACK object files
-**
-**	anm [-gopruns] [name ...]
-*/
-
-#include	"out.h"
-#include	"arch.h"
-#include	"ranlib.h"
-
-#include	<stdio.h>
-#include	<ctype.h>
-
-int	numsort_flg;
-int	sectsort_flg;
-int	undef_flg;
-int	revsort_flg = 1;
-int	globl_flg;
-int	nosort_flg;
-int	arch_flg;
-int	prep_flg;
-int	read_error;
-struct	outhead	hbuf;
-struct	outsect	sbuf;
-long	off;
-char	*malloc();
-char	*realloc();
-long	s_base[S_MAX];	/* for specially encoded bases */
-char	*filename;
-int	narg;
-
-main(argc, argv)
-char **argv;
-{
-
-	if (--argc>0 && argv[1][0]=='-' && argv[1][1]!=0) {
-		argv++;
-		while (*++*argv) switch (**argv) {
-		case 'n':		/* sort numerically */
-			numsort_flg++;
-			continue;
-
-		case 's':		/* sort in section order */
-			sectsort_flg++;
-			continue;
-
-		case 'g':		/* globl symbols only */
-			globl_flg++;
-			continue;
-
-		case 'u':		/* undefined symbols only */
-			undef_flg++;
-			continue;
-
-		case 'r':		/* sort in reverse order */
-			revsort_flg = -1;
-			continue;
-
-		case 'p':		/* don't sort -- symbol table order */
-			nosort_flg++;
-			continue;
-
-		case 'o':		/* prepend a name to each line */
-			prep_flg++;
-			continue;
-
-		default:		/* oops */
-			fprintf(stderr, "anm: invalid argument -%c\n", *argv[0]);
-			exit(1);
-		}
-		argc--;
-	}
-	if (argc == 0) {
-		argc = 1;
-		argv[1] = "a.out";
-	}
-	narg = argc;
-
-	while(argc--) {
-		int fd;
-
-		filename = *++argv;
-		if ((fd = open(filename, 0)) < 0) {
-			fprintf(stderr, "anm: cannot open %s\n", filename);
-			continue;
-		}
-		process(fd);
-		close(fd);
-	}
-	exit(0);
-}
-
-extern int rd_unsigned2();
-extern long lseek();
-extern char *strncpy();
-
-process(fd)
-	int	fd;
-{
-	unsigned int	magic;
-	long		nextpos;
-	struct ar_hdr	archive_header;
-	static char	buf[sizeof(archive_header.ar_name)+1];
-
-	if (narg > 1) printf("\n%s:\n", filename);
-
-	magic = rd_unsigned2(fd);
-	switch(magic) {
-	case O_MAGIC:
-		lseek(fd, 0L, 0);
-		do_file(fd);
-		break;
-	case ARMAG:
-	case AALMAG:
-		while (rd_arhdr(fd, &archive_header)) {
-			nextpos = lseek(fd, 0L, 1) + archive_header.ar_size;
-			if (nextpos & 1) nextpos++;
-			strncpy(buf,archive_header.ar_name,sizeof(archive_header.ar_name));
-			filename = buf;
-			if ( strcmp(filename, SYMDEF)) {
-				printf("\n%s:\n", filename);
-				do_file(fd);
-			}
-			lseek(fd, nextpos, 0);
-		}
-		break;
-	default:
-		fprintf(stderr, "anm: %s -- bad format\n", filename);
-		break;
-	}
-}
-
-do_file(fd)
-	int	fd;
-{
-	struct	outname	*nbufp = NULL;
-	struct	outname	nbuf;
-	char		*cbufp;
-	long		fi_to_co;
-	long		n;
-	unsigned	readcount;
-	int		i,j;
-	int		compare();
-
-	read_error = 0;
-	rd_fdopen(fd);
-
-	rd_ohead(&hbuf);
-	if (read_error) {
-		return;
-	}
-	if (BADMAGIC(hbuf)) {
-		return;
-	}
-
-	n = hbuf.oh_nname;
-	if (n == 0) {
-		fprintf(stderr, "anm: %s -- no name list\n", filename);
-		return;
-	}
-
-	if (hbuf.oh_nchar == 0) {
-		fprintf(stderr, "anm: %s -- no names\n", filename);
-		return;
-	}
-	if ((readcount = hbuf.oh_nchar) != hbuf.oh_nchar) {
-		fprintf(stderr, "anm: string area too big in %s\n", filename);
-		exit(2);
-	}
-
-	/* store special section bases ??? */
-	if (hbuf.oh_flags & HF_8086) {
-		rd_sect(&sbuf, hbuf.oh_nsect);
-		if (read_error) {
-			return;
-		}
-		for (i=0; i<hbuf.oh_nsect; i++) {
-			s_base[i+S_MIN] =
-				(sbuf.os_base>>12) & 03777760;
-		}
-	}
-
-	if ((cbufp = (char *)malloc(readcount)) == NULL) {
-		fprintf(stderr, "anm: out of memory on %s\n", filename);
-		exit(2);
-	}
-	rd_string(cbufp, hbuf.oh_nchar);
-	if (read_error) {
-		free(cbufp);
-		return;
-	}
-
-	fi_to_co = (long) (cbufp - OFF_CHAR(hbuf));
-	i = 0;
-	while (--n >= 0) {
-		rd_name(&nbuf, 1);
-		if (read_error) {
-			break;
-		}
-
-		if (globl_flg && (nbuf.on_type&S_EXT)==0)
-			continue;
-
-		if (undef_flg
-		    &&
-		    ((nbuf.on_type&S_TYP)!=S_UND || (nbuf.on_type&S_ETC)!=0))
-			continue;
-
-		if (nbuf.on_foff == 0) nbuf.on_mptr = 0;
-		else nbuf.on_mptr = (char *) (nbuf.on_foff + fi_to_co);
-
-		/* adjust value for specially encoded bases */
-		if (hbuf.oh_flags & HF_8086) {
-		    if (((nbuf.on_type&S_ETC) == 0) ||
-			((nbuf.on_type&S_ETC) == S_SCT)) {
-			j = nbuf.on_type&S_TYP;
-			if ((j>=S_MIN) && (j<=S_MAX))
-			    nbuf.on_valu += s_base[j];
-		    }
-		}
-
-		if (nbufp == NULL)
-			nbufp = (struct outname *)malloc(sizeof(struct outname));
-		else
-			nbufp = (struct outname *)realloc(nbufp, (i+1)*sizeof(struct outname));
-		if (nbufp == NULL) {
-			fprintf(stderr, "anm: out of memory on %s\n", filename);
-			exit(2);
-		}
-		nbufp[i++] = nbuf;
-	}
-
-	if (nbufp && nosort_flg==0)
-		qsort(nbufp, i, sizeof(struct outname), compare);
-
-	for (n=0; n<i; n++) {
-		char	cs1[4];
-		char	cs2[4];
-
-		if (prep_flg)
-			printf("%s:", filename);
-
-		switch(nbufp[n].on_type&S_ETC) {
-		case S_SCT:
-			sprintf(cs1, "%2d", (nbufp[n].on_type&S_TYP) - S_MIN);
-			sprintf(cs2, " S");
-			break;
-		case S_FIL:
-			sprintf(cs1, " -");
-			sprintf(cs2, " F");
-			break;
-		case S_MOD:
-			sprintf(cs1, " -");
-			sprintf(cs2, " M");
-			break;
-		case S_COM:
-			sprintf(cs1, " C");
-			if (nbufp[n].on_type&S_EXT)
-				sprintf(cs2, " E");
-			else
-				sprintf(cs2, " -");
-			break;
-		case 0:
-			if (nbufp[n].on_type&S_EXT)
-				sprintf(cs2, " E");
-			else
-				sprintf(cs2, " -");
-
-			switch(nbufp[n].on_type&S_TYP) {
-			case S_UND:
-				sprintf(cs1, " U");
-				break;
-			case S_ABS:
-				sprintf(cs1, " A");
-				break;
-			default:
-				sprintf(cs1, "%2d", (nbufp[n].on_type&S_TYP) - S_MIN);
-			}
-			break;
-		default:
-			sprintf(cs1, "??");
-			sprintf(cs2, " ?");
-		}
-
-		printf("%8lx %s %s %s\n",nbufp[n].on_valu,cs1,cs2,nbufp[n].on_mptr ? nbufp[n].on_mptr : "(NULL)");
-	}
-
-	if (nbufp)
-		free((char *)nbufp);
-	if (cbufp)
-		free((char *)cbufp);
-}
-
-compare(p1, p2)
-struct outname	*p1, *p2;
-{
-	int	i;
-
-	if (sectsort_flg) {
-		if ((p1->on_type&S_TYP) > (p2->on_type&S_TYP))
-			return(revsort_flg);
-		if ((p1->on_type&S_TYP) < (p2->on_type&S_TYP))
-			return(-revsort_flg);
-	}
-
-	if (numsort_flg) {
-		if (p1->on_valu > p2->on_valu)
-			return(revsort_flg);
-		if (p1->on_valu < p2->on_valu)
-			return(-revsort_flg);
-	}
-
-	if (! p1->on_mptr) {
-		if (! p2->on_mptr) return 0;
-		return -revsort_flg;
-	}
-	if (! p2->on_mptr) return revsort_flg;
-
-	i = strcmp(p1->on_mptr, p2->on_mptr);
-
-	if (i > 0)
-		return(revsort_flg);
-	if (i < 0)
-		return(-revsort_flg);
-
-	return(0);
-}
-
-rd_fatal()
-{
-	fprintf(stderr,"read error on %s\n", filename);
-	read_error = 1;
-}
Index: trunk/minix/commands/autil/arch.h
===================================================================
--- trunk/minix/commands/autil/arch.h	(revision 9)
+++ 	(revision )
@@ -1,25 +1,0 @@
-/* $Id: arch.h,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-
-#ifndef __ARCH_H_INCLUDED
-#define __ARCH_H_INCLUDED
-
-#define	ARMAG	0177545
-#define AALMAG	0177454
-
-struct	ar_hdr {
-	char	ar_name[14];
-	long	ar_date;
-	char	ar_uid;
-	char	ar_gid;
-	short	ar_mode;
-	long	ar_size;
-};
-
-#define AR_TOTAL	26
-#define AR_SIZE		22
-
-#endif /* __ARCH_H_INCLUDED */
Index: trunk/minix/commands/autil/asize.c
===================================================================
--- trunk/minix/commands/autil/asize.c	(revision 9)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/* @(#)asize.c	1.4 */
-#define	ushort	unsigned short
-
-#include	<stdio.h>
-#include 	"out.h"
-
-/*
-	asize -- determine object size
-
-*/
-
-main(argc, argv)
-char **argv;
-{
-	struct outhead	buf;
-	struct outsect	sbuf;
-	ushort		nrsect;
-	long		sum;
-	int		gorp;
-	FILE		*f;
-
-	if (--argc == 0) {
-		argc = 1;
-		argv[1] = "a.out";
-	}
-	gorp = argc;
-
-	while(argc--) {
-		if ((f = fopen(*++argv, "r"))==NULL) {
-			fprintf(stderr, "asize: cannot open %s\n", *argv);
-			continue;
-		}
-		getofmt ((char *)&buf, SF_HEAD , f);
-		if(BADMAGIC(buf)) {
-			fprintf(stderr, "asize: %s-- bad format\n", *argv);
-			fclose(f);
-			continue;
-		}
-		nrsect = buf.oh_nsect;
-		if (nrsect == 0) {
-			fprintf(stderr, "asize: %s-- no sections\n", *argv);
-			fclose(f);
-			continue;
-		}
-		if (gorp > 1)
-			printf("%s: ", *argv);
-
-		sum = 0;
-		while (nrsect-- > 0) {
-			getofmt ((char *)&sbuf, SF_SECT , f);
-			printf("%ld", sbuf.os_size);
-			sum += sbuf.os_size;
-			if (nrsect > 0)
-				putchar('+');
-		}
-		printf(" = %ld = 0x%lx\n", sum, sum);
-		fclose(f);
-	}
-}
-
-getofmt(p, s, f)
-register char	*p;
-register char	*s;
-register FILE	*f;
-{
-	register i;
-	register long l;
-
-	for (;;) {
-		switch (*s++) {
-/*		case '0': p++; continue; */
-		case '1':
-			*p++ = getc(f);
-			continue;
-		case '2':
-			i = getc(f);
-			i |= (getc(f) << 8);
-			*((short *)p) = i; p += sizeof(short);
-			continue;
-		case '4':
-			l = (long)getc(f);
-			l |= ((long)getc(f) << 8);
-			l |= ((long)getc(f) << 16);
-			l |= ((long)getc(f) << 24);
-			*((long *)p) = l; p += sizeof(long);
-			continue;
-		default:
-		case '\0':
-			break;
-		}
-		break;
-	}
-}
Index: trunk/minix/commands/autil/build
===================================================================
--- trunk/minix/commands/autil/build	(revision 9)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#!/bin/sh
-make clean
-make && make install
Index: trunk/minix/commands/autil/obj.h
===================================================================
--- trunk/minix/commands/autil/obj.h	(revision 9)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/* $Id: obj.h,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-#include <local.h>
-#include <stdio.h>
-#include <out.h>
-#include <ranlib.h>
-#include <arch.h>
-#include "object.h"
-
-#if ! defined(CHAR_UNSIGNED)
-#define CHAR_UNSIGNED 0
-#endif
-
-#if CHAR_UNSIGNED
-#define Xchar(ch)	(ch)
-#else
-#define Xchar(ch)	((ch) & 0377)
-#endif
-
-#if ! defined(BYTE_ORDER)
-#define BYTE_ORDER 0x3210
-#endif
-
-#if (BYTE_ORDER == 0x3210 || BYTE_ORDER == 0x1032)
-#define uget2(c)	(Xchar((c)[0]) | ((unsigned) Xchar((c)[1]) << 8))
-#define Xput2(i, c)	(((c)[0] = (i)), ((c)[1] = (i) >> 8))
-#define put2(i, c)	{ register int j = (i); Xput2(j, c); }
-#else
-#define uget2(c)	(* ((unsigned short *) (c)))
-#define Xput2(i, c)	(* ((short *) (c)) = (i))
-#define put2(i, c)	Xput2(i, c)
-#endif
-
-#define get2(c)		((short) uget2(c))
-
-#if BYTE_ORDER != 0x0123
-#define get4(c)		(uget2(c) | ((long) uget2((c)+2) << 16))
-#define put4(l, c)	{ register long x=(l); \
-			  Xput2((int)x,c); \
-			  Xput2((int)(x>>16),(c)+2); \
-			}
-#else
-#define get4(c)		(* ((long *) (c)))
-#define put4(l, c)	(* ((long *) (c)) = (l))
-#endif
-
-#define SECTCNT	3	/* number of sections with own output buffer */
-#if BIGMACHINE
-#define WBUFSIZ	(8*BUFSIZ)
-#else
-#define WBUFSIZ	BUFSIZ
-#endif
-
-struct fil {
-	int	cnt;
-	char	*pnow;
-	char	*pbegin;
-	long	currpos;
-	int	fd;
-	char	pbuf[WBUFSIZ];
-};
-
-extern struct fil __parts[];
-
-#define	PARTEMIT	0
-#define	PARTRELO	(PARTEMIT+SECTCNT)
-#define	PARTNAME	(PARTRELO+1)
-#define	PARTCHAR	(PARTNAME+1)
-#ifdef SYMDBUG
-#define PARTDBUG	(PARTCHAR+1)
-#else
-#define PARTDBUG	(PARTCHAR+0)
-#endif
-#define	NPARTS		(PARTDBUG + 1)
-
-#define getsect(s)      (PARTEMIT+((s)>=(SECTCNT-1)?(SECTCNT-1):(s)))
Index: trunk/minix/commands/autil/object.h
===================================================================
--- trunk/minix/commands/autil/object.h	(revision 9)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/* $Id: object.h,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-
-#include <ansi.h>
-
-#ifndef __OBJECT_INCLUDED__
-#define __OBJECT_INCLUDED__
-
-_PROTOTYPE(int wr_open, (char *f));
-_PROTOTYPE(void wr_close, (void));
-_PROTOTYPE(void wr_ohead, (struct outhead *h));
-_PROTOTYPE(void wr_sect, (struct outsect *s, unsigned int c));
-_PROTOTYPE(void wr_outsect, (int sectno));
-_PROTOTYPE(void wr_emit, (char *b, long c));
-_PROTOTYPE(void wr_putc, (int c));
-_PROTOTYPE(void wr_relo, (struct outrelo *r, unsigned int c));
-_PROTOTYPE(void wr_name, (struct outname *n, unsigned int c));
-_PROTOTYPE(void wr_string, (char *s, long c));
-_PROTOTYPE(void wr_arhdr, (int fd, struct ar_hdr *a));
-_PROTOTYPE(void wr_ranlib, (int fd, struct ranlib *r, long cnt));
-_PROTOTYPE(void wr_int2, (int fd, int i));
-_PROTOTYPE(void wr_long, (int fd, long l));
-_PROTOTYPE(void wr_bytes, (int fd, char *buf, long l));
-_PROTOTYPE(int rd_open, (char *f));
-_PROTOTYPE(int rd_fdopen, (int f));
-_PROTOTYPE(void rd_close, (void));
-_PROTOTYPE(void rd_ohead, (struct outhead *h));
-_PROTOTYPE(void rd_sect, (struct outsect *s, unsigned int c));
-_PROTOTYPE(void rd_outsect, (int sectno));
-_PROTOTYPE(void rd_emit, (char *b, long c));
-_PROTOTYPE(void rd_relo, (struct outrelo *r, unsigned int c));
-_PROTOTYPE(void rd_rew_relo, (struct outhead *head));
-_PROTOTYPE(void rd_name, (struct outname *n, unsigned int c));
-_PROTOTYPE(void rd_string, (char *s, long c));
-_PROTOTYPE(int rd_arhdr, (int fd, struct ar_hdr *a));
-_PROTOTYPE(void rd_ranlib, (int fd, struct ranlib *r, long cnt));
-_PROTOTYPE(int rd_int2, (int fd));
-_PROTOTYPE(long rd_long, (int fd));
-_PROTOTYPE(void rd_bytes, (int fd, char *buf, long l));
-_PROTOTYPE(int rd_fd, (void));
-
-#endif /* __OBJECT_INCLUDED__ */
Index: trunk/minix/commands/autil/out.h
===================================================================
--- trunk/minix/commands/autil/out.h	(revision 9)
+++ 	(revision )
@@ -1,126 +1,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Header: /cvsup/minix/src/commands/autil/out.h,v 1.1.1.1 2005/04/21 14:54:10 beng Exp $ */
-
-#ifndef __OUT_H_INCLUDED
-#define __OUT_H_INCLUDED
-/*
- * output format for ACK assemblers
- */
-#ifndef ushort
-#define ushort	unsigned short
-#endif /* ushort */
-
-struct outhead {
-	ushort 	oh_magic;	/* magic number */
-	ushort 	oh_stamp;	/* version stamp */
-	ushort	oh_flags;	/* several format flags */
-	ushort	oh_nsect;	/* number of outsect structures */
-	ushort	oh_nrelo;	/* number of outrelo structures */
-	ushort	oh_nname;	/* number of outname structures */
-	long	oh_nemit;	/* sum of all os_flen */
-	long	oh_nchar;	/* size of string area */
-};
-
-#define O_MAGIC	0x0201		/* magic number of output file */
-#define	O_STAMP	0		/* version stamp */
-#define MAXSECT	64		/* Maximum number of sections */
-
-#define	HF_LINK	0x0004		/* unresolved references left */
-#define	HF_8086	0x0008		/* os_base specially encoded */
-
-struct outsect {
-	long 	os_base;	/* startaddress in machine */
-	long	os_size;	/* section size in machine */
-	long	os_foff;	/* startaddress in file */
-	long	os_flen;	/* section size in file */
-	long	os_lign;	/* section alignment */
-};
-
-struct outrelo {
-	char	or_type;	/* type of reference */
-	char	or_sect;	/* referencing section */
-	ushort	or_nami;	/* referenced symbol index */
-	long	or_addr;	/* referencing address */
-};
-
-struct outname {
-	union {
-	  char	*on_ptr;	/* symbol name (in core) */
-	  long	on_off;		/* symbol name (in file) */
-	}	on_u;
-#define on_mptr	on_u.on_ptr
-#define on_foff	on_u.on_off
-	ushort	on_type;	/* symbol type */
-	ushort	on_desc;	/* debug info */
-	long	on_valu;	/* symbol value */
-};
-
-/*
- * relocation type bits
- */
-#define RELSZ	0x07		/* relocation length */
-#define RELO1	   1		/* 1 byte */
-#define RELO2	   2		/* 2 bytes */
-#define RELO4	   4		/* 4 bytes */
-#define RELPC	0x08		/* pc relative */
-#define RELBR	0x10		/* High order byte lowest address. */
-#define RELWR	0x20		/* High order word lowest address. */
-
-/*
- * section type bits and fields
- */
-#define S_TYP	0x007F		/* undefined, absolute or relative */
-#define S_EXT	0x0080		/* external flag */
-#define S_ETC	0x7F00		/* for symbolic debug, bypassing 'as' */
-
-/*
- * S_TYP field values
- */
-#define S_UND	0x0000		/* undefined item */
-#define S_ABS	0x0001		/* absolute item */
-#define S_MIN	0x0002		/* first user section */
-#define S_MAX	(S_TYP-1)	/* last user section */
-#define S_CRS	S_TYP		/* on_valu is symbol index which contains value */
-
-/*
- * S_ETC field values
- */
-#define S_SCT	0x0100		/* section names */
-#define S_LIN	0x0200		/* hll source line item */
-#define S_FIL	0x0300		/* hll source file item */
-#define S_MOD	0x0400		/* ass source file item */
-#define S_COM	0x1000		/* Common name. */
-#define S_STB	0xe000		/* entries with any of these bits set are
-				   reserved for debuggers
-				*/
-
-/*
- * structure format strings
- */
-#define SF_HEAD		"22222244"
-#define SF_SECT		"44444"
-#define SF_RELO		"1124"
-#define SF_NAME		"4224"
-
-/*
- * structure sizes (bytes in file; add digits in SF_*)
- */
-#define SZ_HEAD		20
-#define SZ_SECT		20
-#define SZ_RELO		8
-#define SZ_NAME		12
-
-/*
- * file access macros
- */
-#define BADMAGIC(x)	((x).oh_magic!=O_MAGIC)
-#define OFF_SECT(x)	SZ_HEAD
-#define OFF_EMIT(x)	(OFF_SECT(x) + ((long)(x).oh_nsect * SZ_SECT))
-#define OFF_RELO(x)	(OFF_EMIT(x) + (x).oh_nemit)
-#define OFF_NAME(x)	(OFF_RELO(x) + ((long)(x).oh_nrelo * SZ_RELO))
-#define OFF_CHAR(x)	(OFF_NAME(x) + ((long)(x).oh_nname * SZ_NAME))
-
-#endif /* __OUT_H_INCLUDED */
Index: trunk/minix/commands/autil/ranlib.h
===================================================================
--- trunk/minix/commands/autil/ranlib.h	(revision 9)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id: ranlib.h,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-
-#ifndef __RANLIB_H_INCLUDED
-#define __RANLIB_H_INCLUDED
-
-#ifndef SYMDEF
-#	define SYMDEF	"__.SYMDEF"
-#endif /* SYMDEF */
-
-/*
- * Structure of the SYMDEF table of contents for an archive.
- * SYMDEF begins with a long giving the number of ranlib
- * structures that immediately follow, and then continues with a string
- * table consisting of a long giving the number of bytes of
- * strings that follow and then the strings themselves.
- */
-struct ranlib {
-	union {
-	  char	*ran__ptr;	/* symbol name (in core) */
-	  long	ran__off;	/* symbol name (in file) */
-	}	ran_u;
-#define ran_ptr ran_u.ran__ptr
-#define ran_off ran_u.ran__off
-	long	ran_pos;	/* library member is at this position */
-};
-
-#define SZ_RAN	8
-#define SF_RAN	"44"
-
-#endif /* __RANLIB_H_INCLUDED */
Index: trunk/minix/commands/autil/rd.c
===================================================================
--- trunk/minix/commands/autil/rd.c	(revision 9)
+++ 	(revision )
@@ -1,260 +1,0 @@
-/* $Id: rd.c,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-#include "obj.h"
-
-extern long		lseek();
-
-/*
- * Parts of the output file.
- */
-#undef PARTEMIT
-#undef PARTRELO
-#undef PARTNAME
-#undef PARTCHAR
-#undef PARTDBUG
-#undef NPARTS
-
-#define	PARTEMIT	0
-#define	PARTRELO	1
-#define	PARTNAME	2
-#define	PARTCHAR	3
-#ifdef SYMDBUG
-#define PARTDBUG	4
-#else
-#define PARTDBUG	3
-#endif
-#define	NPARTS		(PARTDBUG + 1)
-
-static long		offset[MAXSECT];
-
-static int		outfile;
-static long		outseek[NPARTS];
-static long		currpos;
-static long		rd_base;
-#define OUTSECT(i) \
-	(outseek[PARTEMIT] = offset[i])
-#define BEGINSEEK(p, o) \
-	(outseek[(p)] = (o))
-
-static int sectionnr;
-
-static void
-OUTREAD(p, b, n)
-	char *b;
-	long n;
-{
-	register long l = outseek[p];
-
-	if (currpos != l) {
-		lseek(outfile, l, 0);
-	}
-	rd_bytes(outfile, b, n);
-	l += n;
-	currpos = l;
-	outseek[p] = l;
-}
-
-/*
- * Open the output file according to the chosen strategy.
- */
-int
-rd_open(f)
-	char *f;
-{
-
-	if ((outfile = open(f, 0)) < 0)
-		return 0;
-	return rd_fdopen(outfile);
-}
-
-static int offcnt;
-
-int
-rd_fdopen(fd)
-{
-	register int i;
-
-	for (i = 0; i < NPARTS; i++) outseek[i] = 0;
-	offcnt = 0;
-	rd_base = lseek(fd, 0L, 1);
-	if (rd_base < 0) {
-		return 0;
-	}
-	currpos = rd_base;
-	outseek[PARTEMIT] = currpos;
-	outfile = fd;
-	sectionnr = 0;
-	return 1;
-}
-
-void
-rd_close()
-{
-
-	close(outfile);
-	outfile = -1;
-}
-
-int
-rd_fd()
-{
-	return outfile;
-}
-
-void
-rd_ohead(head)
-	register struct outhead	*head;
-{
-	register long off;
-
-	OUTREAD(PARTEMIT, (char *) head, (long) SZ_HEAD);
-#if BYTE_ORDER == 0x0123
-	if (sizeof(struct outhead) != SZ_HEAD)
-#endif
-	{
-		register char *c = (char *) head + (SZ_HEAD-4);
-		
-		head->oh_nchar = get4(c);
-		c -= 4; head->oh_nemit = get4(c);
-		c -= 2; head->oh_nname = uget2(c);
-		c -= 2; head->oh_nrelo = uget2(c);
-		c -= 2; head->oh_nsect = uget2(c);
-		c -= 2; head->oh_flags = uget2(c);
-		c -= 2; head->oh_stamp = uget2(c);
-		c -= 2; head->oh_magic = uget2(c);
-	}
-	off = OFF_RELO(*head) + rd_base;
-	BEGINSEEK(PARTRELO, off);
-	off += (long) head->oh_nrelo * SZ_RELO;
-	BEGINSEEK(PARTNAME, off);
-	off += (long) head->oh_nname * SZ_NAME;
-	BEGINSEEK(PARTCHAR, off);
-#ifdef SYMDBUG
-	off += head->oh_nchar;
-	BEGINSEEK(PARTDBUG, off);
-#endif
-}
-
-void
-rd_rew_relos(head)
-	register struct outhead *head;
-{
-	register long off = OFF_RELO(*head) + rd_base;
-
-	BEGINSEEK(PARTRELO, off);
-}
-
-void
-rd_sect(sect, cnt)
-	register struct outsect	*sect;
-	register unsigned int	cnt;
-{
-	register char *c = (char *) sect + cnt * SZ_SECT;
-
-	OUTREAD(PARTEMIT, (char *) sect, (long)cnt * SZ_SECT);
-	sect += cnt;
-	offcnt += cnt;
-	while (cnt--) {
-		sect--;
-#if BYTE_ORDER == 0x0123
-		if (sizeof(struct outsect) != SZ_SECT)
-#endif
-		{
-			c -= 4; sect->os_lign = get4(c);
-			c -= 4; sect->os_flen = get4(c);
-			c -= 4; sect->os_foff = get4(c);
-			c -= 4; sect->os_size = get4(c);
-			c -= 4; sect->os_base = get4(c);
-		}
-		offset[--offcnt] = sect->os_foff + rd_base;
-	}
-}
-
-void
-rd_outsect(s)
-{
-	OUTSECT(s);
-	sectionnr = s;
-}
-
-/*
- * We don't have to worry about byte order here.
- */
-void
-rd_emit(emit, cnt)
-	char		*emit;
-	long		cnt;
-{
-	OUTREAD(PARTEMIT, emit, cnt);
-	offset[sectionnr] += cnt;
-}
-
-void
-rd_relo(relo, cnt)
-	register struct outrelo	*relo;
-	register unsigned int cnt;
-{
-
-	OUTREAD(PARTRELO, (char *) relo, (long) cnt * SZ_RELO);
-#if BYTE_ORDER == 0x0123
-	if (sizeof(struct outrelo) != SZ_RELO)
-#endif
-	{
-		register char *c = (char *) relo + (long) cnt * SZ_RELO;
-
-		relo += cnt;
-		while (cnt--) {
-			relo--;
-			c -= 4; relo->or_addr = get4(c);
-			c -= 2; relo->or_nami = uget2(c);
-			relo->or_sect = *--c;
-			relo->or_type = *--c;
-		}
-	}
-}
-
-void
-rd_name(name, cnt)
-	register struct outname	*name;
-	register unsigned int cnt;
-{
-
-	OUTREAD(PARTNAME, (char *) name, (long) cnt * SZ_NAME);
-#if BYTE_ORDER == 0x0123
-	if (sizeof(struct outname) != SZ_NAME)
-#endif
-	{
-		register char *c = (char *) name + (long) cnt * SZ_NAME;
-
-		name += cnt;
-		while (cnt--) {
-			name--;
-			c -= 4; name->on_valu = get4(c);
-			c -= 2; name->on_desc = uget2(c);
-			c -= 2; name->on_type = uget2(c);
-			c -= 4; name->on_foff = get4(c);
-		}
-	}
-}
-
-void
-rd_string(addr, len)
-	char *addr;
-	long len;
-{
-	
-	OUTREAD(PARTCHAR, addr, len);
-}
-
-#ifdef SYMDBUG
-void
-rd_dbug(buf, size)
-	char		*buf;
-	long		size;
-{
-	OUTREAD(PARTDBUG, buf, size);
-}
-#endif
Index: trunk/minix/commands/autil/rd_arhdr.c
===================================================================
--- trunk/minix/commands/autil/rd_arhdr.c	(revision 9)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/* $Id: rd_arhdr.c,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-#include "obj.h"
-
-int
-rd_arhdr(fd, arhdr)
-	register struct ar_hdr	*arhdr;
-{
-	char buf[AR_TOTAL];
-	register char *c = buf;
-	register char *p = arhdr->ar_name;
-	register int i;
-
-	i = read(fd, c, AR_TOTAL);
-	if (i == 0) return 0;
-	if (i != AR_TOTAL) {
-		rd_fatal();
-	}
-	i = 14;
-	while (i--) {
-		*p++ = *c++;
-	}
-	arhdr->ar_date = ((long) get2(c)) << 16; c += 2;
-	arhdr->ar_date |= ((long) get2(c)) & 0xffff; c += 2;
-	arhdr->ar_uid = *c++;
-	arhdr->ar_gid = *c++;
-	arhdr->ar_mode = get2(c); c += 2;
-	arhdr->ar_size = (long) get2(c) << 16; c += 2;
-	arhdr->ar_size |= (long) get2(c) & 0xffff;
-	return 1;
-}
Index: trunk/minix/commands/autil/rd_bytes.c
===================================================================
--- trunk/minix/commands/autil/rd_bytes.c	(revision 9)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/* $Id: rd_bytes.c,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-
-#include "obj.h"
-
-#define MININT		(1 << (sizeof(int) * 8 - 1))
-#define MAXCHUNK	(~MININT)	/* Highest count we read(2).	*/
-/* Unfortunately, MAXCHUNK is too large with some  compilers. Put it in
-   an int!
-*/
-
-static int maxchunk = MAXCHUNK;
-
-/*
- * We don't have to worry about byte order here.
- * Just read "cnt" bytes from file-descriptor "fd".
- */
-void 
-rd_bytes(fd, string, cnt)
-	register char	*string;
-	register long	cnt;
-{
-
-	while (cnt) {
-		register int n = cnt >= maxchunk ? maxchunk : cnt;
-
-		if (read(fd, string, n) != n)
-			rd_fatal();
-		string += n;
-		cnt -= n;
-	}
-}
Index: trunk/minix/commands/autil/rd_unsig2.c
===================================================================
--- trunk/minix/commands/autil/rd_unsig2.c	(revision 9)
+++ 	(revision )
@@ -1,15 +1,0 @@
-/* $Id: rd_unsig2.c,v 1.1 2005/06/23 09:50:54 philip Exp $ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-#include "obj.h"
-
-unsigned int
-rd_unsigned2(fd)
-{
-	char buf[2];
-
-	rd_bytes(fd, buf, 2L);
-	return uget2(buf);
-}
