Added upstream from http://ftp.icm.edu.pl/pub/loglan/
[loglan.git] / sources / new-s5r4 / sock.h
1      /* Loglan82 Compiler&Interpreter
2      Copyright (C) 1981-1993 Institute of Informatics, University of Warsaw
3      Copyright (C)  1993, 1994 LITA, Pau
4      
5      This program is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published by
7      the Free Software Foundation; either version 2 of the License, or
8      (at your option) any later version.
9      
10      This program is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13      GNU General Public License for more details.
14      
15              You should have received a copy of the GNU General Public License
16              along with this program; if not, write to the Free Software
17              Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19  contacts:  Andrzej.Salwicki@univ-pau.fr
20
21 or             Andrzej Salwicki
22                 LITA   Departement d'Informatique
23                 Universite de Pau
24                 Avenue de l'Universite
25                 64000 Pau   FRANCE
26                  tel.  ++33 59923154    fax. ++33 59841696
27
28 =======================================================================
29 */
30
31 #ifndef __SOCK_H__
32 #define __SOCK_H__
33
34 #include <stdio.h>
35 #include <string.h>
36
37 #ifndef NO_PROTOTYPES
38 #include <stdlib.h>
39 #endif
40
41 #include <sys/types.h>
42 #include <signal.h>
43 #include <sys/socket.h>
44 #include <sys/time.h>
45 #include <netinet/in.h>
46 #include <netdb.h>
47 #include <errno.h>
48
49
50 #ifndef NO_PROTOTYPES
51 int host_addr( char * /* host name */, struct sockaddr_in * );
52 int  sock_open( int socket_type, char *protocol, char *service, int port );
53 int  sock_recv( int sock, void *buf, int size, struct sockaddr_in *addr );
54 int  sock_send( int sock, void *buf, int size, struct sockaddr_in *addr );
55 void set_send_delay  ( int miliseconds );
56 int  sock_poll( int sock, int miliseconds );
57                    /* sock == -1       -> equivalent of sleep */
58                    /* miliseconds < 0  -> waits indefinitely  */
59 #else
60 int  host_addr();
61 int  sock_open();
62 int  sock_srv_recv();
63 int  sock_srv_send();
64 void set_send_delay();
65 int  sock_poll();
66 #endif
67
68
69 #ifndef NO_PROTOTYPES
70 int  sock_crc_recv( int sock, void *m, int size, struct sockaddr *addr );
71 int  sock_crc_send( int sock, void *m, int size, struct sockaddr *addr );
72 #else
73 int  sock_srv_crc_recv();
74 int  sock_srv_crc_send();
75 #endif
76
77 #endif
78
79
80
81