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