Warning, file /include/node/uv.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef UV_H
0025 #define UV_H
0026 #ifdef __cplusplus
0027 extern "C" {
0028 #endif
0029
0030 #if defined(BUILDING_UV_SHARED) && defined(USING_UV_SHARED)
0031 #error "Define either BUILDING_UV_SHARED or USING_UV_SHARED, not both."
0032 #endif
0033
0034 #ifndef UV_EXTERN
0035 #ifdef _WIN32
0036
0037 # if defined(BUILDING_UV_SHARED)
0038
0039 # define UV_EXTERN __declspec(dllexport)
0040 # elif defined(USING_UV_SHARED)
0041
0042 # define UV_EXTERN __declspec(dllimport)
0043 # else
0044
0045 # define UV_EXTERN
0046 # endif
0047 #elif __GNUC__ >= 4
0048 # define UV_EXTERN __attribute__((visibility("default")))
0049 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
0050 # define UV_EXTERN __global
0051 #else
0052 # define UV_EXTERN
0053 #endif
0054 #endif
0055
0056 #include "uv/errno.h"
0057 #include "uv/version.h"
0058 #include <stddef.h>
0059 #include <stdio.h>
0060 #include <stdint.h>
0061
0062
0063 struct uv__queue {
0064 struct uv__queue* next;
0065 struct uv__queue* prev;
0066 };
0067
0068 #if defined(_WIN32)
0069 # include "uv/win.h"
0070 #else
0071 # include "uv/unix.h"
0072 #endif
0073
0074
0075 #define UV_ERRNO_MAP(XX) \
0076 XX(E2BIG, "argument list too long") \
0077 XX(EACCES, "permission denied") \
0078 XX(EADDRINUSE, "address already in use") \
0079 XX(EADDRNOTAVAIL, "address not available") \
0080 XX(EAFNOSUPPORT, "address family not supported") \
0081 XX(EAGAIN, "resource temporarily unavailable") \
0082 XX(EAI_ADDRFAMILY, "address family not supported") \
0083 XX(EAI_AGAIN, "temporary failure") \
0084 XX(EAI_BADFLAGS, "bad ai_flags value") \
0085 XX(EAI_BADHINTS, "invalid value for hints") \
0086 XX(EAI_CANCELED, "request canceled") \
0087 XX(EAI_FAIL, "permanent failure") \
0088 XX(EAI_FAMILY, "ai_family not supported") \
0089 XX(EAI_MEMORY, "out of memory") \
0090 XX(EAI_NODATA, "no address") \
0091 XX(EAI_NONAME, "unknown node or service") \
0092 XX(EAI_OVERFLOW, "argument buffer overflow") \
0093 XX(EAI_PROTOCOL, "resolved protocol is unknown") \
0094 XX(EAI_SERVICE, "service not available for socket type") \
0095 XX(EAI_SOCKTYPE, "socket type not supported") \
0096 XX(EALREADY, "connection already in progress") \
0097 XX(EBADF, "bad file descriptor") \
0098 XX(EBUSY, "resource busy or locked") \
0099 XX(ECANCELED, "operation canceled") \
0100 XX(ECHARSET, "invalid Unicode character") \
0101 XX(ECONNABORTED, "software caused connection abort") \
0102 XX(ECONNREFUSED, "connection refused") \
0103 XX(ECONNRESET, "connection reset by peer") \
0104 XX(EDESTADDRREQ, "destination address required") \
0105 XX(EEXIST, "file already exists") \
0106 XX(EFAULT, "bad address in system call argument") \
0107 XX(EFBIG, "file too large") \
0108 XX(EHOSTUNREACH, "host is unreachable") \
0109 XX(EINTR, "interrupted system call") \
0110 XX(EINVAL, "invalid argument") \
0111 XX(EIO, "i/o error") \
0112 XX(EISCONN, "socket is already connected") \
0113 XX(EISDIR, "illegal operation on a directory") \
0114 XX(ELOOP, "too many symbolic links encountered") \
0115 XX(EMFILE, "too many open files") \
0116 XX(EMSGSIZE, "message too long") \
0117 XX(ENAMETOOLONG, "name too long") \
0118 XX(ENETDOWN, "network is down") \
0119 XX(ENETUNREACH, "network is unreachable") \
0120 XX(ENFILE, "file table overflow") \
0121 XX(ENOBUFS, "no buffer space available") \
0122 XX(ENODEV, "no such device") \
0123 XX(ENOENT, "no such file or directory") \
0124 XX(ENOMEM, "not enough memory") \
0125 XX(ENONET, "machine is not on the network") \
0126 XX(ENOPROTOOPT, "protocol not available") \
0127 XX(ENOSPC, "no space left on device") \
0128 XX(ENOSYS, "function not implemented") \
0129 XX(ENOTCONN, "socket is not connected") \
0130 XX(ENOTDIR, "not a directory") \
0131 XX(ENOTEMPTY, "directory not empty") \
0132 XX(ENOTSOCK, "socket operation on non-socket") \
0133 XX(ENOTSUP, "operation not supported on socket") \
0134 XX(EOVERFLOW, "value too large for defined data type") \
0135 XX(EPERM, "operation not permitted") \
0136 XX(EPIPE, "broken pipe") \
0137 XX(EPROTO, "protocol error") \
0138 XX(EPROTONOSUPPORT, "protocol not supported") \
0139 XX(EPROTOTYPE, "protocol wrong type for socket") \
0140 XX(ERANGE, "result too large") \
0141 XX(EROFS, "read-only file system") \
0142 XX(ESHUTDOWN, "cannot send after transport endpoint shutdown") \
0143 XX(ESPIPE, "invalid seek") \
0144 XX(ESRCH, "no such process") \
0145 XX(ETIMEDOUT, "connection timed out") \
0146 XX(ETXTBSY, "text file is busy") \
0147 XX(EXDEV, "cross-device link not permitted") \
0148 XX(UNKNOWN, "unknown error") \
0149 XX(EOF, "end of file") \
0150 XX(ENXIO, "no such device or address") \
0151 XX(EMLINK, "too many links") \
0152 XX(EHOSTDOWN, "host is down") \
0153 XX(EREMOTEIO, "remote I/O error") \
0154 XX(ENOTTY, "inappropriate ioctl for device") \
0155 XX(EFTYPE, "inappropriate file type or format") \
0156 XX(EILSEQ, "illegal byte sequence") \
0157 XX(ESOCKTNOSUPPORT, "socket type not supported") \
0158 XX(ENODATA, "no data available") \
0159 XX(EUNATCH, "protocol driver not attached") \
0160
0161 #define UV_HANDLE_TYPE_MAP(XX) \
0162 XX(ASYNC, async) \
0163 XX(CHECK, check) \
0164 XX(FS_EVENT, fs_event) \
0165 XX(FS_POLL, fs_poll) \
0166 XX(HANDLE, handle) \
0167 XX(IDLE, idle) \
0168 XX(NAMED_PIPE, pipe) \
0169 XX(POLL, poll) \
0170 XX(PREPARE, prepare) \
0171 XX(PROCESS, process) \
0172 XX(STREAM, stream) \
0173 XX(TCP, tcp) \
0174 XX(TIMER, timer) \
0175 XX(TTY, tty) \
0176 XX(UDP, udp) \
0177 XX(SIGNAL, signal) \
0178
0179 #define UV_REQ_TYPE_MAP(XX) \
0180 XX(REQ, req) \
0181 XX(CONNECT, connect) \
0182 XX(WRITE, write) \
0183 XX(SHUTDOWN, shutdown) \
0184 XX(UDP_SEND, udp_send) \
0185 XX(FS, fs) \
0186 XX(WORK, work) \
0187 XX(GETADDRINFO, getaddrinfo) \
0188 XX(GETNAMEINFO, getnameinfo) \
0189 XX(RANDOM, random) \
0190
0191 typedef enum {
0192 #define XX(code, _) UV_ ## code = UV__ ## code,
0193 UV_ERRNO_MAP(XX)
0194 #undef XX
0195 UV_ERRNO_MAX = UV__EOF - 1
0196 } uv_errno_t;
0197
0198 typedef enum {
0199 UV_UNKNOWN_HANDLE = 0,
0200 #define XX(uc, lc) UV_##uc,
0201 UV_HANDLE_TYPE_MAP(XX)
0202 #undef XX
0203 UV_FILE,
0204 UV_HANDLE_TYPE_MAX
0205 } uv_handle_type;
0206
0207 typedef enum {
0208 UV_UNKNOWN_REQ = 0,
0209 #define XX(uc, lc) UV_##uc,
0210 UV_REQ_TYPE_MAP(XX)
0211 #undef XX
0212 UV_REQ_TYPE_PRIVATE
0213 UV_REQ_TYPE_MAX
0214 } uv_req_type;
0215
0216
0217
0218 typedef struct uv_loop_s uv_loop_t;
0219 typedef struct uv_handle_s uv_handle_t;
0220 typedef struct uv_dir_s uv_dir_t;
0221 typedef struct uv_stream_s uv_stream_t;
0222 typedef struct uv_tcp_s uv_tcp_t;
0223 typedef struct uv_udp_s uv_udp_t;
0224 typedef struct uv_pipe_s uv_pipe_t;
0225 typedef struct uv_tty_s uv_tty_t;
0226 typedef struct uv_poll_s uv_poll_t;
0227 typedef struct uv_timer_s uv_timer_t;
0228 typedef struct uv_prepare_s uv_prepare_t;
0229 typedef struct uv_check_s uv_check_t;
0230 typedef struct uv_idle_s uv_idle_t;
0231 typedef struct uv_async_s uv_async_t;
0232 typedef struct uv_process_s uv_process_t;
0233 typedef struct uv_fs_event_s uv_fs_event_t;
0234 typedef struct uv_fs_poll_s uv_fs_poll_t;
0235 typedef struct uv_signal_s uv_signal_t;
0236
0237
0238 typedef struct uv_req_s uv_req_t;
0239 typedef struct uv_getaddrinfo_s uv_getaddrinfo_t;
0240 typedef struct uv_getnameinfo_s uv_getnameinfo_t;
0241 typedef struct uv_shutdown_s uv_shutdown_t;
0242 typedef struct uv_write_s uv_write_t;
0243 typedef struct uv_connect_s uv_connect_t;
0244 typedef struct uv_udp_send_s uv_udp_send_t;
0245 typedef struct uv_fs_s uv_fs_t;
0246 typedef struct uv_work_s uv_work_t;
0247 typedef struct uv_random_s uv_random_t;
0248
0249
0250 typedef struct uv_env_item_s uv_env_item_t;
0251 typedef struct uv_cpu_info_s uv_cpu_info_t;
0252 typedef struct uv_interface_address_s uv_interface_address_t;
0253 typedef struct uv_dirent_s uv_dirent_t;
0254 typedef struct uv_passwd_s uv_passwd_t;
0255 typedef struct uv_group_s uv_group_t;
0256 typedef struct uv_utsname_s uv_utsname_t;
0257 typedef struct uv_statfs_s uv_statfs_t;
0258
0259 typedef struct uv_metrics_s uv_metrics_t;
0260
0261 typedef enum {
0262 UV_LOOP_BLOCK_SIGNAL = 0,
0263 UV_METRICS_IDLE_TIME,
0264 UV_LOOP_USE_IO_URING_SQPOLL
0265 #define UV_LOOP_USE_IO_URING_SQPOLL UV_LOOP_USE_IO_URING_SQPOLL
0266 } uv_loop_option;
0267
0268 typedef enum {
0269 UV_RUN_DEFAULT = 0,
0270 UV_RUN_ONCE,
0271 UV_RUN_NOWAIT
0272 } uv_run_mode;
0273
0274
0275 UV_EXTERN unsigned int uv_version(void);
0276 UV_EXTERN const char* uv_version_string(void);
0277
0278 typedef void* (*uv_malloc_func)(size_t size);
0279 typedef void* (*uv_realloc_func)(void* ptr, size_t size);
0280 typedef void* (*uv_calloc_func)(size_t count, size_t size);
0281 typedef void (*uv_free_func)(void* ptr);
0282
0283 UV_EXTERN void uv_library_shutdown(void);
0284
0285 UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func,
0286 uv_realloc_func realloc_func,
0287 uv_calloc_func calloc_func,
0288 uv_free_func free_func);
0289
0290 UV_EXTERN uv_loop_t* uv_default_loop(void);
0291 UV_EXTERN int uv_loop_init(uv_loop_t* loop);
0292 UV_EXTERN int uv_loop_close(uv_loop_t* loop);
0293
0294
0295
0296
0297
0298 UV_EXTERN uv_loop_t* uv_loop_new(void);
0299
0300
0301
0302
0303
0304 UV_EXTERN void uv_loop_delete(uv_loop_t*);
0305 UV_EXTERN size_t uv_loop_size(void);
0306 UV_EXTERN int uv_loop_alive(const uv_loop_t* loop);
0307 UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...);
0308 UV_EXTERN int uv_loop_fork(uv_loop_t* loop);
0309
0310 UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode);
0311 UV_EXTERN void uv_stop(uv_loop_t*);
0312
0313 UV_EXTERN void uv_ref(uv_handle_t*);
0314 UV_EXTERN void uv_unref(uv_handle_t*);
0315 UV_EXTERN int uv_has_ref(const uv_handle_t*);
0316
0317 UV_EXTERN void uv_update_time(uv_loop_t*);
0318 UV_EXTERN uint64_t uv_now(const uv_loop_t*);
0319
0320 UV_EXTERN int uv_backend_fd(const uv_loop_t*);
0321 UV_EXTERN int uv_backend_timeout(const uv_loop_t*);
0322
0323 typedef void (*uv_alloc_cb)(uv_handle_t* handle,
0324 size_t suggested_size,
0325 uv_buf_t* buf);
0326 typedef void (*uv_read_cb)(uv_stream_t* stream,
0327 ssize_t nread,
0328 const uv_buf_t* buf);
0329 typedef void (*uv_write_cb)(uv_write_t* req, int status);
0330 typedef void (*uv_connect_cb)(uv_connect_t* req, int status);
0331 typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status);
0332 typedef void (*uv_connection_cb)(uv_stream_t* server, int status);
0333 typedef void (*uv_close_cb)(uv_handle_t* handle);
0334 typedef void (*uv_poll_cb)(uv_poll_t* handle, int status, int events);
0335 typedef void (*uv_timer_cb)(uv_timer_t* handle);
0336 typedef void (*uv_async_cb)(uv_async_t* handle);
0337 typedef void (*uv_prepare_cb)(uv_prepare_t* handle);
0338 typedef void (*uv_check_cb)(uv_check_t* handle);
0339 typedef void (*uv_idle_cb)(uv_idle_t* handle);
0340 typedef void (*uv_exit_cb)(uv_process_t*, int64_t exit_status, int term_signal);
0341 typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);
0342 typedef void (*uv_fs_cb)(uv_fs_t* req);
0343 typedef void (*uv_work_cb)(uv_work_t* req);
0344 typedef void (*uv_after_work_cb)(uv_work_t* req, int status);
0345 typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* req,
0346 int status,
0347 struct addrinfo* res);
0348 typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t* req,
0349 int status,
0350 const char* hostname,
0351 const char* service);
0352 typedef void (*uv_random_cb)(uv_random_t* req,
0353 int status,
0354 void* buf,
0355 size_t buflen);
0356
0357 typedef enum {
0358 UV_CLOCK_MONOTONIC,
0359 UV_CLOCK_REALTIME
0360 } uv_clock_id;
0361
0362
0363 typedef struct {
0364 long tv_sec;
0365 long tv_nsec;
0366 } uv_timespec_t;
0367
0368 typedef struct {
0369 int64_t tv_sec;
0370 int32_t tv_nsec;
0371 } uv_timespec64_t;
0372
0373
0374 typedef struct {
0375 long tv_sec;
0376 long tv_usec;
0377 } uv_timeval_t;
0378
0379 typedef struct {
0380 int64_t tv_sec;
0381 int32_t tv_usec;
0382 } uv_timeval64_t;
0383
0384 typedef struct {
0385 uint64_t st_dev;
0386 uint64_t st_mode;
0387 uint64_t st_nlink;
0388 uint64_t st_uid;
0389 uint64_t st_gid;
0390 uint64_t st_rdev;
0391 uint64_t st_ino;
0392 uint64_t st_size;
0393 uint64_t st_blksize;
0394 uint64_t st_blocks;
0395 uint64_t st_flags;
0396 uint64_t st_gen;
0397 uv_timespec_t st_atim;
0398 uv_timespec_t st_mtim;
0399 uv_timespec_t st_ctim;
0400 uv_timespec_t st_birthtim;
0401 } uv_stat_t;
0402
0403
0404 typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle,
0405 const char* filename,
0406 int events,
0407 int status);
0408
0409 typedef void (*uv_fs_poll_cb)(uv_fs_poll_t* handle,
0410 int status,
0411 const uv_stat_t* prev,
0412 const uv_stat_t* curr);
0413
0414 typedef void (*uv_signal_cb)(uv_signal_t* handle, int signum);
0415
0416
0417 typedef enum {
0418 UV_LEAVE_GROUP = 0,
0419 UV_JOIN_GROUP
0420 } uv_membership;
0421
0422
0423 UV_EXTERN int uv_translate_sys_error(int sys_errno);
0424
0425 UV_EXTERN const char* uv_strerror(int err);
0426 UV_EXTERN char* uv_strerror_r(int err, char* buf, size_t buflen);
0427
0428 UV_EXTERN const char* uv_err_name(int err);
0429 UV_EXTERN char* uv_err_name_r(int err, char* buf, size_t buflen);
0430
0431
0432 #define UV_REQ_FIELDS \
0433 \
0434 void* data; \
0435 \
0436 uv_req_type type; \
0437 \
0438 void* reserved[6]; \
0439 UV_REQ_PRIVATE_FIELDS \
0440
0441
0442 struct uv_req_s {
0443 UV_REQ_FIELDS
0444 };
0445
0446
0447
0448 UV_PRIVATE_REQ_TYPES
0449
0450
0451 UV_EXTERN int uv_shutdown(uv_shutdown_t* req,
0452 uv_stream_t* handle,
0453 uv_shutdown_cb cb);
0454
0455 struct uv_shutdown_s {
0456 UV_REQ_FIELDS
0457 uv_stream_t* handle;
0458 uv_shutdown_cb cb;
0459 UV_SHUTDOWN_PRIVATE_FIELDS
0460 };
0461
0462
0463 #define UV_HANDLE_FIELDS \
0464 \
0465 void* data; \
0466 \
0467 uv_loop_t* loop; \
0468 uv_handle_type type; \
0469 \
0470 uv_close_cb close_cb; \
0471 struct uv__queue handle_queue; \
0472 union { \
0473 int fd; \
0474 void* reserved[4]; \
0475 } u; \
0476 UV_HANDLE_PRIVATE_FIELDS \
0477
0478
0479 struct uv_handle_s {
0480 UV_HANDLE_FIELDS
0481 };
0482
0483 UV_EXTERN size_t uv_handle_size(uv_handle_type type);
0484 UV_EXTERN uv_handle_type uv_handle_get_type(const uv_handle_t* handle);
0485 UV_EXTERN const char* uv_handle_type_name(uv_handle_type type);
0486 UV_EXTERN void* uv_handle_get_data(const uv_handle_t* handle);
0487 UV_EXTERN uv_loop_t* uv_handle_get_loop(const uv_handle_t* handle);
0488 UV_EXTERN void uv_handle_set_data(uv_handle_t* handle, void* data);
0489
0490 UV_EXTERN size_t uv_req_size(uv_req_type type);
0491 UV_EXTERN void* uv_req_get_data(const uv_req_t* req);
0492 UV_EXTERN void uv_req_set_data(uv_req_t* req, void* data);
0493 UV_EXTERN uv_req_type uv_req_get_type(const uv_req_t* req);
0494 UV_EXTERN const char* uv_req_type_name(uv_req_type type);
0495
0496 UV_EXTERN int uv_is_active(const uv_handle_t* handle);
0497
0498 UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg);
0499
0500
0501 UV_EXTERN void uv_print_all_handles(uv_loop_t* loop, FILE* stream);
0502 UV_EXTERN void uv_print_active_handles(uv_loop_t* loop, FILE* stream);
0503
0504 UV_EXTERN void uv_close(uv_handle_t* handle, uv_close_cb close_cb);
0505
0506 UV_EXTERN int uv_send_buffer_size(uv_handle_t* handle, int* value);
0507 UV_EXTERN int uv_recv_buffer_size(uv_handle_t* handle, int* value);
0508
0509 UV_EXTERN int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd);
0510
0511 UV_EXTERN uv_buf_t uv_buf_init(char* base, unsigned int len);
0512
0513 UV_EXTERN int uv_pipe(uv_file fds[2], int read_flags, int write_flags);
0514 UV_EXTERN int uv_socketpair(int type,
0515 int protocol,
0516 uv_os_sock_t socket_vector[2],
0517 int flags0,
0518 int flags1);
0519
0520 #define UV_STREAM_FIELDS \
0521 \
0522 size_t write_queue_size; \
0523 uv_alloc_cb alloc_cb; \
0524 uv_read_cb read_cb; \
0525 \
0526 UV_STREAM_PRIVATE_FIELDS
0527
0528
0529
0530
0531
0532
0533
0534
0535 struct uv_stream_s {
0536 UV_HANDLE_FIELDS
0537 UV_STREAM_FIELDS
0538 };
0539
0540 UV_EXTERN size_t uv_stream_get_write_queue_size(const uv_stream_t* stream);
0541
0542 UV_EXTERN int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb);
0543 UV_EXTERN int uv_accept(uv_stream_t* server, uv_stream_t* client);
0544
0545 UV_EXTERN int uv_read_start(uv_stream_t*,
0546 uv_alloc_cb alloc_cb,
0547 uv_read_cb read_cb);
0548 UV_EXTERN int uv_read_stop(uv_stream_t*);
0549
0550 UV_EXTERN int uv_write(uv_write_t* req,
0551 uv_stream_t* handle,
0552 const uv_buf_t bufs[],
0553 unsigned int nbufs,
0554 uv_write_cb cb);
0555 UV_EXTERN int uv_write2(uv_write_t* req,
0556 uv_stream_t* handle,
0557 const uv_buf_t bufs[],
0558 unsigned int nbufs,
0559 uv_stream_t* send_handle,
0560 uv_write_cb cb);
0561 UV_EXTERN int uv_try_write(uv_stream_t* handle,
0562 const uv_buf_t bufs[],
0563 unsigned int nbufs);
0564 UV_EXTERN int uv_try_write2(uv_stream_t* handle,
0565 const uv_buf_t bufs[],
0566 unsigned int nbufs,
0567 uv_stream_t* send_handle);
0568
0569
0570 struct uv_write_s {
0571 UV_REQ_FIELDS
0572 uv_write_cb cb;
0573 uv_stream_t* send_handle;
0574 uv_stream_t* handle;
0575 UV_WRITE_PRIVATE_FIELDS
0576 };
0577
0578
0579 UV_EXTERN int uv_is_readable(const uv_stream_t* handle);
0580 UV_EXTERN int uv_is_writable(const uv_stream_t* handle);
0581
0582 UV_EXTERN int uv_stream_set_blocking(uv_stream_t* handle, int blocking);
0583
0584 UV_EXTERN int uv_is_closing(const uv_handle_t* handle);
0585
0586
0587
0588
0589
0590
0591
0592 struct uv_tcp_s {
0593 UV_HANDLE_FIELDS
0594 UV_STREAM_FIELDS
0595 UV_TCP_PRIVATE_FIELDS
0596 };
0597
0598 UV_EXTERN int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle);
0599 UV_EXTERN int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, unsigned int flags);
0600 UV_EXTERN int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock);
0601 UV_EXTERN int uv_tcp_nodelay(uv_tcp_t* handle, int enable);
0602 UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle,
0603 int enable,
0604 unsigned int delay);
0605 UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);
0606
0607 enum uv_tcp_flags {
0608
0609 UV_TCP_IPV6ONLY = 1,
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619
0620 UV_TCP_REUSEPORT = 2,
0621 };
0622
0623 UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle,
0624 const struct sockaddr* addr,
0625 unsigned int flags);
0626 UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
0627 struct sockaddr* name,
0628 int* namelen);
0629 UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
0630 struct sockaddr* name,
0631 int* namelen);
0632 UV_EXTERN int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb);
0633 UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
0634 uv_tcp_t* handle,
0635 const struct sockaddr* addr,
0636 uv_connect_cb cb);
0637
0638
0639 struct uv_connect_s {
0640 UV_REQ_FIELDS
0641 uv_connect_cb cb;
0642 uv_stream_t* handle;
0643 UV_CONNECT_PRIVATE_FIELDS
0644 };
0645
0646
0647
0648
0649
0650
0651 enum uv_udp_flags {
0652
0653 UV_UDP_IPV6ONLY = 1,
0654
0655
0656
0657
0658 UV_UDP_PARTIAL = 2,
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668
0669
0670 UV_UDP_REUSEADDR = 4,
0671
0672
0673
0674
0675 UV_UDP_MMSG_CHUNK = 8,
0676
0677
0678
0679
0680
0681 UV_UDP_MMSG_FREE = 16,
0682
0683
0684
0685
0686
0687
0688
0689 UV_UDP_LINUX_RECVERR = 32,
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699
0700
0701 UV_UDP_REUSEPORT = 64,
0702
0703
0704
0705 UV_UDP_RECVMMSG = 256
0706 };
0707
0708 typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
0709 typedef void (*uv_udp_recv_cb)(uv_udp_t* handle,
0710 ssize_t nread,
0711 const uv_buf_t* buf,
0712 const struct sockaddr* addr,
0713 unsigned flags);
0714
0715
0716 struct uv_udp_s {
0717 UV_HANDLE_FIELDS
0718
0719
0720
0721
0722
0723 size_t send_queue_size;
0724
0725
0726
0727 size_t send_queue_count;
0728 UV_UDP_PRIVATE_FIELDS
0729 };
0730
0731
0732 struct uv_udp_send_s {
0733 UV_REQ_FIELDS
0734 uv_udp_t* handle;
0735 uv_udp_send_cb cb;
0736 UV_UDP_SEND_PRIVATE_FIELDS
0737 };
0738
0739 UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle);
0740 UV_EXTERN int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, unsigned int flags);
0741 UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
0742 UV_EXTERN int uv_udp_bind(uv_udp_t* handle,
0743 const struct sockaddr* addr,
0744 unsigned int flags);
0745 UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr);
0746
0747 UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle,
0748 struct sockaddr* name,
0749 int* namelen);
0750 UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle,
0751 struct sockaddr* name,
0752 int* namelen);
0753 UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle,
0754 const char* multicast_addr,
0755 const char* interface_addr,
0756 uv_membership membership);
0757 UV_EXTERN int uv_udp_set_source_membership(uv_udp_t* handle,
0758 const char* multicast_addr,
0759 const char* interface_addr,
0760 const char* source_addr,
0761 uv_membership membership);
0762 UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on);
0763 UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl);
0764 UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle,
0765 const char* interface_addr);
0766 UV_EXTERN int uv_udp_set_broadcast(uv_udp_t* handle, int on);
0767 UV_EXTERN int uv_udp_set_ttl(uv_udp_t* handle, int ttl);
0768 UV_EXTERN int uv_udp_send(uv_udp_send_t* req,
0769 uv_udp_t* handle,
0770 const uv_buf_t bufs[],
0771 unsigned int nbufs,
0772 const struct sockaddr* addr,
0773 uv_udp_send_cb send_cb);
0774 UV_EXTERN int uv_udp_try_send(uv_udp_t* handle,
0775 const uv_buf_t bufs[],
0776 unsigned int nbufs,
0777 const struct sockaddr* addr);
0778 UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle,
0779 uv_alloc_cb alloc_cb,
0780 uv_udp_recv_cb recv_cb);
0781 UV_EXTERN int uv_udp_using_recvmmsg(const uv_udp_t* handle);
0782 UV_EXTERN int uv_udp_recv_stop(uv_udp_t* handle);
0783 UV_EXTERN size_t uv_udp_get_send_queue_size(const uv_udp_t* handle);
0784 UV_EXTERN size_t uv_udp_get_send_queue_count(const uv_udp_t* handle);
0785
0786
0787
0788
0789
0790
0791
0792 struct uv_tty_s {
0793 UV_HANDLE_FIELDS
0794 UV_STREAM_FIELDS
0795 UV_TTY_PRIVATE_FIELDS
0796 };
0797
0798 typedef enum {
0799
0800 UV_TTY_MODE_NORMAL,
0801
0802 UV_TTY_MODE_RAW,
0803
0804 UV_TTY_MODE_IO
0805 } uv_tty_mode_t;
0806
0807 typedef enum {
0808
0809
0810
0811
0812 UV_TTY_SUPPORTED,
0813
0814
0815
0816 UV_TTY_UNSUPPORTED
0817 } uv_tty_vtermstate_t;
0818
0819
0820 UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable);
0821 UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode);
0822 UV_EXTERN int uv_tty_reset_mode(void);
0823 UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height);
0824 UV_EXTERN void uv_tty_set_vterm_state(uv_tty_vtermstate_t state);
0825 UV_EXTERN int uv_tty_get_vterm_state(uv_tty_vtermstate_t* state);
0826
0827 #ifdef __cplusplus
0828 extern "C++" {
0829
0830 inline int uv_tty_set_mode(uv_tty_t* handle, int mode) {
0831 return uv_tty_set_mode(handle, static_cast<uv_tty_mode_t>(mode));
0832 }
0833
0834 }
0835 #endif
0836
0837 UV_EXTERN uv_handle_type uv_guess_handle(uv_file file);
0838
0839 enum {
0840 UV_PIPE_NO_TRUNCATE = 1u << 0
0841 };
0842
0843
0844
0845
0846
0847
0848
0849 struct uv_pipe_s {
0850 UV_HANDLE_FIELDS
0851 UV_STREAM_FIELDS
0852 int ipc;
0853 UV_PIPE_PRIVATE_FIELDS
0854 };
0855
0856 UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);
0857 UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file);
0858 UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name);
0859 UV_EXTERN int uv_pipe_bind2(uv_pipe_t* handle,
0860 const char* name,
0861 size_t namelen,
0862 unsigned int flags);
0863 UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
0864 uv_pipe_t* handle,
0865 const char* name,
0866 uv_connect_cb cb);
0867 UV_EXTERN int uv_pipe_connect2(uv_connect_t* req,
0868 uv_pipe_t* handle,
0869 const char* name,
0870 size_t namelen,
0871 unsigned int flags,
0872 uv_connect_cb cb);
0873 UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
0874 char* buffer,
0875 size_t* size);
0876 UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle,
0877 char* buffer,
0878 size_t* size);
0879 UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
0880 UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle);
0881 UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle);
0882 UV_EXTERN int uv_pipe_chmod(uv_pipe_t* handle, int flags);
0883
0884
0885 struct uv_poll_s {
0886 UV_HANDLE_FIELDS
0887 uv_poll_cb poll_cb;
0888 UV_POLL_PRIVATE_FIELDS
0889 };
0890
0891 enum uv_poll_event {
0892 UV_READABLE = 1,
0893 UV_WRITABLE = 2,
0894 UV_DISCONNECT = 4,
0895 UV_PRIORITIZED = 8
0896 };
0897
0898 UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd);
0899 UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop,
0900 uv_poll_t* handle,
0901 uv_os_sock_t socket);
0902 UV_EXTERN int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb);
0903 UV_EXTERN int uv_poll_stop(uv_poll_t* handle);
0904
0905
0906 struct uv_prepare_s {
0907 UV_HANDLE_FIELDS
0908 UV_PREPARE_PRIVATE_FIELDS
0909 };
0910
0911 UV_EXTERN int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare);
0912 UV_EXTERN int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb);
0913 UV_EXTERN int uv_prepare_stop(uv_prepare_t* prepare);
0914
0915
0916 struct uv_check_s {
0917 UV_HANDLE_FIELDS
0918 UV_CHECK_PRIVATE_FIELDS
0919 };
0920
0921 UV_EXTERN int uv_check_init(uv_loop_t*, uv_check_t* check);
0922 UV_EXTERN int uv_check_start(uv_check_t* check, uv_check_cb cb);
0923 UV_EXTERN int uv_check_stop(uv_check_t* check);
0924
0925
0926 struct uv_idle_s {
0927 UV_HANDLE_FIELDS
0928 UV_IDLE_PRIVATE_FIELDS
0929 };
0930
0931 UV_EXTERN int uv_idle_init(uv_loop_t*, uv_idle_t* idle);
0932 UV_EXTERN int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb);
0933 UV_EXTERN int uv_idle_stop(uv_idle_t* idle);
0934
0935
0936 struct uv_async_s {
0937 UV_HANDLE_FIELDS
0938 UV_ASYNC_PRIVATE_FIELDS
0939 };
0940
0941 UV_EXTERN int uv_async_init(uv_loop_t*,
0942 uv_async_t* async,
0943 uv_async_cb async_cb);
0944 UV_EXTERN int uv_async_send(uv_async_t* async);
0945
0946
0947
0948
0949
0950
0951
0952 struct uv_timer_s {
0953 UV_HANDLE_FIELDS
0954 UV_TIMER_PRIVATE_FIELDS
0955 };
0956
0957 UV_EXTERN int uv_timer_init(uv_loop_t*, uv_timer_t* handle);
0958 UV_EXTERN int uv_timer_start(uv_timer_t* handle,
0959 uv_timer_cb cb,
0960 uint64_t timeout,
0961 uint64_t repeat);
0962 UV_EXTERN int uv_timer_stop(uv_timer_t* handle);
0963 UV_EXTERN int uv_timer_again(uv_timer_t* handle);
0964 UV_EXTERN void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat);
0965 UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t* handle);
0966 UV_EXTERN uint64_t uv_timer_get_due_in(const uv_timer_t* handle);
0967
0968
0969
0970
0971
0972
0973
0974 struct uv_getaddrinfo_s {
0975 UV_REQ_FIELDS
0976
0977 uv_loop_t* loop;
0978
0979 UV_GETADDRINFO_PRIVATE_FIELDS
0980 };
0981
0982
0983 UV_EXTERN int uv_getaddrinfo(uv_loop_t* loop,
0984 uv_getaddrinfo_t* req,
0985 uv_getaddrinfo_cb getaddrinfo_cb,
0986 const char* node,
0987 const char* service,
0988 const struct addrinfo* hints);
0989 UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai);
0990
0991
0992
0993
0994
0995
0996
0997 struct uv_getnameinfo_s {
0998 UV_REQ_FIELDS
0999
1000 uv_loop_t* loop;
1001
1002 UV_GETNAMEINFO_PRIVATE_FIELDS
1003 };
1004
1005 UV_EXTERN int uv_getnameinfo(uv_loop_t* loop,
1006 uv_getnameinfo_t* req,
1007 uv_getnameinfo_cb getnameinfo_cb,
1008 const struct sockaddr* addr,
1009 int flags);
1010
1011
1012
1013 typedef enum {
1014 UV_IGNORE = 0x00,
1015 UV_CREATE_PIPE = 0x01,
1016 UV_INHERIT_FD = 0x02,
1017 UV_INHERIT_STREAM = 0x04,
1018
1019
1020
1021
1022
1023
1024 UV_READABLE_PIPE = 0x10,
1025 UV_WRITABLE_PIPE = 0x20,
1026
1027
1028
1029
1030
1031
1032
1033 UV_NONBLOCK_PIPE = 0x40,
1034 UV_OVERLAPPED_PIPE = 0x40
1035 } uv_stdio_flags;
1036
1037 typedef struct uv_stdio_container_s {
1038 uv_stdio_flags flags;
1039
1040 union {
1041 uv_stream_t* stream;
1042 int fd;
1043 } data;
1044 } uv_stdio_container_t;
1045
1046 typedef struct uv_process_options_s {
1047 uv_exit_cb exit_cb;
1048 const char* file;
1049
1050
1051
1052
1053
1054
1055 char** args;
1056
1057
1058
1059
1060 char** env;
1061
1062
1063
1064
1065 const char* cwd;
1066
1067
1068
1069
1070 unsigned int flags;
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080 int stdio_count;
1081 uv_stdio_container_t* stdio;
1082
1083
1084
1085
1086
1087 uv_uid_t uid;
1088 uv_gid_t gid;
1089 } uv_process_options_t;
1090
1091
1092
1093
1094 enum uv_process_flags {
1095
1096
1097
1098
1099
1100 UV_PROCESS_SETUID = (1 << 0),
1101
1102
1103
1104
1105
1106 UV_PROCESS_SETGID = (1 << 1),
1107
1108
1109
1110
1111
1112 UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2),
1113
1114
1115
1116
1117
1118
1119
1120 UV_PROCESS_DETACHED = (1 << 3),
1121
1122
1123
1124
1125 UV_PROCESS_WINDOWS_HIDE = (1 << 4),
1126
1127
1128
1129
1130
1131 UV_PROCESS_WINDOWS_HIDE_CONSOLE = (1 << 5),
1132
1133
1134
1135
1136
1137 UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6),
1138
1139
1140
1141
1142
1143
1144 UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME = (1 << 7)
1145 };
1146
1147
1148
1149
1150 struct uv_process_s {
1151 UV_HANDLE_FIELDS
1152 uv_exit_cb exit_cb;
1153 int pid;
1154 UV_PROCESS_PRIVATE_FIELDS
1155 };
1156
1157 UV_EXTERN int uv_spawn(uv_loop_t* loop,
1158 uv_process_t* handle,
1159 const uv_process_options_t* options);
1160 UV_EXTERN int uv_process_kill(uv_process_t*, int signum);
1161 UV_EXTERN int uv_kill(int pid, int signum);
1162 UV_EXTERN uv_pid_t uv_process_get_pid(const uv_process_t*);
1163
1164
1165
1166
1167
1168 struct uv_work_s {
1169 UV_REQ_FIELDS
1170 uv_loop_t* loop;
1171 uv_work_cb work_cb;
1172 uv_after_work_cb after_work_cb;
1173 UV_WORK_PRIVATE_FIELDS
1174 };
1175
1176 UV_EXTERN int uv_queue_work(uv_loop_t* loop,
1177 uv_work_t* req,
1178 uv_work_cb work_cb,
1179 uv_after_work_cb after_work_cb);
1180
1181 UV_EXTERN int uv_cancel(uv_req_t* req);
1182
1183
1184 struct uv_cpu_times_s {
1185 uint64_t user;
1186 uint64_t nice;
1187 uint64_t sys;
1188 uint64_t idle;
1189 uint64_t irq;
1190 };
1191
1192 struct uv_cpu_info_s {
1193 char* model;
1194 int speed;
1195 struct uv_cpu_times_s cpu_times;
1196 };
1197
1198 struct uv_interface_address_s {
1199 char* name;
1200 char phys_addr[6];
1201 int is_internal;
1202 union {
1203 struct sockaddr_in address4;
1204 struct sockaddr_in6 address6;
1205 } address;
1206 union {
1207 struct sockaddr_in netmask4;
1208 struct sockaddr_in6 netmask6;
1209 } netmask;
1210 };
1211
1212 struct uv_passwd_s {
1213 char* username;
1214 unsigned long uid;
1215 unsigned long gid;
1216 char* shell;
1217 char* homedir;
1218 };
1219
1220 struct uv_group_s {
1221 char* groupname;
1222 unsigned long gid;
1223 char** members;
1224 };
1225
1226 struct uv_utsname_s {
1227 char sysname[256];
1228 char release[256];
1229 char version[256];
1230 char machine[256];
1231
1232
1233
1234 };
1235
1236 struct uv_statfs_s {
1237 uint64_t f_type;
1238 uint64_t f_bsize;
1239 uint64_t f_blocks;
1240 uint64_t f_bfree;
1241 uint64_t f_bavail;
1242 uint64_t f_files;
1243 uint64_t f_ffree;
1244 uint64_t f_spare[4];
1245 };
1246
1247 typedef enum {
1248 UV_DIRENT_UNKNOWN,
1249 UV_DIRENT_FILE,
1250 UV_DIRENT_DIR,
1251 UV_DIRENT_LINK,
1252 UV_DIRENT_FIFO,
1253 UV_DIRENT_SOCKET,
1254 UV_DIRENT_CHAR,
1255 UV_DIRENT_BLOCK
1256 } uv_dirent_type_t;
1257
1258 struct uv_dirent_s {
1259 const char* name;
1260 uv_dirent_type_t type;
1261 };
1262
1263 UV_EXTERN char** uv_setup_args(int argc, char** argv);
1264 UV_EXTERN int uv_get_process_title(char* buffer, size_t size);
1265 UV_EXTERN int uv_set_process_title(const char* title);
1266 UV_EXTERN int uv_resident_set_memory(size_t* rss);
1267 UV_EXTERN int uv_uptime(double* uptime);
1268 UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd);
1269 UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd);
1270
1271 typedef struct {
1272 uv_timeval_t ru_utime;
1273 uv_timeval_t ru_stime;
1274 uint64_t ru_maxrss;
1275 uint64_t ru_ixrss;
1276 uint64_t ru_idrss;
1277 uint64_t ru_isrss;
1278 uint64_t ru_minflt;
1279 uint64_t ru_majflt;
1280 uint64_t ru_nswap;
1281 uint64_t ru_inblock;
1282 uint64_t ru_oublock;
1283 uint64_t ru_msgsnd;
1284 uint64_t ru_msgrcv;
1285 uint64_t ru_nsignals;
1286 uint64_t ru_nvcsw;
1287 uint64_t ru_nivcsw;
1288 } uv_rusage_t;
1289
1290 UV_EXTERN int uv_getrusage(uv_rusage_t* rusage);
1291
1292 UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);
1293 UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size);
1294 UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd);
1295 UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd);
1296 UV_EXTERN int uv_os_get_passwd2(uv_passwd_t* pwd, uv_uid_t uid);
1297 UV_EXTERN int uv_os_get_group(uv_group_t* grp, uv_uid_t gid);
1298 UV_EXTERN void uv_os_free_group(uv_group_t* grp);
1299 UV_EXTERN uv_pid_t uv_os_getpid(void);
1300 UV_EXTERN uv_pid_t uv_os_getppid(void);
1301
1302 #if defined(__PASE__)
1303
1304 # define UV_PRIORITY_LOW 39
1305 # define UV_PRIORITY_BELOW_NORMAL 15
1306 # define UV_PRIORITY_NORMAL 0
1307 # define UV_PRIORITY_ABOVE_NORMAL -4
1308 # define UV_PRIORITY_HIGH -7
1309 # define UV_PRIORITY_HIGHEST -10
1310 #else
1311 # define UV_PRIORITY_LOW 19
1312 # define UV_PRIORITY_BELOW_NORMAL 10
1313 # define UV_PRIORITY_NORMAL 0
1314 # define UV_PRIORITY_ABOVE_NORMAL -7
1315 # define UV_PRIORITY_HIGH -14
1316 # define UV_PRIORITY_HIGHEST -20
1317 #endif
1318
1319 UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority);
1320 UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority);
1321
1322 enum {
1323 UV_THREAD_PRIORITY_HIGHEST = 2,
1324 UV_THREAD_PRIORITY_ABOVE_NORMAL = 1,
1325 UV_THREAD_PRIORITY_NORMAL = 0,
1326 UV_THREAD_PRIORITY_BELOW_NORMAL = -1,
1327 UV_THREAD_PRIORITY_LOWEST = -2,
1328 };
1329
1330 UV_EXTERN int uv_thread_getpriority(uv_thread_t tid, int* priority);
1331 UV_EXTERN int uv_thread_setpriority(uv_thread_t tid, int priority);
1332
1333 UV_EXTERN unsigned int uv_available_parallelism(void);
1334 UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
1335 UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);
1336 UV_EXTERN int uv_cpumask_size(void);
1337
1338 UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses,
1339 int* count);
1340 UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses,
1341 int count);
1342
1343 struct uv_env_item_s {
1344 char* name;
1345 char* value;
1346 };
1347
1348 UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count);
1349 UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count);
1350 UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size);
1351 UV_EXTERN int uv_os_setenv(const char* name, const char* value);
1352 UV_EXTERN int uv_os_unsetenv(const char* name);
1353
1354 #ifdef MAXHOSTNAMELEN
1355 # define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1)
1356 #else
1357
1358
1359
1360
1361
1362 # define UV_MAXHOSTNAMESIZE 256
1363 #endif
1364
1365 UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size);
1366
1367 UV_EXTERN int uv_os_uname(uv_utsname_t* buffer);
1368
1369 struct uv_metrics_s {
1370 uint64_t loop_count;
1371 uint64_t events;
1372 uint64_t events_waiting;
1373
1374 uint64_t* reserved[13];
1375 };
1376
1377 UV_EXTERN int uv_metrics_info(uv_loop_t* loop, uv_metrics_t* metrics);
1378 UV_EXTERN uint64_t uv_metrics_idle_time(uv_loop_t* loop);
1379
1380 typedef enum {
1381 UV_FS_UNKNOWN = -1,
1382 UV_FS_CUSTOM,
1383 UV_FS_OPEN,
1384 UV_FS_CLOSE,
1385 UV_FS_READ,
1386 UV_FS_WRITE,
1387 UV_FS_SENDFILE,
1388 UV_FS_STAT,
1389 UV_FS_LSTAT,
1390 UV_FS_FSTAT,
1391 UV_FS_FTRUNCATE,
1392 UV_FS_UTIME,
1393 UV_FS_FUTIME,
1394 UV_FS_ACCESS,
1395 UV_FS_CHMOD,
1396 UV_FS_FCHMOD,
1397 UV_FS_FSYNC,
1398 UV_FS_FDATASYNC,
1399 UV_FS_UNLINK,
1400 UV_FS_RMDIR,
1401 UV_FS_MKDIR,
1402 UV_FS_MKDTEMP,
1403 UV_FS_RENAME,
1404 UV_FS_SCANDIR,
1405 UV_FS_LINK,
1406 UV_FS_SYMLINK,
1407 UV_FS_READLINK,
1408 UV_FS_CHOWN,
1409 UV_FS_FCHOWN,
1410 UV_FS_REALPATH,
1411 UV_FS_COPYFILE,
1412 UV_FS_LCHOWN,
1413 UV_FS_OPENDIR,
1414 UV_FS_READDIR,
1415 UV_FS_CLOSEDIR,
1416 UV_FS_STATFS,
1417 UV_FS_MKSTEMP,
1418 UV_FS_LUTIME
1419 } uv_fs_type;
1420
1421 struct uv_dir_s {
1422 uv_dirent_t* dirents;
1423 size_t nentries;
1424 void* reserved[4];
1425 UV_DIR_PRIVATE_FIELDS
1426 };
1427
1428
1429 struct uv_fs_s {
1430 UV_REQ_FIELDS
1431 uv_fs_type fs_type;
1432 uv_loop_t* loop;
1433 uv_fs_cb cb;
1434 ssize_t result;
1435 void* ptr;
1436 const char* path;
1437 uv_stat_t statbuf;
1438 UV_FS_PRIVATE_FIELDS
1439 };
1440
1441 UV_EXTERN uv_fs_type uv_fs_get_type(const uv_fs_t*);
1442 UV_EXTERN ssize_t uv_fs_get_result(const uv_fs_t*);
1443 UV_EXTERN int uv_fs_get_system_error(const uv_fs_t*);
1444 UV_EXTERN void* uv_fs_get_ptr(const uv_fs_t*);
1445 UV_EXTERN const char* uv_fs_get_path(const uv_fs_t*);
1446 UV_EXTERN uv_stat_t* uv_fs_get_statbuf(uv_fs_t*);
1447
1448 UV_EXTERN void uv_fs_req_cleanup(uv_fs_t* req);
1449 UV_EXTERN int uv_fs_close(uv_loop_t* loop,
1450 uv_fs_t* req,
1451 uv_file file,
1452 uv_fs_cb cb);
1453 UV_EXTERN int uv_fs_open(uv_loop_t* loop,
1454 uv_fs_t* req,
1455 const char* path,
1456 int flags,
1457 int mode,
1458 uv_fs_cb cb);
1459 UV_EXTERN int uv_fs_read(uv_loop_t* loop,
1460 uv_fs_t* req,
1461 uv_file file,
1462 const uv_buf_t bufs[],
1463 unsigned int nbufs,
1464 int64_t offset,
1465 uv_fs_cb cb);
1466 UV_EXTERN int uv_fs_unlink(uv_loop_t* loop,
1467 uv_fs_t* req,
1468 const char* path,
1469 uv_fs_cb cb);
1470 UV_EXTERN int uv_fs_write(uv_loop_t* loop,
1471 uv_fs_t* req,
1472 uv_file file,
1473 const uv_buf_t bufs[],
1474 unsigned int nbufs,
1475 int64_t offset,
1476 uv_fs_cb cb);
1477
1478
1479
1480
1481 #define UV_FS_COPYFILE_EXCL 0x0001
1482
1483
1484
1485
1486
1487 #define UV_FS_COPYFILE_FICLONE 0x0002
1488
1489
1490
1491
1492
1493 #define UV_FS_COPYFILE_FICLONE_FORCE 0x0004
1494
1495 UV_EXTERN int uv_fs_copyfile(uv_loop_t* loop,
1496 uv_fs_t* req,
1497 const char* path,
1498 const char* new_path,
1499 int flags,
1500 uv_fs_cb cb);
1501 UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop,
1502 uv_fs_t* req,
1503 const char* path,
1504 int mode,
1505 uv_fs_cb cb);
1506 UV_EXTERN int uv_fs_mkdtemp(uv_loop_t* loop,
1507 uv_fs_t* req,
1508 const char* tpl,
1509 uv_fs_cb cb);
1510 UV_EXTERN int uv_fs_mkstemp(uv_loop_t* loop,
1511 uv_fs_t* req,
1512 const char* tpl,
1513 uv_fs_cb cb);
1514 UV_EXTERN int uv_fs_rmdir(uv_loop_t* loop,
1515 uv_fs_t* req,
1516 const char* path,
1517 uv_fs_cb cb);
1518 UV_EXTERN int uv_fs_scandir(uv_loop_t* loop,
1519 uv_fs_t* req,
1520 const char* path,
1521 int flags,
1522 uv_fs_cb cb);
1523 UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req,
1524 uv_dirent_t* ent);
1525 UV_EXTERN int uv_fs_opendir(uv_loop_t* loop,
1526 uv_fs_t* req,
1527 const char* path,
1528 uv_fs_cb cb);
1529 UV_EXTERN int uv_fs_readdir(uv_loop_t* loop,
1530 uv_fs_t* req,
1531 uv_dir_t* dir,
1532 uv_fs_cb cb);
1533 UV_EXTERN int uv_fs_closedir(uv_loop_t* loop,
1534 uv_fs_t* req,
1535 uv_dir_t* dir,
1536 uv_fs_cb cb);
1537 UV_EXTERN int uv_fs_stat(uv_loop_t* loop,
1538 uv_fs_t* req,
1539 const char* path,
1540 uv_fs_cb cb);
1541 UV_EXTERN int uv_fs_fstat(uv_loop_t* loop,
1542 uv_fs_t* req,
1543 uv_file file,
1544 uv_fs_cb cb);
1545 UV_EXTERN int uv_fs_rename(uv_loop_t* loop,
1546 uv_fs_t* req,
1547 const char* path,
1548 const char* new_path,
1549 uv_fs_cb cb);
1550 UV_EXTERN int uv_fs_fsync(uv_loop_t* loop,
1551 uv_fs_t* req,
1552 uv_file file,
1553 uv_fs_cb cb);
1554 UV_EXTERN int uv_fs_fdatasync(uv_loop_t* loop,
1555 uv_fs_t* req,
1556 uv_file file,
1557 uv_fs_cb cb);
1558 UV_EXTERN int uv_fs_ftruncate(uv_loop_t* loop,
1559 uv_fs_t* req,
1560 uv_file file,
1561 int64_t offset,
1562 uv_fs_cb cb);
1563 UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop,
1564 uv_fs_t* req,
1565 uv_file out_fd,
1566 uv_file in_fd,
1567 int64_t in_offset,
1568 size_t length,
1569 uv_fs_cb cb);
1570 UV_EXTERN int uv_fs_access(uv_loop_t* loop,
1571 uv_fs_t* req,
1572 const char* path,
1573 int mode,
1574 uv_fs_cb cb);
1575 UV_EXTERN int uv_fs_chmod(uv_loop_t* loop,
1576 uv_fs_t* req,
1577 const char* path,
1578 int mode,
1579 uv_fs_cb cb);
1580 UV_EXTERN int uv_fs_utime(uv_loop_t* loop,
1581 uv_fs_t* req,
1582 const char* path,
1583 double atime,
1584 double mtime,
1585 uv_fs_cb cb);
1586 UV_EXTERN int uv_fs_futime(uv_loop_t* loop,
1587 uv_fs_t* req,
1588 uv_file file,
1589 double atime,
1590 double mtime,
1591 uv_fs_cb cb);
1592 UV_EXTERN int uv_fs_lutime(uv_loop_t* loop,
1593 uv_fs_t* req,
1594 const char* path,
1595 double atime,
1596 double mtime,
1597 uv_fs_cb cb);
1598 UV_EXTERN int uv_fs_lstat(uv_loop_t* loop,
1599 uv_fs_t* req,
1600 const char* path,
1601 uv_fs_cb cb);
1602 UV_EXTERN int uv_fs_link(uv_loop_t* loop,
1603 uv_fs_t* req,
1604 const char* path,
1605 const char* new_path,
1606 uv_fs_cb cb);
1607
1608
1609
1610
1611
1612 #define UV_FS_SYMLINK_DIR 0x0001
1613
1614
1615
1616
1617
1618 #define UV_FS_SYMLINK_JUNCTION 0x0002
1619
1620 UV_EXTERN int uv_fs_symlink(uv_loop_t* loop,
1621 uv_fs_t* req,
1622 const char* path,
1623 const char* new_path,
1624 int flags,
1625 uv_fs_cb cb);
1626 UV_EXTERN int uv_fs_readlink(uv_loop_t* loop,
1627 uv_fs_t* req,
1628 const char* path,
1629 uv_fs_cb cb);
1630 UV_EXTERN int uv_fs_realpath(uv_loop_t* loop,
1631 uv_fs_t* req,
1632 const char* path,
1633 uv_fs_cb cb);
1634 UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop,
1635 uv_fs_t* req,
1636 uv_file file,
1637 int mode,
1638 uv_fs_cb cb);
1639 UV_EXTERN int uv_fs_chown(uv_loop_t* loop,
1640 uv_fs_t* req,
1641 const char* path,
1642 uv_uid_t uid,
1643 uv_gid_t gid,
1644 uv_fs_cb cb);
1645 UV_EXTERN int uv_fs_fchown(uv_loop_t* loop,
1646 uv_fs_t* req,
1647 uv_file file,
1648 uv_uid_t uid,
1649 uv_gid_t gid,
1650 uv_fs_cb cb);
1651 UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
1652 uv_fs_t* req,
1653 const char* path,
1654 uv_uid_t uid,
1655 uv_gid_t gid,
1656 uv_fs_cb cb);
1657 UV_EXTERN int uv_fs_statfs(uv_loop_t* loop,
1658 uv_fs_t* req,
1659 const char* path,
1660 uv_fs_cb cb);
1661
1662
1663 enum uv_fs_event {
1664 UV_RENAME = 1,
1665 UV_CHANGE = 2
1666 };
1667
1668
1669 struct uv_fs_event_s {
1670 UV_HANDLE_FIELDS
1671
1672 char* path;
1673 UV_FS_EVENT_PRIVATE_FIELDS
1674 };
1675
1676
1677
1678
1679
1680 struct uv_fs_poll_s {
1681 UV_HANDLE_FIELDS
1682
1683 void* poll_ctx;
1684 };
1685
1686 UV_EXTERN int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle);
1687 UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle,
1688 uv_fs_poll_cb poll_cb,
1689 const char* path,
1690 unsigned int interval);
1691 UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle);
1692 UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle,
1693 char* buffer,
1694 size_t* size);
1695
1696
1697 struct uv_signal_s {
1698 UV_HANDLE_FIELDS
1699 uv_signal_cb signal_cb;
1700 int signum;
1701 UV_SIGNAL_PRIVATE_FIELDS
1702 };
1703
1704 UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
1705 UV_EXTERN int uv_signal_start(uv_signal_t* handle,
1706 uv_signal_cb signal_cb,
1707 int signum);
1708 UV_EXTERN int uv_signal_start_oneshot(uv_signal_t* handle,
1709 uv_signal_cb signal_cb,
1710 int signum);
1711 UV_EXTERN int uv_signal_stop(uv_signal_t* handle);
1712
1713 UV_EXTERN void uv_loadavg(double avg[3]);
1714
1715
1716
1717
1718
1719 enum uv_fs_event_flags {
1720
1721
1722
1723
1724
1725
1726
1727 UV_FS_EVENT_WATCH_ENTRY = 1,
1728
1729
1730
1731
1732
1733
1734
1735
1736 UV_FS_EVENT_STAT = 2,
1737
1738
1739
1740
1741
1742
1743 UV_FS_EVENT_RECURSIVE = 4
1744 };
1745
1746
1747 UV_EXTERN int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle);
1748 UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle,
1749 uv_fs_event_cb cb,
1750 const char* path,
1751 unsigned int flags);
1752 UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle);
1753 UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle,
1754 char* buffer,
1755 size_t* size);
1756
1757 UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr);
1758 UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr);
1759
1760 UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size);
1761 UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size);
1762 UV_EXTERN int uv_ip_name(const struct sockaddr* src, char* dst, size_t size);
1763
1764 UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size);
1765 UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst);
1766
1767
1768 struct uv_random_s {
1769 UV_REQ_FIELDS
1770
1771 uv_loop_t* loop;
1772
1773 int status;
1774 void* buf;
1775 size_t buflen;
1776 uv_random_cb cb;
1777 struct uv__work work_req;
1778 };
1779
1780 UV_EXTERN int uv_random(uv_loop_t* loop,
1781 uv_random_t* req,
1782 void *buf,
1783 size_t buflen,
1784 unsigned flags,
1785 uv_random_cb cb);
1786
1787 #if defined(IF_NAMESIZE)
1788 # define UV_IF_NAMESIZE (IF_NAMESIZE + 1)
1789 #elif defined(IFNAMSIZ)
1790 # define UV_IF_NAMESIZE (IFNAMSIZ + 1)
1791 #else
1792 # define UV_IF_NAMESIZE (16 + 1)
1793 #endif
1794
1795 UV_EXTERN int uv_if_indextoname(unsigned int ifindex,
1796 char* buffer,
1797 size_t* size);
1798 UV_EXTERN int uv_if_indextoiid(unsigned int ifindex,
1799 char* buffer,
1800 size_t* size);
1801
1802 UV_EXTERN int uv_exepath(char* buffer, size_t* size);
1803
1804 UV_EXTERN int uv_cwd(char* buffer, size_t* size);
1805
1806 UV_EXTERN int uv_chdir(const char* dir);
1807
1808 UV_EXTERN uint64_t uv_get_free_memory(void);
1809 UV_EXTERN uint64_t uv_get_total_memory(void);
1810 UV_EXTERN uint64_t uv_get_constrained_memory(void);
1811 UV_EXTERN uint64_t uv_get_available_memory(void);
1812
1813 UV_EXTERN int uv_clock_gettime(uv_clock_id clock_id, uv_timespec64_t* ts);
1814 UV_EXTERN uint64_t uv_hrtime(void);
1815 UV_EXTERN void uv_sleep(unsigned int msec);
1816
1817 UV_EXTERN void uv_disable_stdio_inheritance(void);
1818
1819 UV_EXTERN int uv_dlopen(const char* filename, uv_lib_t* lib);
1820 UV_EXTERN void uv_dlclose(uv_lib_t* lib);
1821 UV_EXTERN int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr);
1822 UV_EXTERN const char* uv_dlerror(const uv_lib_t* lib);
1823
1824 UV_EXTERN int uv_mutex_init(uv_mutex_t* handle);
1825 UV_EXTERN int uv_mutex_init_recursive(uv_mutex_t* handle);
1826 UV_EXTERN void uv_mutex_destroy(uv_mutex_t* handle);
1827 UV_EXTERN void uv_mutex_lock(uv_mutex_t* handle);
1828 UV_EXTERN int uv_mutex_trylock(uv_mutex_t* handle);
1829 UV_EXTERN void uv_mutex_unlock(uv_mutex_t* handle);
1830
1831 UV_EXTERN int uv_rwlock_init(uv_rwlock_t* rwlock);
1832 UV_EXTERN void uv_rwlock_destroy(uv_rwlock_t* rwlock);
1833 UV_EXTERN void uv_rwlock_rdlock(uv_rwlock_t* rwlock);
1834 UV_EXTERN int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock);
1835 UV_EXTERN void uv_rwlock_rdunlock(uv_rwlock_t* rwlock);
1836 UV_EXTERN void uv_rwlock_wrlock(uv_rwlock_t* rwlock);
1837 UV_EXTERN int uv_rwlock_trywrlock(uv_rwlock_t* rwlock);
1838 UV_EXTERN void uv_rwlock_wrunlock(uv_rwlock_t* rwlock);
1839
1840 UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
1841 UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
1842 UV_EXTERN void uv_sem_post(uv_sem_t* sem);
1843 UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
1844 UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);
1845
1846 UV_EXTERN int uv_cond_init(uv_cond_t* cond);
1847 UV_EXTERN void uv_cond_destroy(uv_cond_t* cond);
1848 UV_EXTERN void uv_cond_signal(uv_cond_t* cond);
1849 UV_EXTERN void uv_cond_broadcast(uv_cond_t* cond);
1850
1851 UV_EXTERN int uv_barrier_init(uv_barrier_t* barrier, unsigned int count);
1852 UV_EXTERN void uv_barrier_destroy(uv_barrier_t* barrier);
1853 UV_EXTERN int uv_barrier_wait(uv_barrier_t* barrier);
1854
1855 UV_EXTERN void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex);
1856 UV_EXTERN int uv_cond_timedwait(uv_cond_t* cond,
1857 uv_mutex_t* mutex,
1858 uint64_t timeout);
1859
1860 UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void));
1861
1862 UV_EXTERN int uv_key_create(uv_key_t* key);
1863 UV_EXTERN void uv_key_delete(uv_key_t* key);
1864 UV_EXTERN void* uv_key_get(uv_key_t* key);
1865 UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
1866
1867 UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv);
1868
1869 typedef void (*uv_thread_cb)(void* arg);
1870
1871 UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
1872
1873 typedef enum {
1874 UV_THREAD_NO_FLAGS = 0x00,
1875 UV_THREAD_HAS_STACK_SIZE = 0x01
1876 } uv_thread_create_flags;
1877
1878 struct uv_thread_options_s {
1879 unsigned int flags;
1880 size_t stack_size;
1881
1882 };
1883
1884 typedef struct uv_thread_options_s uv_thread_options_t;
1885
1886 UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid,
1887 const uv_thread_options_t* params,
1888 uv_thread_cb entry,
1889 void* arg);
1890 UV_EXTERN int uv_thread_setaffinity(uv_thread_t* tid,
1891 char* cpumask,
1892 char* oldmask,
1893 size_t mask_size);
1894 UV_EXTERN int uv_thread_getaffinity(uv_thread_t* tid,
1895 char* cpumask,
1896 size_t mask_size);
1897 UV_EXTERN int uv_thread_getcpu(void);
1898 UV_EXTERN uv_thread_t uv_thread_self(void);
1899 UV_EXTERN int uv_thread_join(uv_thread_t *tid);
1900 UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);
1901
1902
1903 #define XX(_, name) uv_ ## name ## _t name;
1904 union uv_any_handle {
1905 UV_HANDLE_TYPE_MAP(XX)
1906 };
1907
1908 union uv_any_req {
1909 UV_REQ_TYPE_MAP(XX)
1910 };
1911 #undef XX
1912
1913
1914 struct uv_loop_s {
1915
1916 void* data;
1917
1918 unsigned int active_handles;
1919 struct uv__queue handle_queue;
1920 union {
1921 void* unused;
1922 unsigned int count;
1923 } active_reqs;
1924
1925 void* internal_fields;
1926
1927 unsigned int stop_flag;
1928 UV_LOOP_PRIVATE_FIELDS
1929 };
1930
1931 UV_EXTERN void* uv_loop_get_data(const uv_loop_t*);
1932 UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data);
1933
1934
1935 UV_EXTERN size_t uv_utf16_length_as_wtf8(const uint16_t* utf16,
1936 ssize_t utf16_len);
1937 UV_EXTERN int uv_utf16_to_wtf8(const uint16_t* utf16,
1938 ssize_t utf16_len,
1939 char** wtf8_ptr,
1940 size_t* wtf8_len_ptr);
1941 UV_EXTERN ssize_t uv_wtf8_length_as_utf16(const char* wtf8);
1942 UV_EXTERN void uv_wtf8_to_utf16(const char* wtf8,
1943 uint16_t* utf16,
1944 size_t utf16_len);
1945
1946
1947 #undef UV_HANDLE_TYPE_PRIVATE
1948 #undef UV_REQ_TYPE_PRIVATE
1949 #undef UV_REQ_PRIVATE_FIELDS
1950 #undef UV_STREAM_PRIVATE_FIELDS
1951 #undef UV_TCP_PRIVATE_FIELDS
1952 #undef UV_PREPARE_PRIVATE_FIELDS
1953 #undef UV_CHECK_PRIVATE_FIELDS
1954 #undef UV_IDLE_PRIVATE_FIELDS
1955 #undef UV_ASYNC_PRIVATE_FIELDS
1956 #undef UV_TIMER_PRIVATE_FIELDS
1957 #undef UV_GETADDRINFO_PRIVATE_FIELDS
1958 #undef UV_GETNAMEINFO_PRIVATE_FIELDS
1959 #undef UV_FS_REQ_PRIVATE_FIELDS
1960 #undef UV_WORK_PRIVATE_FIELDS
1961 #undef UV_FS_EVENT_PRIVATE_FIELDS
1962 #undef UV_SIGNAL_PRIVATE_FIELDS
1963 #undef UV_LOOP_PRIVATE_FIELDS
1964 #undef UV_LOOP_PRIVATE_PLATFORM_FIELDS
1965 #undef UV__ERR
1966
1967 #ifdef __cplusplus
1968 }
1969 #endif
1970 #endif