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