-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvicesocket.h
56 lines (44 loc) · 2.08 KB
/
vicesocket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*! \file socket.h \n
* \author Spiro Trikaliotis\n
* \brief Abstraction from network sockets.
*
* socket.h - Abstraction from network sockets.
*
* Written by
* Spiro Trikaliotis <spiro.trikaliotis@gmx.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#ifndef VICE_SOCKET_H
#define VICE_SOCKET_H
#include "types.h"
typedef struct vice_network_socket_s vice_network_socket_t;
typedef struct vice_network_socket_address_s vice_network_socket_address_t;
vice_network_socket_t * vice_network_server(const vice_network_socket_address_t * server_address);
vice_network_socket_t * vice_network_client(const vice_network_socket_address_t * server_address);
vice_network_socket_address_t * vice_network_address_generate(const char * address, unsigned short port);
void vice_network_address_close(vice_network_socket_address_t *);
vice_network_socket_t * vice_network_accept(vice_network_socket_t * sockfd);
int vice_network_socket_close(vice_network_socket_t * sockfd);
int vice_network_send(vice_network_socket_t * sockfd, const void * buffer, size_t buffer_length, int flags);
int vice_network_receive(vice_network_socket_t * sockfd, void * buffer, size_t buffer_length, int flags);
int vice_network_select_poll_one(vice_network_socket_t * readsockfd);
int vice_network_get_errorcode(void);
#endif /* VICE_SOCKET_H */