[comp.os.minix] changes for PD-Tar, part 1 of 3

rmtodd@uokmax.UUCP (Richard Michael Todd) (12/10/87)

 This shar file contains the new and revised header files in /usr/include.
(Actually not all of these are needed for PD Tar; some are ones that have
been patched for other reasons and have already appeared on comp.os.minix.
I just pulled out everything newer than the MINIX original distribution.)
Just unpack the shar.  Some programs expect errno.h and stat.h to be in
/usr/include/sys, so cd to /usr/include and do 'ln errno.h sys/errno.h ;
ln stat.h sys/stat.h'.
--------------------------------- cut here --------------------------------
#!/bin/sh
# Shell archive created with Richard Todd's makeshar on Tue Dec  8 12:35:08 1987
mkdir sys
echo x - dirent.h
sed 's/^X//' >dirent.h << 'EOF'
X/*
X	<dirent.h> -- definitions for SVR3 directory access routines
X
X	last edit:	25-Apr-1987	D A Gwyn
X
X	Prerequisite:	<sys/types.h>
X*/
X
X#include	<sys/dirent.h>
X
X#define	DIRBUF		2048		/* buffer size for fs-indep. dirs */
X	/* must in general be larger than the filesystem buffer size */
X
Xtypedef struct
X	{
X	int	dd_fd;			/* file descriptor */
X	int	dd_loc;			/* offset in block */
X	int	dd_size;		/* amount of valid data */
X	char	*dd_buf;		/* -> directory block */
X	}	DIR;			/* stream data from opendir() */
X
Xextern DIR		*opendir();
Xextern struct dirent	*readdir();
Xextern off_t		telldir();
Xextern void		seekdir();
Xextern void		rewinddir();
Xextern int		closedir();
X
X#ifndef NULL
X#define	NULL	0			/* DAG -- added for convenience */
X#endif
EOF
echo x - fcntl.h
sed 's/^X//' >fcntl.h << 'EOF'
X#define O_RDONLY 0
X#define O_WRONLY 1
X#define O_RDWR 2
X
EOF
echo x - grp.h
sed 's/^X//' >grp.h << 'EOF'
Xstruct	group { 
X	char	*name;
X	char	*passwd;
X	int	gid;
X};
X#define gr_name name
X#define gr_gid gid
X#define gr_passwd passwd
EOF
echo x - pwd.h
sed 's/^X//' >pwd.h << 'EOF'
Xstruct passwd {
X	char *pw_name;
X	char *pw_passwd;
X	int pw_uid;
X	int pw_gid;
X	char *pw_gecos;
X	char *pw_dir;
X	char *pw_shell;
X};
EOF
echo x - stdio.h
sed 's/^X//' >stdio.h << 'EOF'
X#define BUFSIZ  1024
X#define NFILES  20
X#define NULL       0
X#define EOF     (-1)
X#define CMASK   0377
X
X#define READMODE     1
X#define WRITEMODE    2
X#define UNBUFF       4
X#define _EOF         8
X#define _ERR        16
X#define IOMYBUF     32
X#define PERPRINTF   64
X#define STRINGS    128
X
X#ifndef FILE
X
Xextern struct _io_buf {
X    int     _fd;
X    int     _count;
X    int     _flags;
X    char   *_buf;
X    char   *_ptr;
X}  *_io_table[NFILES];
X
X
X#endif	/* FILE */
X
X#define FILE struct _io_buf
X
X
X#define stdin  (_io_table[0])	
X#define stdout 	(_io_table[1])
X#define stderr 	(_io_table[2])
X
X#define getchar() 		getc(stdin)
X#define putchar(c) 		putc(c,stdout)
X#define fgetc(f)		getc(f)
X#define fputc(c,f)		putc(c,f)
X#define feof(p) 		(((p)->_flags & _EOF) != 0)
X#define ferror(p) 		(((p)->_flags & _ERR) != 0)
X#define fileno(p) 		((p)->_fd)
X#define rewind(f)		fseek(f, 0L, 0)
X#define testflag(p,x)		((p)->_flags & (x))
X
X/* If you want a stream to be flushed after each printf use:
X * 
X *	perprintf(stream);
X *
X * If you want to stop with this kind of buffering use:
X *
X *	noperprintf(stream);
X */
X
X#define noperprintf(p)		((p)->_flags &= ~PERPRINTF)
X#define perprintf(p)		((p)->_flags |= PERPRINTF)
EOF
echo x - sys/dir.h
sed 's/^X//' >sys/dir.h << 'EOF'
X/*
X** /usr/include/sys/dir.h -- include file for structure of V7 style directory
X** Written 6-16-87 by RMTodd
X** Prerequisite:sys/types.h
X*/
X
X#define NAME_MAX 14
Xstruct direct {
X	ino_t d_ino;
X	char d_name[NAME_MAX];
X}; /* directory entry for MINIX (V7-style) filesystem */
X#define DIRSIZ NAME_MAX
EOF
echo x - sys/dirent.h
sed 's/^X//' >sys/dirent.h << 'EOF'
X/*
X	<sys/dirent.h> -- file system independent directory entry (SVR3)
X
X	last edit:	25-Apr-1987	D A Gwyn
X
X	prerequisite:	<sys/types.h>
X*/
X
Xstruct dirent				/* data from getdents()/readdir() */
X	{
X	long		d_ino;		/* inode number of entry */
X	off_t		d_off;		/* offset of disk directory entry */
X	unsigned short	d_reclen;	/* length of this record */
X	char		d_name[1];	/* name of file */	/* non-POSIX */
X	};
X
X/* The following nonportable ugliness could have been avoided by defining
X   DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. */
X#define	DIRENTBASESIZ		(((struct dirent *)0)->d_name \
X				- (char *)&((struct dirent *)0)->d_ino)
X#define	DIRENTSIZ( namlen )	((DIRENTBASESIZ + sizeof(long) + (namlen)) \
X				/ sizeof(long) * sizeof(long))
X
X/* DAG -- the following was moved from <dirent.h>, which was the wrong place */
X#define	MAXNAMLEN	512		/* maximum filename length */
X
X#ifndef NAME_MAX
X#define	NAME_MAX	(MAXNAMLEN - 1)	/* DAG -- added for POSIX */
X#endif
EOF
echo x - sys/file.h
sed 's/^X//' >sys/file.h << 'EOF'
X/*
X** sys/file.h --  header file that contains the #defines for the 
X** 3-argument open call (or actually our emulation of the BSD-style open).
X*/
X#define O_RDONLY	 0 /* only allow read */
X#define	O_WRONLY	 1 /* only allow write */
X#define	O_RDWR		 2 /* both are allowed */
X/* O_NDELAY isn't implemented by the emulator.  Does anyone really care? */
X#define O_NDELAY	 4 /* don't block on opening devices that would
X			   ** block on open.
X			   */
X#define O_CREAT		 8 /* create file if needed */
X#define O_EXCL		16 /* file cannot already exist */
X#define O_TRUNC		32 /* truncate file on open */
X
EOF
echo x - sys/types.h
sed 's/^X//' >sys/types.h << 'EOF'
X/*
X** /usr/include/sys/types.h -- include file declaring various types
X** commonly used by UNIX programs
X** Written 6-16-87 by RMTodd
X*/
Xtypedef unsigned short ino_t; /* inode number */
Xtypedef long off_t; /* offset into a file */
Xtypedef unsigned short dev_t;
X/* various #defines for manipulating dev_ts */
X#define makedev(maj,min) (((maj)<<8) | (min))
X#define minor(dev) ((dev)&0xff)
X#define major(dev) (((dev)>>8)&0xff)
X
Xtypedef long time_t;
EOF

CC06067%UAFSYSB.BITNET@wiscvm.wisc.edu (Christopher Corke) (12/15/87)

The header for a message I received was "changes for PD-Tar, part 1 of 3".

I never received parts 2 and 3.  Does anyone know where they are????

Christopher C. Corke
<CC06067@UAFSYSB>
University of Arkansas (Postmaster)
Department of Computing Services
Acknowledge-To: <CC06067@UAFSYSB>