1 /* System dependent declarations. 2 Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc. 3 4 This file is part of GNU DIFF. 5 6 GNU DIFF is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 GNU DIFF is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with GNU DIFF; see the file COPYING. If not, write to 18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 19 20 #include <sys/types.h> 21 #include <sys/stat.h> 22 #define STDC_HEADERS 1 23 24 #ifndef S_ISDIR 25 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) 26 #endif 27 #ifndef S_ISREG 28 #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 29 #endif 30 31 #include <unistd.h> 32 33 #include <time.h> 34 35 #include <fcntl.h> 36 37 #ifndef O_RDONLY 38 #define O_RDONLY 0 39 #endif 40 41 #include <sys/wait.h> 42 43 #define STAT_BLOCKSIZE(s) (s).st_blksize 44 45 #include <dirent.h> 46 #ifdef direct 47 #undef direct 48 #endif 49 50 #include <string.h> 51 #ifndef index 52 #define index strchr 53 #endif 54 #ifndef rindex 55 #define rindex strrchr 56 #endif 57 #define bcopy(s,d,n) memcpy (d,s,n) 58 #define bcmp(s1,s2,n) memcmp (s1,s2,n) 59 #define bzero(s,n) memset (s,0,n) 60 61 #include <stdlib.h> 62 #include <limits.h> 63 64 #include <errno.h> 65 66 #ifdef TRUE 67 #undef TRUE 68 #endif 69 #ifdef FALSE 70 #undef FALSE 71 #endif 72 #define TRUE 1 73 #define FALSE 0 74 75 #if !__STDC__ 76 #define volatile 77 #endif 78 79 #define min(a,b) ((a) <= (b) ? (a) : (b)) 80 #define max(a,b) ((a) >= (b) ? (a) : (b)) 81