ad37d02f8b97a84f042a0c752f52985aec9511d0
[ghc-hetmet.git] / ghc / lib / misc / cbits / ghcSockets.h
1 #ifndef GHC_SOCKETS_H
2 #define GHC_SOCKETS_H
3
4 #include <ctype.h>
5 #include <netdb.h>
6 #include <netinet/in.h>
7 #include <arpa/inet.h>
8 #include <stdio.h>
9
10 #ifdef HAVE_STDLIB_H
11 # include <stdlib.h>
12 #endif
13 #ifdef HAVE_STRING_H
14 # include <string.h>
15 #endif
16 #ifdef HAVE_FCNTL_H
17 # include <fcntl.h>
18 #endif
19 #ifdef HAVE_SYS_SOCKET_H
20 # include <sys/socket.h>
21 #endif
22 #ifdef HAVE_NETINET_TCP_H
23 # include <netinet/tcp.h>
24 #endif
25 #if TIME_WITH_SYS_TIME
26 # include <sys/time.h>
27 # include <time.h>
28 #else
29 # if HAVE_SYS_TIME_H
30 #  include <sys/time.h>
31 # else
32 #  include <time.h>
33 # endif
34 #endif
35 #ifdef HAVE_SYS_TYPES_H
36 # include <sys/types.h>
37 #endif
38 #include <sys/uio.h>
39
40 /* ToDo: featurise this */
41 #ifndef cygwin32_TARGET_OS
42 #include <sys/un.h>
43 #endif
44
45 #ifdef HAVE_UNISTD_H
46 # include <unistd.h>
47 #endif
48
49 /* acceptSocket.lc */
50 StgInt  acceptSocket PROTO((StgInt, StgAddr, StgAddr));
51
52 /* bindSocket.lc */
53 StgInt  bindSocket PROTO((StgInt, StgAddr, StgInt, StgInt));
54
55 /* connectSocket.lc */
56 StgInt  connectSocket PROTO((StgInt, StgAddr, StgInt, StgInt));
57
58 /* createSocket.lc */
59 StgInt  createSocket PROTO((StgInt, StgInt, StgInt));
60
61 /* getSockName.lc */
62 StgInt  getSockName PROTO((StgInt, StgAddr, StgAddr));
63
64 /* getPeerName.lc */
65 StgInt  getPeerName PROTO((StgInt, StgAddr, StgAddr));
66
67 /* listenSocket.lc */
68 StgInt  listenSocket PROTO((StgInt, StgInt));
69
70 /* shutdownSocket.lc */
71 StgInt  shutdownSocket PROTO((StgInt, StgInt));
72
73 /* readDescriptor.lc */
74 StgInt  readDescriptor PROTO((StgInt, StgAddr, StgInt));
75
76 /* recvFrom.c */
77 StgInt  recvFrom__ PROTO((StgInt, StgAddr, StgInt, StgAddr));
78
79 /* sendTo.c */
80 StgInt  sendTo__ PROTO((StgInt, StgAddr, StgInt, StgAddr, StgInt));
81
82 /* socketOpt.c */
83 StgInt  getSocketOption__ PROTO((StgInt, StgInt));
84 StgInt  setSocketOption__ PROTO((StgInt, StgInt, StgInt));
85
86 /* writeDescriptor.lc */
87 StgInt  writeDescriptor PROTO((StgInt, StgAddr, StgInt));
88
89
90 #endif /* !GHC_SOCKETS_H */