1 /*
2     TiMidity++ -- MIDI to WAVE converter and player
3     Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
4     Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 
20 */
21 
22 #ifndef ___NET_H_
23 #define ___NET_H_
24 
25 #if defined(WINSOCK)
26 #include <winsock2.h>
27 #include <ws2tcpip.h>
28 #else
29 typedef int SOCKET;
30 #define closesocket(fd) close(fd)
31 #define WSADATA int
32 #define MAKEWORD(a,b)
33 #define WSAStartup(a,b)
34 #define WSACleanup()
35 #endif
36 
37 extern SOCKET open_socket(char *host, unsigned short port);
38 extern int socket_shutdown(SOCKET fd, int how);
39 extern long socket_write(SOCKET fd, char *buff, long bufsiz);
40 
41 extern FILE *socket_fdopen(SOCKET fd, char *mode);
42 extern char *socket_fgets(char *buff, int n, FILE *fp);
43 extern int socket_fgetc(FILE *fp);
44 extern long socket_fread(void *buff, long bufsiz, FILE *fp);
45 extern long socket_fwrite(void *buff, long bufsiz, FILE *fp);
46 extern int socket_fflush(FILE *fp);
47 extern int socket_fclose(FILE *fp);
48 
49 #endif /* ___NET_H_ */
50