1 /********************************************************************/
2 /*                                                                  */
3 /*  soc_none.c    Dummy functions for the socket type.              */
4 /*  Copyright (C) 1989 - 2018  Thomas Mertes                        */
5 /*                                                                  */
6 /*  This file is part of the Seed7 Runtime Library.                 */
7 /*                                                                  */
8 /*  The Seed7 Runtime Library is free software; you can             */
9 /*  redistribute it and/or modify it under the terms of the GNU     */
10 /*  Lesser General Public License as published by the Free Software */
11 /*  Foundation; either version 2.1 of the License, or (at your      */
12 /*  option) any later version.                                      */
13 /*                                                                  */
14 /*  The Seed7 Runtime Library is distributed in the hope that it    */
15 /*  will be useful, but WITHOUT ANY WARRANTY; without even the      */
16 /*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
17 /*  PURPOSE.  See the GNU Lesser General Public License for more    */
18 /*  details.                                                        */
19 /*                                                                  */
20 /*  You should have received a copy of the GNU Lesser General       */
21 /*  Public License along with this program; if not, write to the    */
22 /*  Free Software Foundation, Inc., 51 Franklin Street,             */
23 /*  Fifth Floor, Boston, MA  02110-1301, USA.                       */
24 /*                                                                  */
25 /*  Module: Seed7 Runtime Library                                   */
26 /*  File: seed7/src/soc_none.c                                      */
27 /*  Changes: 2011, 2018  Thomas Mertes                              */
28 /*  Content: Dummy functions for the socket type.                   */
29 /*                                                                  */
30 /********************************************************************/
31 
32 #include "version.h"
33 
34 #if SOCKET_LIB == NO_SOCKETS
35 #include "stdio.h"
36 
37 #include "common.h"
38 #include "data_rtl.h"
39 #include "rtl_err.h"
40 
41 #undef EXTERN
42 #define EXTERN
43 #include "soc_rtl.h"
44 
45 
46 
socAccept(socketType listenerSocket,bstriType * address)47 socketType socAccept (socketType listenerSocket, bstriType *address)
48 
49   { /* socAccept */
50     raise_error(FILE_ERROR);
51     return 0;
52   } /* socAccept */
53 
54 
55 
socAddrFamily(const const_bstriType address)56 intType socAddrFamily (const const_bstriType address)
57 
58   { /* socAddrFamily */
59     raise_error(FILE_ERROR);
60     return 0;
61   } /* socAddrFamily */
62 
63 
64 
socAddrNumeric(const const_bstriType address)65 striType socAddrNumeric (const const_bstriType address)
66 
67   { /* socAddrNumeric */
68     raise_error(FILE_ERROR);
69     return NULL;
70   } /* socAddrNumeric */
71 
72 
73 
socAddrService(const const_bstriType address)74 striType socAddrService (const const_bstriType address)
75 
76   { /* socAddrService */
77     raise_error(FILE_ERROR);
78     return NULL;
79   } /* socAddrService */
80 
81 
82 
socBind(socketType listenerSocket,const_bstriType address)83 void socBind (socketType listenerSocket, const_bstriType address)
84 
85   { /* socBind */
86     raise_error(FILE_ERROR);
87   } /* socBind */
88 
89 
90 
socClose(socketType aSocket)91 void socClose (socketType aSocket)
92 
93   { /* socClose */
94     raise_error(FILE_ERROR);
95   } /* socClose */
96 
97 
98 
socConnect(socketType aSocket,const_bstriType address)99 void socConnect (socketType aSocket, const_bstriType address)
100 
101   { /* socConnect */
102     raise_error(FILE_ERROR);
103   } /* socConnect */
104 
105 
106 
socGetc(socketType inSocket,charType * const eofIndicator)107 charType socGetc (socketType inSocket, charType *const eofIndicator)
108 
109   { /* socGetc */
110     raise_error(FILE_ERROR);
111     return (charType) EOF;
112   } /* socGetc */
113 
114 
115 
socGets(socketType inSocket,intType length,charType * const eofIndicator)116 striType socGets (socketType inSocket, intType length, charType *const eofIndicator)
117 
118   { /* socGets */
119     raise_error(FILE_ERROR);
120     return NULL;
121   } /* socGets */
122 
123 
124 
socGetHostname(void)125 striType socGetHostname (void)
126 
127   { /* socGetHostname */
128     raise_error(FILE_ERROR);
129     return NULL;
130   } /* socGetHostname */
131 
132 
133 
socGetLocalAddr(socketType sock)134 bstriType socGetLocalAddr (socketType sock)
135 
136   { /* socGetLocalAddr */
137     raise_error(FILE_ERROR);
138     return NULL;
139   } /* socGetLocalAddr */
140 
141 
142 
socGetPeerAddr(socketType sock)143 bstriType socGetPeerAddr (socketType sock)
144 
145   { /* socGetPeerAddr */
146     raise_error(FILE_ERROR);
147     return NULL;
148   } /* socGetPeerAddr */
149 
150 
151 
socHasNext(socketType inSocket)152 boolType socHasNext (socketType inSocket)
153 
154   { /* socHasNext */
155     raise_error(FILE_ERROR);
156     return TRUE;
157   } /* socHasNext */
158 
159 
160 
socInetAddr(const const_striType host_name,intType port)161 bstriType socInetAddr (const const_striType host_name, intType port)
162 
163   { /* socInetAddr */
164     raise_error(FILE_ERROR);
165     return NULL;
166   } /* socInetAddr */
167 
168 
169 
socInetLocalAddr(intType port)170 bstriType socInetLocalAddr (intType port)
171 
172   { /* socInetLocalAddr */
173     raise_error(FILE_ERROR);
174     return NULL;
175   } /* socInetLocalAddr */
176 
177 
178 
socInetServAddr(intType port)179 bstriType socInetServAddr (intType port)
180 
181   { /* socInetServAddr */
182     raise_error(FILE_ERROR);
183     return NULL;
184   } /* socInetServAddr */
185 
186 
187 
socInputReady(socketType sock,intType seconds,intType micro_seconds)188 boolType socInputReady (socketType sock, intType seconds, intType micro_seconds)
189 
190   { /* socInputReady */
191     raise_error(FILE_ERROR);
192     return FALSE;
193   } /* socInputReady */
194 
195 
196 
socLineRead(socketType inSocket,charType * const terminationChar)197 striType socLineRead (socketType inSocket, charType *const terminationChar)
198 
199   { /* socLineRead */
200     raise_error(FILE_ERROR);
201     return NULL;
202   } /* socLineRead */
203 
204 
205 
socListen(socketType listenerSocket,intType backlog)206 void socListen (socketType listenerSocket, intType backlog)
207 
208   { /* socListen */
209     raise_error(FILE_ERROR);
210   } /* socListen */
211 
212 
213 
socRecv(socketType sock,striType * stri,intType length,intType flags)214 intType socRecv (socketType sock, striType *stri, intType length, intType flags)
215 
216   { /* socRecv */
217     raise_error(FILE_ERROR);
218     return 0;
219   } /* socRecv */
220 
221 
222 
socRecvfrom(socketType sock,striType * stri,intType length,intType flags,bstriType * address)223 intType socRecvfrom (socketType sock, striType *stri, intType length, intType flags,
224     bstriType *address)
225 
226   { /* socRecvfrom */
227     raise_error(FILE_ERROR);
228     return 0;
229   } /* socRecvfrom */
230 
231 
232 
socSend(socketType sock,const const_striType stri,intType flags)233 intType socSend (socketType sock, const const_striType stri, intType flags)
234 
235   { /* socSend */
236     raise_error(FILE_ERROR);
237     return 0;
238   } /* socSend */
239 
240 
241 
socSendto(socketType sock,const const_striType stri,intType flags,const_bstriType address)242 intType socSendto (socketType sock, const const_striType stri, intType flags,
243     const_bstriType address)
244 
245   { /* socSendto */
246     raise_error(FILE_ERROR);
247     return 0;
248   } /* socSendto */
249 
250 
251 
socSetOptBool(socketType sock,intType optname,boolType optval)252 void socSetOptBool (socketType sock, intType optname, boolType optval)
253 
254   { /* socSetOptBool */
255     raise_error(FILE_ERROR);
256   } /* socSetOptBool */
257 
258 
259 
socSocket(intType domain,intType type,intType protocol)260 socketType socSocket (intType domain, intType type, intType protocol)
261 
262   { /* socSocket */
263     raise_error(FILE_ERROR);
264     return 0;
265   } /* socSocket */
266 
267 
268 
socWordRead(socketType inSocket,charType * const terminationChar)269 striType socWordRead (socketType inSocket, charType *const terminationChar)
270 
271   { /* socWordRead */
272     raise_error(FILE_ERROR);
273     return NULL;
274   } /* socWordRead */
275 
276 
277 
socWrite(socketType outSocket,const const_striType stri)278 void socWrite (socketType outSocket, const const_striType stri)
279 
280   { /* socWrite */
281     raise_error(FILE_ERROR);
282   } /* socWrite */
283 
284 #endif
285