xref: /original-bsd/lib/libedit/sys.h (revision c3e32dec)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Christos Zoulas of Cornell University.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)sys.h	8.1 (Berkeley) 06/04/93
11  */
12 
13 /*
14  * sys.h: Put all the stupid compiler and system dependencies here...
15  */
16 #ifndef _h_sys
17 #define _h_sys
18 
19 #ifndef public
20 # define public		/* Externally visible functions/variables */
21 #endif
22 
23 #ifndef private
24 # define private	static	/* Always hidden internals */
25 #endif
26 
27 #ifndef protected
28 # define protected	/* Redefined from elsewhere to "static" */
29 			/* When we want to hide everything	*/
30 #endif
31 
32 #include <sys/cdefs.h>
33 
34 #ifndef _PTR_T
35 # define _PTR_T
36 # if __STDC__
37 typedef void* ptr_t;
38 # else
39 typedef char* ptr_t;
40 # endif
41 #endif
42 
43 #ifndef _IOCTL_T
44 # define _IOCTL_T
45 # if __STDC__
46 typedef void* ioctl_t;
47 # else
48 typedef char* ioctl_t;
49 # endif
50 #endif
51 
52 #include <stdio.h>
53 #define REGEXP
54 
55 #ifdef SUNOS
56 # undef REGEXP
57 # include <malloc.h>
58 typedef void (*sig_t)__P((int));
59 # ifdef __GNUC__
60 /*
61  * Broken hdrs.
62  */
63 extern char    *getenv		__P((const char *));
64 extern int	fprintf		__P((FILE *, const char *, ...));
65 extern int	sigsetmask	__P((int));
66 extern int	sigblock	__P((int));
67 extern int	ioctl		__P((int, int, void *));
68 extern int	fputc		__P((int, FILE *));
69 extern int	fgetc		__P((FILE *));
70 extern int	fflush		__P((FILE *));
71 extern int	tolower		__P((int));
72 extern int	toupper		__P((int));
73 extern int	errno, sys_nerr;
74 extern char	*sys_errlist[];
75 extern void	perror		__P((const char *));
76 extern int	read		__P((int, const char*, int));
77 #  include <string.h>
78 #  define strerror(e)	sys_errlist[e]
79 # endif
80 # ifdef SABER
81 extern ptr_t    memcpy		__P((ptr_t, const ptr_t, size_t));
82 extern ptr_t    memset		__P((ptr_t, int, size_t));
83 # endif
84 extern char    *fgetline	__P((FILE *, int *));
85 #endif
86 
87 #endif /* _h_sys */
88