1 /*
2  * Copyright 1993 Network Computing Devices, Inc.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee, provided
6  * that the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name Network Computing Devices, Inc. not be
9  * used in advertising or publicity pertaining to distribution of this
10  * software without specific, written prior permission.
11  *
12  * THIS SOFTWARE IS PROVIDED 'AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
13  * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
14  * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15  * PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
16  * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
17  * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
18  * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
19  * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  * $NCDId: @(#)Aos.h,v 1.5 1995/12/06 19:25:56 greg Exp $
23  */
24 
25 /* Portions derived from */
26 /*
27  * $XConsortium: Xos.h,v 1.46 91/07/19 23:22:51 rws Exp $
28  *
29  * Copyright 1987 by the Massachusetts Institute of Technology
30  *
31  * Permission to use, copy, modify, and distribute this software and its
32  * documentation for any purpose and without fee is hereby granted, provided
33  * that the above copyright notice appear in all copies and that both that
34  * copyright notice and this permission notice appear in supporting
35  * documentation, and that the name of M.I.T. not be used in advertising
36  * or publicity pertaining to distribution of the software without specific,
37  * written prior permission. M.I.T. makes no representations about the
38  * suitability of this software for any purpose.  It is provided "as is"
39  * without express or implied warranty.
40  *
41  * The X Window System is a Trademark of MIT.
42  *
43  */
44 
45 /* This is a collection of things to try and minimize system dependencies
46  * in a "signficant" number of source files.
47  */
48 
49 #ifndef _AOS_H_
50 #define _AOS_H_
51 
52 #include <audio/Aosdefs.h>
53 
54 /*
55  * Get major data types (esp. caddr_t)
56  */
57 
58 #ifdef USG
59 #ifndef __TYPES__
60 #ifdef CRAY
61 #define word word_t
62 #endif /* CRAY */
63 #include <sys/types.h>			/* forgot to protect it... */
64 #define __TYPES__
65 #endif /* __TYPES__ */
66 #else /* USG */
67 #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
68 #undef _POSIX_SOURCE
69 #include <sys/types.h>
70 #define _POSIX_SOURCE
71 #else
72 #include <sys/types.h>
73 #endif
74 #endif /* USG */
75 
76 
77 /*
78  * Just about everyone needs the strings routines.  We provide both forms here,
79  * index/rindex and strchr/strrchr, so any systems that don't provide them all
80  * need to have #defines here.
81  */
82 
83 #ifndef AU_NOT_STDC_ENV
84 #include <string.h>
85 #define index strchr
86 #define rindex strrchr
87 #else
88 #if defined (SYSV) || defined (vms)
89 #include <string.h>
90 #define index strchr
91 #define rindex strrchr
92 #else
93 #include <strings.h>
94 #define strchr index
95 #define strrchr rindex
96 #endif
97 #endif
98 #ifdef WIN32
99 #define strcasecmp stricmp
100 #define strncasecmp strnicmp
101 #define isascii(c)      ((unsigned)(c)<=0177)
102 #endif /* WIN32 */
103 
104 #ifndef WIN32
105 #define AU_READ_BINARY "r"
106 #define AU_WRITE_BINARY "w"
107 #define AU_READ_TEXT "r"
108 #define AU_WRITE_TEXT "w"
109 #else /* WIN32 */
110 #define AU_READ_BINARY "rb"
111 #define AU_WRITE_BINARY "wb"
112 #define AU_READ_TEXT "r"
113 #define AU_WRITE_TEXT "w"
114 #endif /* WIN32 */
115 
116 /*
117  * Get open(2) constants
118  */
119 #ifdef AU_NOT_POSIX
120 #include <fcntl.h>
121 #ifdef USL
122 #include <unistd.h>
123 #endif /* USL */
124 #ifdef CRAY
125 #include <unistd.h>
126 #endif /* CRAY */
127 #ifdef SYSV386
128 #include <unistd.h>
129 #endif /* SYSV386 */
130 #ifndef WIN32
131 #include <sys/file.h>
132 #endif /* !WIN32 */
133 #else /* AU_NOT_POSIX */
134 #if !defined(_POSIX_SOURCE) && defined(macII)
135 #define _POSIX_SOURCE
136 #include <fcntl.h>
137 #undef _POSIX_SOURCE
138 #else
139 #include <fcntl.h>
140 #endif
141 #include <unistd.h>
142 #endif /* AU_NOT_POSIX else */
143 
144 /*
145  * Get struct timeval
146  */
147 
148 #ifdef SYSV
149 
150 #ifndef WIN32
151 #ifndef USL
152 #include <sys/time.h>
153 #endif
154 #endif /* !WIN32 */
155 #include <time.h>
156 #ifdef CRAY
157 #undef word
158 #endif /* CRAY */
159 #if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(labtam)
160 struct timeval {
161     long tv_sec;
162     long tv_usec;
163 };
164 #ifndef USL_SHARELIB
165 struct timezone {
166     int tz_minuteswest;
167     int tz_dsttime;
168 };
169 #endif /* USL_SHARELIB */
170 #endif /* USG */
171 
172 #else /* not SYSV */
173 
174 #if defined(_POSIX_SOURCE) && defined(SVR4)
175 /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
176 #undef _POSIX_SOURCE
177 #include <sys/time.h>
178 #define _POSIX_SOURCE
179 #else
180 #include <sys/time.h>
181 #endif
182 
183 #endif /* SYSV */
184 
185 /* use POSIX name for signal */
186 #if defined(AU_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
187 #define SIGCHLD SIGCLD
188 #endif
189 
190 #ifdef ISC
191 #include <sys/bsdtypes.h>
192 #endif
193 
194 #endif /* _AOS_H_ */
195