xref: /openbsd-src/lib/libedit/sys.h (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1 /*	$OpenBSD: sys.h,v 1.4 1997/07/25 20:30:16 mickey Exp $	*/
2 /*	$NetBSD: sys.h,v 1.3 1997/01/11 06:48:12 lukem Exp $	*/
3 
4 /*-
5  * Copyright (c) 1992, 1993
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * This code is derived from software contributed to Berkeley by
9  * Christos Zoulas of Cornell University.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. All advertising materials mentioning features or use of this software
20  *    must display the following acknowledgement:
21  *	This product includes software developed by the University of
22  *	California, Berkeley and its contributors.
23  * 4. Neither the name of the University nor the names of its contributors
24  *    may be used to endorse or promote products derived from this software
25  *    without specific prior written permission.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37  * SUCH DAMAGE.
38  *
39  *	@(#)sys.h	8.1 (Berkeley) 6/4/93
40  */
41 
42 /*
43  * sys.h: Put all the stupid compiler and system dependencies here...
44  */
45 #ifndef _h_sys
46 #define _h_sys
47 
48 #ifndef public
49 # define public		/* Externally visible functions/variables */
50 #endif
51 
52 #ifndef private
53 # define private	static	/* Always hidden internals */
54 #endif
55 
56 #ifndef protected
57 # define protected	/* Redefined from elsewhere to "static" */
58 			/* When we want to hide everything	*/
59 #endif
60 
61 #include <sys/cdefs.h>
62 
63 #ifndef _PTR_T
64 # define _PTR_T
65 # ifdef __STDC__
66 typedef void* ptr_t;
67 # else
68 typedef char* ptr_t;
69 # endif
70 #endif
71 
72 #ifndef _IOCTL_T
73 # define _IOCTL_T
74 # ifdef __STDC__
75 typedef void* ioctl_t;
76 # else
77 typedef char* ioctl_t;
78 # endif
79 #endif
80 
81 #include <stdio.h>
82 
83 #define	REGEX		/* Use POSIX.2 regular expression functions */
84 #undef	REGEXP		/* Use UNIX V8 regular expression functions */
85 
86 #ifdef SUNOS
87 # undef REGEX
88 # undef REGEXP
89 # include <malloc.h>
90 typedef void (*sig_t)__P((int));
91 # ifdef __GNUC__
92 /*
93  * Broken hdrs.
94  */
95 extern char    *getenv		__P((const char *));
96 extern int	fprintf		__P((FILE *, const char *, ...));
97 extern int	sigsetmask	__P((int));
98 extern int	sigblock	__P((int));
99 extern int	ioctl		__P((int, int, void *));
100 extern int	fputc		__P((int, FILE *));
101 extern int	fgetc		__P((FILE *));
102 extern int	fflush		__P((FILE *));
103 extern int	tolower		__P((int));
104 extern int	toupper		__P((int));
105 extern int	errno, sys_nerr;
106 extern char	*sys_errlist[];
107 extern void	perror		__P((const char *));
108 extern int	read		__P((int, const char*, int));
109 #  include <string.h>
110 #  define strerror(e)	sys_errlist[e]
111 # endif
112 # ifdef SABER
113 extern ptr_t    memcpy		__P((ptr_t, const ptr_t, size_t));
114 extern ptr_t    memset		__P((ptr_t, int, size_t));
115 # endif
116 extern char    *fgetline	__P((FILE *, int *));
117 #endif
118 
119 #endif /* _h_sys */
120