From cd3e3d7abbd76c2b8aba74715681988fcc42913a Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Wed, 26 May 1993 01:54:12 +0000 Subject: [PATCH] gzip 1.3.5 --- primos/ci.opts | 6 +++ primos/include/errno.h | 17 ++++++++ primos/include/fcntl.h | 22 ++++++++++ primos/include/stdlib.h | 16 +++++++ primos/include/sysStat.h | 92 +++++++++++++++++++++++++++++++++++++++ primos/include/sysTypes.h | 25 +++++++++++ 6 files changed, 178 insertions(+) create mode 100644 primos/ci.opts create mode 100644 primos/include/errno.h create mode 100644 primos/include/fcntl.h create mode 100644 primos/include/stdlib.h create mode 100644 primos/include/sysStat.h create mode 100644 primos/include/sysTypes.h diff --git a/primos/ci.opts b/primos/ci.opts new file mode 100644 index 0000000..bb4f9b3 --- /dev/null +++ b/primos/ci.opts @@ -0,0 +1,6 @@ +-define PRIMOS +-include *>PRIMOS>INCLUDE +-ignoreregister +-packbytes +-sof + diff --git a/primos/include/errno.h b/primos/include/errno.h new file mode 100644 index 0000000..ee89146 --- /dev/null +++ b/primos/include/errno.h @@ -0,0 +1,17 @@ +/* +** errno.h +** +** Emulation of the Unix errno.h header file for PRIMOS +** +** Author: Peter Eriksson +*/ + +#ifndef __ERRNO_H__ +#define __ERRNO_H__ + +#include + +#define ENOENT e$fntf + +#endif + diff --git a/primos/include/fcntl.h b/primos/include/fcntl.h new file mode 100644 index 0000000..9e4b1dc --- /dev/null +++ b/primos/include/fcntl.h @@ -0,0 +1,22 @@ +/* +** fcntl.h +** +** Emulation of the Unix fcntl.h header file for PRIMOS +** +** Author: Peter Eriksson +*/ + +#ifndef __FCNTL_H__ +#define __FCNTL_H__ + +#define O_RDONLY 0 +#define O_WRONLY 1 +#define O_RDWR 2 + +#define O_BINARY 0 +#define O_EXCL 0 +#define O_NDELAY 0 +#define O_CREAT 0 +#define O_TRUNC 0 + +#endif diff --git a/primos/include/stdlib.h b/primos/include/stdlib.h new file mode 100644 index 0000000..49fbfc3 --- /dev/null +++ b/primos/include/stdlib.h @@ -0,0 +1,16 @@ +/* +** stdlib.h +** +** Emulation of the Unix stdlib.h header file for PRIMOS +** +** Author: Peter Eriksson +*/ + +#ifndef __STDLIB_H__ +#define __STDLIB_H__ + +extern char *malloc(); +extern char *calloc(); + +#endif + diff --git a/primos/include/sysStat.h b/primos/include/sysStat.h new file mode 100644 index 0000000..c24d20b --- /dev/null +++ b/primos/include/sysStat.h @@ -0,0 +1,92 @@ +/* +** sys/stat.h +** +** Emulation of the Unix sys/stat.h header file for PRIMOS +** +** Author: Peter Eriksson +*/ + +#ifndef __SYS_STAT_H__ +#define __SYS_STAT_H__ + + +#include + +struct stat { + /* First some PRIMOS standard entries */ + off_t st_size; + time_t st_mtime; + short st_type; /* Primos file type */ + short st_rwlock; /* Primos read/write lock */ + + /* Begin Unix compatibility - don't believe these entries! */ + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + short st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + time_t st_atime; + time_t st_ctime; + long st_blksize; + long st_blocks; +}; + +#define _IFMT 0170000 /* type of file */ +#define _IFREG 0100000 /* regular */ +#define _IFDIR 0040000 /* directory */ + +/* Some stupid programs check if these are defined and then + believe these are supported in the OS - not so in PRIMOS ... */ +#ifndef __50SERIES +# define _IFCHR 0020000 +# define _IFBLK 0060000 +# define _IFLNK 0120000 +# define _IFSOCK 0140000 +# define _IFIFO 0010000 +#endif + +#define S_ISUID 0004000 +#define S_ISGID 0002000 +#define S_ISVTX 0001000 +#define S_IREAD 0000400 +#define S_IWRITE 0000200 +#define S_IEXEC 0000100 + +#define S_ENFMT 0002000 + +#define S_IFMT _IFMT +#define S_IFREG _IFREG +#define S_IFDIR _IFDIR +#ifndef __50SERIES +# define S_IFCHR _IFCHR +# define S_IFBLK _IFBLK +# define S_IFLNK _IFLNK +# define S_IFSOCK _IFSOCK +# define S_IFIFO _IFIFO +#endif + +#define S_IRWXU 0000700 +#define S_IRUSR 0000400 +#define S_IWUSR 0000200 +#define S_IXUSR 0000100 +#define S_IRWXG 0000070 +#define S_IRGRP 0000040 +#define S_IWGRP 0000020 +#define S_IXGRP 0000010 +#define S_IRWXO 0000007 +#define S_IROTH 0000004 +#define S_IWOTH 0000002 +#define S_IXOTH 0000001 + +#define S_ISREG(m) (((m) & _IFMT) == _IFREG) +#define S_ISDIR(m) (((m) & _IFMT) == _IFDIR) +#ifndef __50SERIES +# define S_ISBLK(m) (((m) & _IFMT) == _IFBLK) +# define S_ISCHR(m) (((m) & _IFMT) == _IFCHR) +# define S_ISFIFO(m) (((m) & _IFMT) == _IFIFO) +#endif + + +#endif diff --git a/primos/include/sysTypes.h b/primos/include/sysTypes.h new file mode 100644 index 0000000..ec6c5b1 --- /dev/null +++ b/primos/include/sysTypes.h @@ -0,0 +1,25 @@ +/* +** sys/types.h +** +** Emulation of the Unix sys/types.h header file for PRIMOS +** +** Author: Peter Eriksson +*/ + +#ifndef __SYS_TYPES_H__ +#define __SYS_TYPES_H__ + +typedef long size_t; +typedef long time_t; + +typedef long off_t; +typedef short dev_t; +typedef short ino_t; +typedef short mode_t; +typedef short uid_t; +typedef short gid_t; + +typedef char *caddr_t; + +#endif + -- 2.47.2