xref: /csrg-svn/lib/libedit/sys.h (revision 54624)
1 /*-
2  * Copyright (c) 1992 The Regents of the University of California.
3  * 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	5.2 (Berkeley) 07/03/92
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 
54 #ifdef sun
55 typedef void (*sig_t)__P((int));
56 #ifdef __GNUC__
57 /*
58  * Broken hdrs.
59  */
60 extern char    *getenv		__P((const char *));
61 extern int	fprintf		__P((FILE *, const char *, ...));
62 extern int	sigsetmask	__P((int));
63 extern int	sigblock	__P((int));
64 extern int	ioctl		__P((int, int, void *));
65 extern int	fputc		__P((int, FILE *));
66 extern int	fgetc		__P((FILE *));
67 extern int	fflush		__P((FILE *));
68 extern int	tolower		__P((int));
69 extern int	toupper		__P((int));
70 extern int	errno, sys_nerr;
71 extern char	*sys_errlist[];
72 extern void	perror		__P((const char *));
73 extern int	read		__P((int, const char*, int));
74 #include <string.h>
75 #define strerror(e)	sys_errlist[e]
76 #endif
77 #ifdef SABER
78 extern ptr_t    memcpy		__P((ptr_t, const ptr_t, size_t));
79 extern ptr_t    memset		__P((ptr_t, int, size_t));
80 #endif
81 extern char    *fgetline	__P((FILE *, int *));
82 #endif
83 
84 #endif /* _h_sys */
85