Edinburgh Speech Tools 2.4-release
EST_socket_unix.h
1
2 /************************************************************************/
3 /* */
4 /* Centre for Speech Technology Research */
5 /* University of Edinburgh, UK */
6 /* Copyright (c) 1996,1997 */
7 /* All Rights Reserved. */
8 /* */
9 /* Permission is hereby granted, free of charge, to use and distribute */
10 /* this software and its documentation without restriction, including */
11 /* without limitation the rights to use, copy, modify, merge, publish, */
12 /* distribute, sublicense, and/or sell copies of this work, and to */
13 /* permit persons to whom this work is furnished to do so, subject to */
14 /* the following conditions: */
15 /* 1. The code must retain the above copyright notice, this list of */
16 /* conditions and the following disclaimer. */
17 /* 2. Any modifications must be clearly marked as such. */
18 /* 3. Original authors' names are not deleted. */
19 /* 4. The authors' names are not used to endorse or promote products */
20 /* derived from this software without specific prior written */
21 /* permission. */
22 /* */
23 /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
24 /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
25 /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
26 /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
27 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
28 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
29 /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
30 /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
31 /* THIS SOFTWARE. */
32 /* */
33 /*************************************************************************/
34 /* */
35 /* Author: Richard Caley (rjc@cstr.ed.ac.uk) */
36 /* Date: Tue Sep4th 1997 */
37 /* -------------------------------------------------------------------- */
38 /* Defines of things which may not be here on all unixes. */
39 /* */
40 /*************************************************************************/
41
42#if !defined(__EST_SOCKET_UNIX_H__)
43#define __EST_SOCKET_UNIX_H__ 1
44
45#include <errno.h>
46
47/* Solaris defines this, linux doesn't */
48#if defined(sun) && !defined(SVR4)
49typedef int ssize_t;
50#endif
51
52#if defined(older_solaris)
53/* older versions of Solaris don't have this */
54typedef int socklen_t;
55#endif
56
57#if defined(__FreeBSD__) && __FreeBSD__ < 4
58typedef int socklen_t;
59#endif
60
61#if defined(__APPLE__)
62#endif
63
64#if defined(__CYGWIN__) && __GNUC__ < 3
65typedef int socklen_t;
66#endif
67
68#if defined(__osf__)
69typedef int socklen_t;
70#endif
71
72#if defined(_AIX)
73#include <sys/select.h>
74#endif
75
76#define NOT_A_SOCKET(FD) ((FD) <0)
77#define socket_error() errno
78
79#if defined(__cplusplus)
80extern "C" {
81#endif
82
83int socket_initialise(void);
84
85#if defined(__cplusplus)
86}
87#endif
88
89#endif
90