Go to the documentation of this file.
34 #if defined(_MSC_VER) && _MSC_VER < 1600
46 # define UV__ERR(x) (-(x))
48 # define UV__ERR(x) (x)
51 #if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900
52 extern int snprintf(
char*,
size_t,
const char*, ...);
55 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
57 #define container_of(ptr, type, member) \
58 ((type *) ((char *) (ptr) - offsetof(type, member)))
60 #define STATIC_ASSERT(expr) \
61 void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
132 const struct sockaddr*
addr,
133 unsigned int addrlen,
138 const struct sockaddr*
addr,
139 unsigned int addrlen,
143 const struct sockaddr*
addr,
144 unsigned int addrlen,
148 const struct sockaddr*
addr,
149 unsigned int addrlen);
159 const struct sockaddr*
addr,
160 unsigned int addrlen,
166 const struct sockaddr*
addr,
167 unsigned int addrlen);
204 #define uv__has_active_reqs(loop) \
205 ((loop)->active_reqs.count > 0)
207 #define uv__req_register(loop, req) \
209 (loop)->active_reqs.count++; \
213 #define uv__req_unregister(loop, req) \
215 assert(uv__has_active_reqs(loop)); \
216 (loop)->active_reqs.count--; \
220 #define uv__has_active_handles(loop) \
221 ((loop)->active_handles > 0)
223 #define uv__active_handle_add(h) \
225 (h)->loop->active_handles++; \
229 #define uv__active_handle_rm(h) \
231 (h)->loop->active_handles--; \
235 #define uv__is_active(h) \
236 (((h)->flags & UV_HANDLE_ACTIVE) != 0)
238 #define uv__is_closing(h) \
239 (((h)->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED)) != 0)
241 #define uv__handle_start(h) \
243 if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \
244 (h)->flags |= UV_HANDLE_ACTIVE; \
245 if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \
249 #define uv__handle_stop(h) \
251 if (((h)->flags & UV_HANDLE_ACTIVE) == 0) break; \
252 (h)->flags &= ~UV_HANDLE_ACTIVE; \
253 if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_rm(h); \
257 #define uv__handle_ref(h) \
259 if (((h)->flags & UV_HANDLE_REF) != 0) break; \
260 (h)->flags |= UV_HANDLE_REF; \
261 if (((h)->flags & UV_HANDLE_CLOSING) != 0) break; \
262 if (((h)->flags & UV_HANDLE_ACTIVE) != 0) uv__active_handle_add(h); \
266 #define uv__handle_unref(h) \
268 if (((h)->flags & UV_HANDLE_REF) == 0) break; \
269 (h)->flags &= ~UV_HANDLE_REF; \
270 if (((h)->flags & UV_HANDLE_CLOSING) != 0) break; \
271 if (((h)->flags & UV_HANDLE_ACTIVE) != 0) uv__active_handle_rm(h); \
275 #define uv__has_ref(h) \
276 (((h)->flags & UV_HANDLE_REF) != 0)
279 # define uv__handle_platform_init(h) ((h)->u.fd = -1)
281 # define uv__handle_platform_init(h) ((h)->next_closing = NULL)
284 #define uv__handle_init(loop_, h, type_) \
286 (h)->loop = (loop_); \
287 (h)->type = (type_); \
288 (h)->flags = UV_HANDLE_REF; \
289 QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue); \
290 uv__handle_platform_init(h); \
298 # define UV_REQ_INIT(req, typ) \
300 (req)->type = (typ); \
301 (req)->u.io.overlapped.Internal = 0; \
305 # define UV_REQ_INIT(req, typ) \
307 (req)->type = (typ); \
312 #define uv__req_init(loop, req, typ) \
314 UV_REQ_INIT(req, typ); \
315 uv__req_register(loop, req); \
@ UV_HANDLE_TCP_KEEPALIVE
void uv__timer_close(uv_timer_t *handle)
@ UV_HANDLE_NON_OVERLAPPED_PIPE
int uv__socket_sockopt(uv_handle_t *handle, int optname, int *value)
@ UV_HANDLE_TCP_SOCKET_CLOSED
@ UV_HANDLE_TCP_ACCEPT_STATE_CHANGING
void uv__fs_poll_close(uv_fs_poll_t *handle)
int uv__udp_connect(uv_udp_t *handle, const struct sockaddr *addr, unsigned int addrlen)
@ UV_HANDLE_TCP_SINGLE_ACCEPT
@ UV_HANDLE_UDP_CONNECTED
int uv__udp_recv_stop(uv_udp_t *handle)
@ UV_HANDLE_ENDGAME_QUEUED
@ UV_SIGNAL_ONE_SHOT_DISPATCHED
struct dirent uv__dirent_t
static void send_cb(uv_udp_send_t *req, int status)
void uv__work_submit(uv_loop_t *loop, struct uv__work *w, enum uv__work_kind kind, void(*work)(struct uv__work *w), void(*done)(struct uv__work *w, int status))
@ UV_HANDLE_BLOCKING_WRITES
int uv__udp_recv_start(uv_udp_t *handle, uv_alloc_cb alloccb, uv_udp_recv_cb recv_cb)
int uv__udp_try_send(uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr, unsigned int addrlen)
void(* uv_alloc_cb)(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
@ UV_HANDLE_CANCELLATION_PENDING
void * uv__malloc(size_t size)
int uv__udp_send(uv_udp_send_t *req, uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr, unsigned int addrlen, uv_udp_send_cb send_cb)
@ UV_HANDLE_UDP_PROCESSING
int uv__tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, unsigned int addrlen, uv_connect_cb cb)
void uv__work_done(uv_async_t *handle)
int uv__next_timeout(const uv_loop_t *loop)
void uv__run_timers(uv_loop_t *loop)
char * uv__strdup(const char *s)
@ UV_HANDLE_TTY_SAVED_ATTRIBUTES
void(* uv_udp_send_cb)(uv_udp_send_t *req, int status)
void * uv__reallocf(void *ptr, size_t size)
static void recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags)
void(* uv_udp_recv_cb)(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags)
void * uv__calloc(size_t count, size_t size)
void(* uv_connect_cb)(uv_connect_t *req, int status)
uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t *dent)
@ UV_HANDLE_SYNC_BYPASS_IOCP
int uv__tcp_bind(uv_tcp_t *tcp, const struct sockaddr *addr, unsigned int addrlen, unsigned int flags)
void uv__fs_scandir_cleanup(uv_fs_t *req)
char * uv__strndup(const char *s, size_t n)
int uv__getaddrinfo_translate_error(int sys_err)
size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs)
int uv__loop_configure(uv_loop_t *loop, uv_loop_option option, va_list ap)
@ UV_HANDLE_TTY_SAVED_POSITION
@ UV_HANDLE_SHARED_TCP_SOCKET
int uv__udp_is_connected(uv_udp_t *handle)
void uv__loop_close(uv_loop_t *loop)
int uv__udp_bind(uv_udp_t *handle, const struct sockaddr *addr, unsigned int addrlen, unsigned int flags)
void uv__fs_readdir_cleanup(uv_fs_t *req)
OPENSSL_EXPORT pem_password_cb * cb
void * uv__realloc(void *ptr, size_t size)
int uv__udp_disconnect(uv_udp_t *handle)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:49