1 /* $Id: sysdef.h,v 1.2.2.1 2003/02/23 14:32:58 amura Exp $ */ 2 /* 3 * BSD unix based systems (sunos, ultrix) 4 */ 5 6 /* 7 * $Log: sysdef.h,v $ 8 * Revision 1.2.2.1 2003/02/23 14:32:58 amura 9 * canna_init() must be called after setttysize() on ttyio.c 10 * 11 * Revision 1.2 2000/06/27 01:59:42 amura 12 * small bugfix 13 * 14 * Revision 1.1.1.1 2000/06/27 01:48:02 amura 15 * import to CVS 16 * 17 */ 18 19 #include <stdio.h> 20 #include <unistd.h> /* 00.04.15 by amura */ 21 #include <sys/param.h> 22 23 #define KBLOCK 8192 /* Kill grow. */ 24 #define GOOD 0 /* Good exit status. */ 25 #define SYMBLINK 1 /* Handle symbolic links */ 26 #define MAXPATH 256 /* Maximum length of path for chdir */ 27 #ifndef NO_SHELL /* 91.01.10 by K.Maeda */ 28 #define CMDLINELENGTH 128 /* Maximum length of shell command. */ 29 #endif /* NO_SHELL */ 30 #define BSMAP FALSE /* Bs map feature can use. */ 31 /* (default mode is bsmap off) */ 32 #define MAKEBACKUP TRUE /* Making backup file is on. */ 33 34 typedef int RSIZE; /* Type for file/region sizes */ 35 typedef short KCHAR; /* Type for internal keystrokes */ 36 37 #ifdef BSD4_4 38 #define HAVE_MKSTEMP 39 #define HAVE_GETCWD 40 #define HAVE_FDSET 41 #define HAVE_DIRENT 42 #else 43 #define NO_PID_TYPE 44 #define NO_SIG_TYPE 45 #endif 46 47 #if 0 48 #ifdef __FreeBSD__ 49 #if __FreeBSD__ >= 3 50 # define HAVE_GETSID 51 #endif 52 #else /* NOT __FreeBSD__ */ 53 #ifdef _POSIX_JOB_CONTROL /* This is trick */ 54 # if (0 - _POSIX_JOB_CONTROL - 1) != -1 55 # define HAVE_GETSID 56 # endif 57 #endif /* _POSIX_JOB_CONTROL */ 58 #endif /* __FreeBSD__ */ 59 #endif 60 61 #ifdef NO_PID_TYPE 62 # undef PID_T 63 # define PID_T int 64 #else 65 #ifndef PID_T 66 # define PID_T pid_t 67 #endif 68 #endif 69 70 #ifdef NO_SIG_TYPE 71 # undef SIG_T 72 typedef void (*SIG_T)(); 73 /* If your compiler doesn't have void, rewrite this "int (*SIG_T)()" 74 Cannot use VOID because it's defined later... */ 75 #else 76 #ifndef SIG_T 77 # define SIG_T sig_t 78 #endif 79 #endif 80 81 #ifdef NO_FDSET 82 # undef FDSET 83 # define FDSET int 84 # define FD_SET(fd,fdsp) ((*fdsp) |= (1<<(fd))) 85 # define FD_ZERO(fdsp) ((*fdsp) = 0) 86 #else 87 #ifndef FDSET 88 # define FDSET fd_set 89 #else 90 #include <sys/types.h> 91 #endif 92 #endif 93 94 /* 95 * Macros used by the buffer name making code. 96 * Start at the end of the file name, scan to the left 97 * until BDC1 (or BDC2, if defined) is reached. The buffer 98 * name starts just to the right of that location, and 99 * stops at end of string (or at the next BDC3 character, 100 * if defined). BDC2 and BDC3 are mainly for VMS. 101 */ 102 #define BDC1 '/' /* Buffer names. */ 103 104 #define MALLOCROUND(m) (m+=7,m&=~7) /* round up to 8 byte boundry */ 105 106 #define fncmp strcmp /* file name comparison */ 107 #define unlinkdir(fn) rmdir(fn) /* unlink directory */ 108 char *getenv(); 109 #define gettermtype() getenv("TERM") /* determine terminal type */ 110 111