summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/diff/system.h
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1993-09-16 17:39:00 +0000
committerjtc <jtc@NetBSD.org>1993-09-16 17:39:00 +0000
commit69a25a6a71efcadf0db55504379e7a74cecf54ca (patch)
tree70d25a47e8da160d611afa43ef8986aa2bbe62fa /gnu/usr.bin/diff/system.h
parent941b6d7b199d8c66a499f0baea38c26e5882e3c6 (diff)
Updated to GNU Diffutils 2.4.
Diffstat (limited to 'gnu/usr.bin/diff/system.h')
-rw-r--r--gnu/usr.bin/diff/system.h120
1 files changed, 75 insertions, 45 deletions
diff --git a/gnu/usr.bin/diff/system.h b/gnu/usr.bin/diff/system.h
index f736f7c1ff3..4b9d6bceea2 100644
--- a/gnu/usr.bin/diff/system.h
+++ b/gnu/usr.bin/diff/system.h
@@ -15,14 +15,20 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU DIFF; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id: system.h,v 1.2 1993/08/02 17:26:28 mycroft Exp $
-*/
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
+#if __STDC__
+#define PARAMS(args) args
+#define VOID void
+#else
+#define PARAMS(args) ()
+#define VOID char
+#endif
+
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
@@ -30,10 +36,37 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
+#ifndef S_IXOTH
+#define S_IXOTH 1
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP (S_IXOTH << 3)
+#endif
+#ifndef S_IXUSR
+#define S_IXUSR (S_IXGRP << 3)
+#endif
+
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
+
#if HAVE_TIME_H
#include <time.h>
#else
@@ -76,15 +109,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#if HAVE_ST_BLKSIZE
#define STAT_BLOCKSIZE(s) (s).st_blksize
#else
-#define STAT_BLOCKSIZE(s) (S_ISREG ((s).st_mode) ? 8192 : 4096)
+#define STAT_BLOCKSIZE(s) (8 * 1024)
#endif
#if DIRENT || defined (_POSIX_VERSION)
#include <dirent.h>
-#ifdef direct
-#undef direct
-#endif
-#define direct dirent
#else /* ! (DIRENT || defined (_POSIX_VERSION)) */
#if SYSNDIR
#include <sys/ndir.h>
@@ -95,49 +124,57 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#include <ndir.h>
#endif
#endif
+#ifdef dirent
+#undef dirent
+#endif
+#define dirent direct
#endif /* ! (DIRENT || defined (_POSIX_VERSION)) */
#if HAVE_VFORK_H
#include <vfork.h>
#endif
-#if HAVE_STRING_H || STDC_HEADERS
-#include <string.h>
-#ifndef index
-#define index strchr
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+char *getenv ();
+VOID *malloc ();
+VOID *realloc ();
#endif
-#ifndef rindex
-#define rindex strrchr
+
+#if HAVE_LIMITS_H
+#include <limits.h>
#endif
-#ifndef bcopy
-#define bcopy(s,d,n) memcpy (d,s,n)
+#ifndef INT_MAX
+#define INT_MAX 2147483647
#endif
-#ifndef bcmp
-#define bcmp(s1,s2,n) memcmp (s1,s2,n)
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
#endif
+
+#if HAVE_STRING_H
+#include <string.h>
#ifndef bzero
-#define bzero(s,n) memset (s,0,n)
+#define bzero(s,n) memset (s,0,n)
#endif
-#else
+#else /* !HAVE_STRING_H */
#include <strings.h>
+#ifndef strchr
+#define strchr index
#endif
-#if !HAVE_MEMCHR && !STDC_HEADERS
-char *memchr ();
+#ifndef strrchr
+#define strrchr rindex
#endif
-
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <limits.h>
-#else
-char *getenv ();
-char *malloc ();
-char *realloc ();
-#if __STDC__ || __GNUC__
-#include "limits.h"
-#else
-#define INT_MAX 2147483647
-#define CHAR_BIT 8
+#ifndef memcpy
+#define memcpy(d,s,n) bcopy (s,d,n)
#endif
+#ifndef memcmp
+#define memcmp(s1,s2,n) bcmp (s1,s2,n)
+#endif
+#endif /* !HAVE_STRING_H */
+
+#if !HAVE_MEMCHR
+char *memchr ();
#endif
#include <errno.h>
@@ -145,18 +182,11 @@ char *realloc ();
extern int errno;
#endif
-#ifdef TRUE
-#undef TRUE
-#endif
-#ifdef FALSE
-#undef FALSE
-#endif
-#define TRUE 1
-#define FALSE 0
-
#if !__STDC__
+#ifndef volatile
#define volatile
#endif
+#endif
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))