-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy paths_uv.h
50 lines (41 loc) · 1.25 KB
/
s_uv.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
/* Copyright xhawk, MIT license */
#ifndef INC_S_UV_H_
#define INC_S_UV_H_
#include "s_task.h"
#ifdef USE_LIBUV
#include "uv.h"
#ifdef __cplusplus
extern "C" {
#endif
int s_uv_close(__async__, uv_handle_t* handle);
int s_uv_read(__async__, uv_stream_t* handle, void* buf, size_t buf_len, ssize_t* nread);
int s_uv_write_n(__async__, uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs);
int s_uv_write(__async__, uv_stream_t* handle, const void* buf, size_t buf_len);
int uv_udp_recv(__async__,
uv_udp_t* handle,
void* buf, size_t buf_len,
ssize_t* nrecv,
struct sockaddr* addr,
unsigned int* flags);
int s_uv_udp_send_n(__async__,
uv_udp_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs,
const struct sockaddr* addr);
int s_uv_udp_send(__async__,
uv_udp_t* handle,
const void* buf,
size_t buf_len,
const struct sockaddr* addr);
/* use uv_freeaddrinfo() to free the return value; */
struct addrinfo* s_uv_getaddrinfo(__async__,
uv_loop_t* loop,
const char* node,
const char* service,
const struct addrinfo* hints);
int s_uv_tcp_connect(__async__, uv_tcp_t* handle, const struct sockaddr* addr);
#ifdef __cplusplus
}
#endif
#endif
#endif