File: sysdef.h

package info (click to toggle)
ng 1.5~beta1-13
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,160 kB
  • sloc: ansic: 44,018; asm: 3,150; sh: 2,539; cpp: 1,234; makefile: 578
file content (114 lines) | stat: -rw-r--r-- 2,692 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* $Id: sysdef.h,v 1.3 2000/12/14 18:10:46 amura Exp $ */
/*
 *		BSD unix based systems (sunos, ultrix)
 */

/*
 * $Log: sysdef.h,v $
 * Revision 1.3  2000/12/14 18:10:46  amura
 * filename length become flexible
 *
 * Revision 1.2  2000/06/27 01:59:42  amura
 * small bugfix
 *
 * Revision 1.1.1.1  2000/06/27 01:48:02  amura
 * import to CVS
 *
 */

#include <stdio.h>
#include <unistd.h>		/* 00.04.15 by amura		*/
#include <sys/param.h>

#define	KBLOCK	8192			/* Kill grow.			*/
#define	GOOD	0			/* Good exit status.		*/
#define	SYMBLINK	1		/* Handle symbolic links	*/
#ifndef	NO_SHELL	/* 91.01.10  by K.Maeda */
#define	CMDLINELENGTH	NFILEN		/* Maximum length of shell command. */
#endif	/* NO_SHELL */
#define	BSMAP	FALSE			/* Bs map feature can use.	*/
					/* (default mode is bsmap off)	*/
#define	MAKEBACKUP	TRUE		/* Making backup file is on.	*/

typedef int	RSIZE;			/* Type for file/region sizes	*/
typedef short	KCHAR;			/* Type for internal keystrokes	*/

#ifdef BSD4_4
#define HAVE_MKSTEMP
#define HAVE_GETCWD
#define HAVE_FDSET
#define HAVE_DIRENT
#else
#define NO_PID_TYPE
#define NO_SIG_TYPE
#endif

#if 0
#ifdef	__FreeBSD__
#if __FreeBSD__ >= 3
# define HAVE_GETSID
#endif
#else	/* NOT __FreeBSD__ */
#ifdef _POSIX_JOB_CONTROL		/* This is trick */
# if (0 - _POSIX_JOB_CONTROL - 1) != -1
#  define HAVE_GETSID
# endif
#endif	/* _POSIX_JOB_CONTROL */
#endif	/* __FreeBSD__ */
#endif

#ifdef NO_PID_TYPE
#  undef PID_T
#  define PID_T int
#else
#ifndef PID_T
#  define PID_T pid_t
#endif
#endif

#ifdef NO_SIG_TYPE
#  undef SIG_T
   typedef void (*SIG_T)();
/* If your compiler doesn't have void, rewrite this "int (*SIG_T)()"
   Cannot use VOID because it's defined later...  */
#else
#ifndef SIG_T
#  define SIG_T sig_t
#endif
#endif

#ifdef NO_FDSET
#  undef FDSET
#  define FDSET int
#  define FD_SET(fd,fdsp) ((*fdsp) |= (1<<(fd)))
#  define FD_ZERO(fdsp) ((*fdsp) = 0)
#else
#ifndef FDSET
#  define FDSET fd_set
#else
#include <sys/types.h>
#endif
#endif

/*
 * Macros used by the buffer name making code.
 * Start at the end of the file name, scan to the left
 * until BDC1 (or BDC2, if defined) is reached. The buffer
 * name starts just to the right of that location, and
 * stops at end of string (or at the next BDC3 character,
 * if defined). BDC2 and BDC3 are mainly for VMS.
 */
#define	BDC1	'/'			/* Buffer names.		*/

#ifdef CANNA
#define	SYSINIT canna_init()
#define SYSCLEANUP canna_end()
#endif

#define MALLOCROUND(m)	(m+=7,m&=~7)	/* round up to 8 byte boundry	*/

#define	fncmp		strcmp		/* file name comparison		*/
#define	unlinkdir(fn)	rmdir(fn)	/* unlink directory		*/
char *getenv();
#define	gettermtype()	getenv("TERM")	/* determine terminal type	*/