RetroArch
net_socket.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (net_socket.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef _LIBRETRO_SDK_NET_SOCKET_H
24 #define _LIBRETRO_SDK_NET_SOCKET_H
25 
26 #include <stdint.h>
27 #include <boolean.h>
28 #include <string.h>
29 
30 #include <retro_common_api.h>
31 
33 
35 {
37 };
38 
40 {
44 };
45 
47 {
51 };
52 
53 typedef struct socket_target
54 {
55  unsigned port;
56  const char *server;
60 
61 int socket_init(void **address, uint16_t port, const char *server, enum socket_type type);
62 
63 int socket_next(void **address);
64 
65 int socket_close(int fd);
66 
67 bool socket_nonblock(int fd);
68 
69 int socket_select(int nfds, fd_set *readfs, fd_set *writefds,
70  fd_set *errorfds, struct timeval *timeout);
71 
72 int socket_send_all_blocking(int fd, const void *data_, size_t size, bool no_signal);
73 
74 ssize_t socket_send_all_nonblocking(int fd, const void *data_, size_t size,
75  bool no_signal);
76 
77 int socket_receive_all_blocking(int fd, void *data_, size_t size);
78 
79 ssize_t socket_receive_all_nonblocking(int fd, bool *error,
80  void *data_, size_t size);
81 
82 bool socket_bind(int fd, void *data);
83 
84 int socket_connect(int fd, void *data, bool timeout_enable);
85 
86 int socket_create(
87  const char *name,
88  enum socket_domain domain_type,
90  enum socket_protocol protocol_type);
91 
93 
95 
96 #endif
Definition: net_socket.h:48
bool socket_nonblock(int fd)
Definition: net_socket.c:120
GLuint const GLchar * name
Definition: glext.h:6671
GLbitfield GLuint64 timeout
Definition: glext.h:7831
Definition: net_socket.h:53
Definition: sockets.h:204
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
GLuint address
Definition: glext.h:10300
GLsizeiptr size
Definition: glext.h:6559
Definition: net_socket.h:41
includes all by default used to find thumbnails Please choose a single playlist first Add Entry Add Folder Select Files< multiple > Please fill out all required fields RetroArch updated successfully Please restart the application for the changes to take effect Contributors Move Down Load Remove Add Pass No shader passes Reset All Passes Download thumbnail Start on Download All Thumbnails This Playlist Configured in port
Definition: msg_hash_us.h:7699
bool socket_bind(int fd, void *data)
Definition: net_socket.c:224
Definition: ip_addr.h:64
Definition: ibxm.h:9
int socket_receive_all_blocking(int fd, void *data_, size_t size)
Definition: net_socket.c:103
void socket_set_target(void *data, socket_target_t *in_addr)
Definition: net_socket.c:339
unsigned port
Definition: net_socket.h:55
GLenum type
Definition: glext.h:6233
socket_type
Definition: net_socket.h:39
int socket_init(void **address, uint16_t port, const char *server, enum socket_type type)
Definition: net_socket.c:27
int socket_send_all_blocking(int fd, const void *data_, size_t size, bool no_signal)
Definition: net_socket.c:172
ssize_t socket_receive_all_nonblocking(int fd, bool *error, void *data_, size_t size)
Definition: net_socket.c:80
Definition: net_socket.h:43
Definition: sockets.h:217
static l_noret error(LoadState *S, const char *why)
Definition: lundump.c:39
int socket_create(const char *name, enum socket_domain domain_type, enum socket_type socket_type, enum socket_protocol protocol_type)
Definition: net_socket.c:270
Definition: net_socket.h:42
int socket_select(int nfds, fd_set *readfs, fd_set *writefds, fd_set *errorfds, struct timeval *timeout)
Definition: net_socket.c:148
socket_protocol
Definition: net_socket.h:46
int socket_close(int fd)
Definition: net_socket.c:134
int socket_next(void **address)
Definition: net_socket.c:71
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
ssize_t socket_send_all_nonblocking(int fd, const void *data_, size_t size, bool no_signal)
Definition: net_socket.c:196
int socket_connect(int fd, void *data, bool timeout_enable)
Definition: net_socket.c:235
Definition: net_socket.h:49
enum socket_protocol prot
Definition: net_socket.h:58
socket_domain
Definition: net_socket.h:34
struct socket_target socket_target_t
static char server[64]
Definition: net_retropad_core.c:73
const char * server
Definition: net_socket.h:56
Definition: net_socket.h:36
unsigned short uint16_t
Definition: stdint.h:125
Definition: net_socket.h:50
enum socket_domain domain
Definition: net_socket.h:57