noderb 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/noderb_extension/libuv/AUTHORS +11 -1
- data/ext/noderb_extension/libuv/LICENSE +0 -8
- data/ext/noderb_extension/libuv/Makefile +5 -5
- data/ext/noderb_extension/libuv/README +11 -6
- data/ext/noderb_extension/libuv/common.gypi +158 -7
- data/ext/noderb_extension/libuv/config-unix.mk +34 -26
- data/ext/noderb_extension/libuv/gyp_uv +22 -4
- data/ext/noderb_extension/libuv/include/{eio.h → uv-private/eio.h} +2 -2
- data/ext/noderb_extension/libuv/include/{uv-unix.h → uv-private/uv-unix.h} +40 -0
- data/ext/noderb_extension/libuv/include/{uv-win.h → uv-private/uv-win.h} +96 -14
- data/ext/noderb_extension/libuv/include/uv.h +508 -83
- data/ext/noderb_extension/libuv/src/unix/cares.c +185 -0
- data/ext/noderb_extension/libuv/src/unix/core.c +828 -0
- data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_darwin.h +4 -0
- data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_linux.h +5 -15
- data/ext/noderb_extension/libuv/src/{eio → unix/eio}/eio.c +23 -2
- data/ext/noderb_extension/libuv/src/unix/error.c +102 -0
- data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_linux.h +26 -15
- data/ext/noderb_extension/libuv/src/unix/fs.c +562 -0
- data/ext/noderb_extension/libuv/src/unix/internal.h +75 -0
- data/ext/noderb_extension/libuv/src/unix/pipe.c +282 -0
- data/ext/noderb_extension/libuv/src/unix/process.c +287 -0
- data/ext/noderb_extension/libuv/src/unix/stream.c +727 -0
- data/ext/noderb_extension/libuv/src/unix/tcp.c +226 -0
- data/ext/noderb_extension/libuv/src/unix/udp.c +524 -0
- data/ext/noderb_extension/libuv/src/{uv-eio.c → unix/uv-eio.c} +48 -27
- data/ext/noderb_extension/libuv/src/{uv-eio.h → unix/uv-eio.h} +1 -1
- data/ext/noderb_extension/libuv/src/uv-common.c +24 -14
- data/ext/noderb_extension/libuv/src/uv-common.h +12 -7
- data/ext/noderb_extension/libuv/src/win/async.c +14 -16
- data/ext/noderb_extension/libuv/src/win/cares.c +64 -79
- data/ext/noderb_extension/libuv/src/win/core.c +105 -53
- data/ext/noderb_extension/libuv/src/win/error.c +23 -13
- data/ext/noderb_extension/libuv/src/win/fs.c +807 -0
- data/ext/noderb_extension/libuv/src/win/getaddrinfo.c +61 -41
- data/ext/noderb_extension/libuv/src/win/handle.c +56 -30
- data/ext/noderb_extension/libuv/src/win/internal.h +134 -95
- data/ext/noderb_extension/libuv/src/win/loop-watcher.c +21 -18
- data/ext/noderb_extension/libuv/src/win/pipe.c +313 -158
- data/ext/noderb_extension/libuv/src/win/process.c +117 -131
- data/ext/noderb_extension/libuv/src/win/req.c +55 -31
- data/ext/noderb_extension/libuv/src/win/stdio.c +5 -5
- data/ext/noderb_extension/libuv/src/win/stream.c +19 -14
- data/ext/noderb_extension/libuv/src/win/tcp.c +278 -336
- data/ext/noderb_extension/libuv/src/win/threadpool.c +73 -0
- data/ext/noderb_extension/libuv/src/win/timer.c +44 -37
- data/ext/noderb_extension/libuv/src/win/udp.c +592 -0
- data/ext/noderb_extension/libuv/src/win/util.c +20 -6
- data/ext/noderb_extension/libuv/src/win/winapi.c +23 -6
- data/ext/noderb_extension/libuv/src/win/winapi.h +4206 -0
- data/ext/noderb_extension/libuv/src/win/winsock.c +270 -0
- data/ext/noderb_extension/libuv/src/win/winsock.h +134 -0
- data/ext/noderb_extension/libuv/test/benchmark-ares.c +10 -6
- data/ext/noderb_extension/libuv/test/benchmark-getaddrinfo.c +10 -7
- data/ext/noderb_extension/libuv/test/benchmark-list.h +21 -0
- data/ext/noderb_extension/libuv/test/benchmark-ping-pongs.c +11 -7
- data/ext/noderb_extension/libuv/test/benchmark-pound.c +147 -58
- data/ext/noderb_extension/libuv/test/benchmark-pump.c +29 -23
- data/ext/noderb_extension/libuv/test/benchmark-spawn.c +13 -10
- data/ext/noderb_extension/libuv/test/benchmark-udp-packet-storm.c +250 -0
- data/ext/noderb_extension/libuv/test/dns-server.c +11 -6
- data/ext/noderb_extension/libuv/test/echo-server.c +30 -22
- data/ext/noderb_extension/libuv/test/test-async.c +3 -3
- data/ext/noderb_extension/libuv/test/test-callback-stack.c +6 -6
- data/ext/noderb_extension/libuv/test/test-connection-fail.c +6 -5
- data/ext/noderb_extension/libuv/test/test-delayed-accept.c +13 -13
- data/ext/noderb_extension/libuv/test/test-fs.c +715 -0
- data/ext/noderb_extension/libuv/test/test-getaddrinfo.c +11 -8
- data/ext/noderb_extension/libuv/test/test-gethostbyname.c +8 -9
- data/ext/noderb_extension/libuv/test/test-getsockname.c +142 -16
- data/ext/noderb_extension/libuv/test/test-idle.c +4 -3
- data/ext/noderb_extension/libuv/test/test-list.h +29 -2
- data/ext/noderb_extension/libuv/test/test-loop-handles.c +9 -8
- data/ext/noderb_extension/libuv/test/test-ping-pong.c +9 -9
- data/ext/noderb_extension/libuv/test/test-pipe-bind-error.c +18 -14
- data/ext/noderb_extension/libuv/test/test-ref.c +17 -16
- data/ext/noderb_extension/libuv/test/test-shutdown-eof.c +5 -5
- data/ext/noderb_extension/libuv/test/test-spawn.c +17 -17
- data/ext/noderb_extension/libuv/test/test-tcp-bind-error.c +24 -18
- data/ext/noderb_extension/libuv/test/test-tcp-bind6-error.c +19 -14
- data/ext/noderb_extension/libuv/test/test-tcp-writealot.c +6 -5
- data/ext/noderb_extension/libuv/test/test-threadpool.c +59 -0
- data/ext/noderb_extension/libuv/test/test-timer-again.c +15 -12
- data/ext/noderb_extension/libuv/test/test-timer.c +8 -8
- data/ext/noderb_extension/libuv/test/test-udp-dgram-too-big.c +88 -0
- data/ext/noderb_extension/libuv/test/test-udp-ipv6.c +158 -0
- data/ext/noderb_extension/libuv/test/test-udp-send-and-recv.c +210 -0
- data/ext/noderb_extension/libuv/{all.gyp → uv.gyp} +75 -77
- data/ext/noderb_extension/libuv/vcbuild.bat +93 -0
- data/ext/noderb_extension/noderb.c +13 -0
- data/ext/noderb_extension/noderb_common.h +2 -1
- data/ext/noderb_extension/noderb_defer.c +54 -0
- data/ext/noderb_extension/noderb_defer.h +15 -0
- data/ext/noderb_extension/noderb_dns.c +1 -1
- data/ext/noderb_extension/noderb_fs.c +277 -0
- data/ext/noderb_extension/noderb_fs.h +27 -0
- data/ext/noderb_extension/noderb_process.c +5 -5
- data/ext/noderb_extension/noderb_tcp.c +10 -6
- data/ext/noderb_extension/noderb_timers.c +1 -1
- data/ext/noderb_extension/noderb_tools.c +42 -8
- data/ext/noderb_extension/noderb_tools.h +3 -1
- data/lib/noderb/defer.rb +25 -0
- data/lib/noderb/file.rb +119 -0
- data/lib/noderb/fs.rb +72 -0
- data/lib/noderb/version.rb +1 -1
- data/lib/noderb.rb +8 -0
- metadata +102 -266
- data/ext/noderb_extension/libuv/BSDmakefile +0 -2
- data/ext/noderb_extension/libuv/create-msvs-files.bat +0 -21
- data/ext/noderb_extension/libuv/deps/pthread-win32/ANNOUNCE +0 -482
- data/ext/noderb_extension/libuv/deps/pthread-win32/BUGS +0 -141
- data/ext/noderb_extension/libuv/deps/pthread-win32/Bmakefile +0 -268
- data/ext/noderb_extension/libuv/deps/pthread-win32/CONTRIBUTORS +0 -140
- data/ext/noderb_extension/libuv/deps/pthread-win32/COPYING +0 -150
- data/ext/noderb_extension/libuv/deps/pthread-win32/COPYING.LIB +0 -504
- data/ext/noderb_extension/libuv/deps/pthread-win32/ChangeLog +0 -5194
- data/ext/noderb_extension/libuv/deps/pthread-win32/FAQ +0 -451
- data/ext/noderb_extension/libuv/deps/pthread-win32/GNUmakefile +0 -593
- data/ext/noderb_extension/libuv/deps/pthread-win32/MAINTAINERS +0 -4
- data/ext/noderb_extension/libuv/deps/pthread-win32/Makefile +0 -516
- data/ext/noderb_extension/libuv/deps/pthread-win32/NEWS +0 -1245
- data/ext/noderb_extension/libuv/deps/pthread-win32/Nmakefile +0 -24
- data/ext/noderb_extension/libuv/deps/pthread-win32/Nmakefile.tests +0 -260
- data/ext/noderb_extension/libuv/deps/pthread-win32/PROGRESS +0 -4
- data/ext/noderb_extension/libuv/deps/pthread-win32/README +0 -601
- data/ext/noderb_extension/libuv/deps/pthread-win32/README.Borland +0 -57
- data/ext/noderb_extension/libuv/deps/pthread-win32/README.CV +0 -3036
- data/ext/noderb_extension/libuv/deps/pthread-win32/README.NONPORTABLE +0 -783
- data/ext/noderb_extension/libuv/deps/pthread-win32/README.Watcom +0 -62
- data/ext/noderb_extension/libuv/deps/pthread-win32/README.WinCE +0 -6
- data/ext/noderb_extension/libuv/deps/pthread-win32/TODO +0 -7
- data/ext/noderb_extension/libuv/deps/pthread-win32/WinCE-PORT +0 -222
- data/ext/noderb_extension/libuv/deps/pthread-win32/attr.c +0 -53
- data/ext/noderb_extension/libuv/deps/pthread-win32/autostatic.c +0 -69
- data/ext/noderb_extension/libuv/deps/pthread-win32/barrier.c +0 -47
- data/ext/noderb_extension/libuv/deps/pthread-win32/build/all.gyp +0 -207
- data/ext/noderb_extension/libuv/deps/pthread-win32/builddmc.bat +0 -9
- data/ext/noderb_extension/libuv/deps/pthread-win32/cancel.c +0 -44
- data/ext/noderb_extension/libuv/deps/pthread-win32/cleanup.c +0 -148
- data/ext/noderb_extension/libuv/deps/pthread-win32/condvar.c +0 -50
- data/ext/noderb_extension/libuv/deps/pthread-win32/config.h +0 -153
- data/ext/noderb_extension/libuv/deps/pthread-win32/context.h +0 -74
- data/ext/noderb_extension/libuv/deps/pthread-win32/create.c +0 -308
- data/ext/noderb_extension/libuv/deps/pthread-win32/dll.c +0 -92
- data/ext/noderb_extension/libuv/deps/pthread-win32/errno.c +0 -94
- data/ext/noderb_extension/libuv/deps/pthread-win32/exit.c +0 -44
- data/ext/noderb_extension/libuv/deps/pthread-win32/fork.c +0 -39
- data/ext/noderb_extension/libuv/deps/pthread-win32/global.c +0 -107
- data/ext/noderb_extension/libuv/deps/pthread-win32/implement.h +0 -944
- data/ext/noderb_extension/libuv/deps/pthread-win32/misc.c +0 -50
- data/ext/noderb_extension/libuv/deps/pthread-win32/mutex.c +0 -62
- data/ext/noderb_extension/libuv/deps/pthread-win32/need_errno.h +0 -145
- data/ext/noderb_extension/libuv/deps/pthread-win32/nonportable.c +0 -47
- data/ext/noderb_extension/libuv/deps/pthread-win32/private.c +0 -54
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.c +0 -66
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.dsp +0 -142
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.dsw +0 -29
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.h +0 -1368
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_destroy.c +0 -79
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getdetachstate.c +0 -86
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getinheritsched.c +0 -51
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getschedparam.c +0 -52
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getschedpolicy.c +0 -61
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getscope.c +0 -54
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getstackaddr.c +0 -97
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getstacksize.c +0 -100
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_init.c +0 -117
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setdetachstate.c +0 -91
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setinheritsched.c +0 -57
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setschedparam.c +0 -63
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setschedpolicy.c +0 -55
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setscope.c +0 -62
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setstackaddr.c +0 -97
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setstacksize.c +0 -110
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrier_destroy.c +0 -103
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrier_init.c +0 -69
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrier_wait.c +0 -104
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_destroy.c +0 -83
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_getpshared.c +0 -95
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_init.c +0 -85
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_setpshared.c +0 -119
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cancel.c +0 -189
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_destroy.c +0 -253
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_init.c +0 -167
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_signal.c +0 -231
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_wait.c +0 -567
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_destroy.c +0 -86
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_getpshared.c +0 -97
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_init.c +0 -87
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_setpshared.c +0 -117
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_delay_np.c +0 -172
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_detach.c +0 -136
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_equal.c +0 -76
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_exit.c +0 -106
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getconcurrency.c +0 -45
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getschedparam.c +0 -75
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getspecific.c +0 -87
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getunique_np.c +0 -47
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getw32threadhandle_np.c +0 -65
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_join.c +0 -157
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_key_create.c +0 -108
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_key_delete.c +0 -125
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_kill.c +0 -105
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_consistent.c +0 -187
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_destroy.c +0 -148
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_init.c +0 -130
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_lock.c +0 -269
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_timedlock.c +0 -324
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_trylock.c +0 -154
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_unlock.c +0 -175
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_destroy.c +0 -83
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_getkind_np.c +0 -44
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_getpshared.c +0 -95
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_getrobust.c +0 -113
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_gettype.c +0 -56
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_init.c +0 -86
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_setkind_np.c +0 -44
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_setpshared.c +0 -119
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_setrobust.c +0 -119
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_settype.c +0 -143
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_num_processors_np.c +0 -56
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_once.c +0 -79
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_destroy.c +0 -143
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_init.c +0 -109
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_rdlock.c +0 -102
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_timedrdlock.c +0 -109
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_timedwrlock.c +0 -139
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_tryrdlock.c +0 -102
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_trywrlock.c +0 -122
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_unlock.c +0 -93
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_wrlock.c +0 -133
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_destroy.c +0 -84
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_getpshared.c +0 -97
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_init.c +0 -83
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_setpshared.c +0 -120
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_self.c +0 -141
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setcancelstate.c +0 -125
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setcanceltype.c +0 -126
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setconcurrency.c +0 -53
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setschedparam.c +0 -123
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setspecific.c +0 -167
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_destroy.c +0 -111
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_init.c +0 -123
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_lock.c +0 -80
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_trylock.c +0 -77
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_unlock.c +0 -71
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_testcancel.c +0 -103
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_timechange_handler_np.c +0 -108
- data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_win32_attach_detach_np.c +0 -258
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_MCS_lock.c +0 -278
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_callUserDestroyRoutines.c +0 -232
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_calloc.c +0 -56
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_cond_check_need_init.c +0 -78
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_getprocessors.c +0 -91
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_is_attr.c +0 -47
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_mutex_check_need_init.c +0 -92
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_new.c +0 -94
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_processInitialize.c +0 -92
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_processTerminate.c +0 -105
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_relmillisecs.c +0 -132
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_reuse.c +0 -151
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_rwlock_cancelwrwait.c +0 -50
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_rwlock_check_need_init.c +0 -77
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_semwait.c +0 -135
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_spinlock_check_need_init.c +0 -78
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_threadDestroy.c +0 -79
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_threadStart.c +0 -357
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_throw.c +0 -189
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_timespec.c +0 -83
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_tkAssocCreate.c +0 -118
- data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_tkAssocDestroy.c +0 -114
- data/ext/noderb_extension/libuv/deps/pthread-win32/rwlock.c +0 -51
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched.c +0 -53
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched.h +0 -183
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched_get_priority_max.c +0 -134
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched_get_priority_min.c +0 -135
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched_getscheduler.c +0 -71
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched_setscheduler.c +0 -83
- data/ext/noderb_extension/libuv/deps/pthread-win32/sched_yield.c +0 -71
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_close.c +0 -58
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_destroy.c +0 -144
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_getvalue.c +0 -110
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_init.c +0 -169
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_open.c +0 -58
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_post.c +0 -128
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_post_multiple.c +0 -142
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_timedwait.c +0 -238
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_trywait.c +0 -117
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_unlink.c +0 -58
- data/ext/noderb_extension/libuv/deps/pthread-win32/sem_wait.c +0 -187
- data/ext/noderb_extension/libuv/deps/pthread-win32/semaphore.c +0 -69
- data/ext/noderb_extension/libuv/deps/pthread-win32/semaphore.h +0 -169
- data/ext/noderb_extension/libuv/deps/pthread-win32/signal.c +0 -179
- data/ext/noderb_extension/libuv/deps/pthread-win32/spin.c +0 -46
- data/ext/noderb_extension/libuv/deps/pthread-win32/sync.c +0 -43
- data/ext/noderb_extension/libuv/deps/pthread-win32/tsd.c +0 -44
- data/ext/noderb_extension/libuv/deps/pthread-win32/version.rc +0 -388
- data/ext/noderb_extension/libuv/deps/pthread-win32/w32_CancelableWait.c +0 -161
- data/ext/noderb_extension/libuv/doc/iocp-links.html +0 -574
- data/ext/noderb_extension/libuv/src/uv-unix.c +0 -2421
- data/ext/noderb_extension/libuv/src/win/ntdll.h +0 -130
- /data/ext/noderb_extension/libuv/include/{ev.h → uv-private/ev.h} +0 -0
- /data/ext/noderb_extension/libuv/include/{ngx-queue.h → uv-private/ngx-queue.h} +0 -0
- /data/ext/noderb_extension/libuv/include/{tree.h → uv-private/tree.h} +0 -0
- /data/ext/noderb_extension/libuv/src/{uv-cygwin.c → unix/cygwin.c} +0 -0
- /data/ext/noderb_extension/libuv/src/{uv-darwin.c → unix/darwin.c} +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/Changes +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/LICENSE +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/Makefile.am +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/aclocal.m4 +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/autogen.sh +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config.h.in +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_cygwin.h +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_freebsd.h +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_sunos.h +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/configure.ac +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/demo.c +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/ecb.h +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/eio.3 +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/eio.pod +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/libeio.m4 +0 -0
- /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/xthread.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/Changes +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/LICENSE +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/Makefile.am +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/Makefile.in +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/README +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/aclocal.m4 +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/autogen.sh +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config.guess +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config.h.in +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config.sub +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_cygwin.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_darwin.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_freebsd.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_sunos.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/configure +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/configure.ac +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/depcomp +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev++.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev.3 +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev.pod +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_epoll.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_kqueue.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_poll.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_port.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_select.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_vars.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_win32.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_wrap.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/event.c +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/event.h +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/install-sh +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/libev.m4 +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ltmain.sh +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/missing +0 -0
- /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/mkinstalldirs +0 -0
- /data/ext/noderb_extension/libuv/src/{uv-freebsd.c → unix/freebsd.c} +0 -0
- /data/ext/noderb_extension/libuv/src/{uv-linux.c → unix/linux.c} +0 -0
- /data/ext/noderb_extension/libuv/src/{uv-sunos.c → unix/sunos.c} +0 -0
@@ -19,6 +19,8 @@
|
|
19
19
|
* IN THE SOFTWARE.
|
20
20
|
*/
|
21
21
|
|
22
|
+
/* See uv_loop_new for an introduction. */
|
23
|
+
|
22
24
|
#ifndef UV_H
|
23
25
|
#define UV_H
|
24
26
|
#ifdef __cplusplus
|
@@ -39,10 +41,13 @@ extern "C" {
|
|
39
41
|
typedef intptr_t ssize_t;
|
40
42
|
#endif
|
41
43
|
|
44
|
+
typedef struct uv_loop_s uv_loop_t;
|
45
|
+
typedef struct uv_ares_task_s uv_ares_task_t;
|
42
46
|
typedef struct uv_err_s uv_err_t;
|
43
47
|
typedef struct uv_handle_s uv_handle_t;
|
44
48
|
typedef struct uv_stream_s uv_stream_t;
|
45
49
|
typedef struct uv_tcp_s uv_tcp_t;
|
50
|
+
typedef struct uv_udp_s uv_udp_t;
|
46
51
|
typedef struct uv_pipe_s uv_pipe_t;
|
47
52
|
typedef struct uv_timer_s uv_timer_t;
|
48
53
|
typedef struct uv_prepare_s uv_prepare_t;
|
@@ -51,20 +56,60 @@ typedef struct uv_idle_s uv_idle_t;
|
|
51
56
|
typedef struct uv_async_s uv_async_t;
|
52
57
|
typedef struct uv_getaddrinfo_s uv_getaddrinfo_t;
|
53
58
|
typedef struct uv_process_s uv_process_t;
|
59
|
+
typedef struct uv_counters_s uv_counters_t;
|
54
60
|
/* Request types */
|
55
61
|
typedef struct uv_req_s uv_req_t;
|
56
62
|
typedef struct uv_shutdown_s uv_shutdown_t;
|
57
63
|
typedef struct uv_write_s uv_write_t;
|
58
64
|
typedef struct uv_connect_s uv_connect_t;
|
65
|
+
typedef struct uv_udp_send_s uv_udp_send_t;
|
66
|
+
typedef struct uv_fs_s uv_fs_t;
|
67
|
+
typedef struct uv_work_s uv_work_t;
|
59
68
|
|
60
69
|
#if defined(__unix__) || defined(__POSIX__) || defined(__APPLE__)
|
61
|
-
# include "uv-unix.h"
|
70
|
+
# include "uv-private/uv-unix.h"
|
62
71
|
#else
|
63
|
-
# include "uv-win.h"
|
72
|
+
# include "uv-private/uv-win.h"
|
64
73
|
#endif
|
65
74
|
|
66
75
|
|
67
|
-
/*
|
76
|
+
/*
|
77
|
+
* This function must be called before any other functions in libuv.
|
78
|
+
*
|
79
|
+
* All functions besides uv_run() are non-blocking.
|
80
|
+
*
|
81
|
+
* All callbacks in libuv are made asynchronously. That is they are never
|
82
|
+
* made by the function that takes them as a parameter.
|
83
|
+
*/
|
84
|
+
void uv_init();
|
85
|
+
uv_loop_t* uv_loop_new();
|
86
|
+
|
87
|
+
void uv_loop_delete(uv_loop_t*);
|
88
|
+
|
89
|
+
/*
|
90
|
+
* Returns the default loop.
|
91
|
+
*/
|
92
|
+
uv_loop_t* uv_default_loop();
|
93
|
+
|
94
|
+
/*
|
95
|
+
* This function starts the event loop. It blocks until the reference count
|
96
|
+
* of the loop drops to zero.
|
97
|
+
*/
|
98
|
+
int uv_run(uv_loop_t*);
|
99
|
+
|
100
|
+
/*
|
101
|
+
* Manually modify the event loop's reference count. Useful if the user wants
|
102
|
+
* to have a handle or timeout that doesn't keep the loop alive.
|
103
|
+
*/
|
104
|
+
void uv_ref(uv_loop_t*);
|
105
|
+
void uv_unref(uv_loop_t*);
|
106
|
+
|
107
|
+
void uv_update_time(uv_loop_t*);
|
108
|
+
int64_t uv_now(uv_loop_t*);
|
109
|
+
|
110
|
+
|
111
|
+
/*
|
112
|
+
* The status parameter is 0 if the request completed successfully,
|
68
113
|
* and should be -1 if the request was cancelled or failed.
|
69
114
|
* For uv_close_cb, -1 means that the handle was closed due to an error.
|
70
115
|
* Error details can be obtained by calling uv_last_error().
|
@@ -72,8 +117,8 @@ typedef struct uv_connect_s uv_connect_t;
|
|
72
117
|
* In the case of uv_read_cb the uv_buf_t returned should be freed by the
|
73
118
|
* user.
|
74
119
|
*/
|
75
|
-
typedef uv_buf_t (*uv_alloc_cb)(
|
76
|
-
typedef void (*uv_read_cb)(uv_stream_t*
|
120
|
+
typedef uv_buf_t (*uv_alloc_cb)(uv_handle_t* handle, size_t suggested_size);
|
121
|
+
typedef void (*uv_read_cb)(uv_stream_t* stream, ssize_t nread, uv_buf_t buf);
|
77
122
|
typedef void (*uv_write_cb)(uv_write_t* req, int status);
|
78
123
|
typedef void (*uv_connect_cb)(uv_connect_t* req, int status);
|
79
124
|
typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status);
|
@@ -85,8 +130,12 @@ typedef void (*uv_async_cb)(uv_async_t* handle, int status);
|
|
85
130
|
typedef void (*uv_prepare_cb)(uv_prepare_t* handle, int status);
|
86
131
|
typedef void (*uv_check_cb)(uv_check_t* handle, int status);
|
87
132
|
typedef void (*uv_idle_cb)(uv_idle_t* handle, int status);
|
88
|
-
typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* handle, int status,
|
133
|
+
typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* handle, int status,
|
134
|
+
struct addrinfo* res);
|
89
135
|
typedef void (*uv_exit_cb)(uv_process_t*, int exit_status, int term_signal);
|
136
|
+
typedef void (*uv_fs_cb)(uv_fs_t* req);
|
137
|
+
typedef void (*uv_work_cb)(uv_work_t* req);
|
138
|
+
typedef void (*uv_after_work_cb)(uv_work_t* req);
|
90
139
|
|
91
140
|
|
92
141
|
/* Expand this list if necessary. */
|
@@ -112,6 +161,7 @@ typedef enum {
|
|
112
161
|
UV_EINVAL,
|
113
162
|
UV_EISCONN,
|
114
163
|
UV_EMFILE,
|
164
|
+
UV_EMSGSIZE,
|
115
165
|
UV_ENETDOWN,
|
116
166
|
UV_ENETUNREACH,
|
117
167
|
UV_ENFILE,
|
@@ -138,6 +188,7 @@ typedef enum {
|
|
138
188
|
typedef enum {
|
139
189
|
UV_UNKNOWN_HANDLE = 0,
|
140
190
|
UV_TCP,
|
191
|
+
UV_UDP,
|
141
192
|
UV_NAMED_PIPE,
|
142
193
|
UV_TTY,
|
143
194
|
UV_FILE,
|
@@ -160,6 +211,9 @@ typedef enum {
|
|
160
211
|
UV_WRITE,
|
161
212
|
UV_SHUTDOWN,
|
162
213
|
UV_WAKEUP,
|
214
|
+
UV_UDP_SEND,
|
215
|
+
UV_FS,
|
216
|
+
UV_WORK,
|
163
217
|
UV_REQ_TYPE_PRIVATE
|
164
218
|
} uv_req_type;
|
165
219
|
|
@@ -172,6 +226,16 @@ struct uv_err_s {
|
|
172
226
|
};
|
173
227
|
|
174
228
|
|
229
|
+
/*
|
230
|
+
* Most functions return boolean: 0 for success and -1 for failure.
|
231
|
+
* On error the user should then call uv_last_error() to determine
|
232
|
+
* the error code.
|
233
|
+
*/
|
234
|
+
uv_err_t uv_last_error(uv_loop_t*);
|
235
|
+
char* uv_strerror(uv_err_t err);
|
236
|
+
const char* uv_err_name(uv_err_t err);
|
237
|
+
|
238
|
+
|
175
239
|
#define UV_REQ_FIELDS \
|
176
240
|
/* read-only */ \
|
177
241
|
uv_req_type type; \
|
@@ -191,11 +255,15 @@ UV_PRIVATE_REQ_TYPES
|
|
191
255
|
|
192
256
|
|
193
257
|
/*
|
258
|
+
* uv_shutdown_t is a subclass of uv_req_t
|
259
|
+
*
|
194
260
|
* Shutdown the outgoing (write) side of a duplex stream. It waits for
|
195
261
|
* pending write requests to complete. The handle should refer to a
|
196
262
|
* initialized stream. req should be an uninitalized shutdown request
|
197
263
|
* struct. The cb is a called after shutdown is complete.
|
198
264
|
*/
|
265
|
+
int uv_shutdown(uv_shutdown_t* req, uv_stream_t* handle, uv_shutdown_cb cb);
|
266
|
+
|
199
267
|
struct uv_shutdown_s {
|
200
268
|
UV_REQ_FIELDS
|
201
269
|
uv_stream_t* handle;
|
@@ -203,11 +271,10 @@ struct uv_shutdown_s {
|
|
203
271
|
UV_SHUTDOWN_PRIVATE_FIELDS
|
204
272
|
};
|
205
273
|
|
206
|
-
int uv_shutdown(uv_shutdown_t* req, uv_stream_t* handle, uv_shutdown_cb cb);
|
207
|
-
|
208
274
|
|
209
275
|
#define UV_HANDLE_FIELDS \
|
210
276
|
/* read-only */ \
|
277
|
+
uv_loop_t* loop; \
|
211
278
|
uv_handle_type type; \
|
212
279
|
/* public */ \
|
213
280
|
uv_close_cb close_cb; \
|
@@ -237,13 +304,29 @@ int uv_is_active(uv_handle_t* handle);
|
|
237
304
|
void uv_close(uv_handle_t* handle, uv_close_cb close_cb);
|
238
305
|
|
239
306
|
|
307
|
+
/*
|
308
|
+
* Constructor for uv_buf_t.
|
309
|
+
* Due to platform differences the user cannot rely on the ordering of the
|
310
|
+
* base and len members of the uv_buf_t struct. The user is responsible for
|
311
|
+
* freeing base after the uv_buf_t is done. Return struct passed by value.
|
312
|
+
*/
|
313
|
+
uv_buf_t uv_buf_init(char* base, size_t len);
|
314
|
+
|
315
|
+
|
240
316
|
#define UV_STREAM_FIELDS \
|
241
317
|
/* number of bytes queued for writing */ \
|
242
318
|
size_t write_queue_size; \
|
243
319
|
/* private */ \
|
244
320
|
UV_STREAM_PRIVATE_FIELDS
|
245
321
|
|
246
|
-
/*
|
322
|
+
/*
|
323
|
+
* uv_stream_t is a subclass of uv_handle_t
|
324
|
+
*
|
325
|
+
* uv_stream is an abstract class.
|
326
|
+
*
|
327
|
+
* uv_stream_t is the parent class of uv_tcp_t, uv_pipe_t
|
328
|
+
* and soon uv_file_t.
|
329
|
+
*/
|
247
330
|
struct uv_stream_s {
|
248
331
|
UV_HANDLE_FIELDS
|
249
332
|
UV_STREAM_FIELDS
|
@@ -251,7 +334,8 @@ struct uv_stream_s {
|
|
251
334
|
|
252
335
|
int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb);
|
253
336
|
|
254
|
-
/*
|
337
|
+
/*
|
338
|
+
* This call is used in conjunction with uv_listen() to accept incoming
|
255
339
|
* connections. Call uv_accept after receiving a uv_connection_cb to accept
|
256
340
|
* the connection. Before calling uv_accept use uv_*_init() must be
|
257
341
|
* called on the client. Non-zero return value indicates an error.
|
@@ -263,7 +347,8 @@ int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb);
|
|
263
347
|
*/
|
264
348
|
int uv_accept(uv_stream_t* server, uv_stream_t* client);
|
265
349
|
|
266
|
-
/*
|
350
|
+
/*
|
351
|
+
* Read data from an incoming stream. The callback will be made several
|
267
352
|
* several times until there is no more data to read or uv_read_stop is
|
268
353
|
* called. When we've reached EOF nread will be set to -1 and the error is
|
269
354
|
* set to UV_EOF. When nread == -1 the buf parameter might not point to a
|
@@ -282,7 +367,7 @@ typedef enum {
|
|
282
367
|
UV_STDERR
|
283
368
|
} uv_std_type;
|
284
369
|
|
285
|
-
uv_stream_t* uv_std_handle(uv_std_type type);
|
370
|
+
uv_stream_t* uv_std_handle(uv_loop_t*, uv_std_type type);
|
286
371
|
|
287
372
|
/*
|
288
373
|
* Write data to stream. Buffers are written in order. Example:
|
@@ -298,10 +383,14 @@ uv_stream_t* uv_std_handle(uv_std_type type);
|
|
298
383
|
* };
|
299
384
|
*
|
300
385
|
* // writes "1234"
|
301
|
-
* uv_write(req, a, 2);
|
302
|
-
* uv_write(req, b, 2);
|
386
|
+
* uv_write(req, stream, a, 2);
|
387
|
+
* uv_write(req, stream, b, 2);
|
303
388
|
*
|
304
389
|
*/
|
390
|
+
int uv_write(uv_write_t* req, uv_stream_t* handle, uv_buf_t bufs[], int bufcnt,
|
391
|
+
uv_write_cb cb);
|
392
|
+
|
393
|
+
/* uv_write_t is a subclass of uv_req_t */
|
305
394
|
struct uv_write_s {
|
306
395
|
UV_REQ_FIELDS
|
307
396
|
uv_write_cb cb;
|
@@ -309,14 +398,12 @@ struct uv_write_s {
|
|
309
398
|
UV_WRITE_PRIVATE_FIELDS
|
310
399
|
};
|
311
400
|
|
312
|
-
int uv_write(uv_write_t* req, uv_stream_t* handle, uv_buf_t bufs[], int bufcnt,
|
313
|
-
uv_write_cb cb);
|
314
401
|
|
315
402
|
|
316
403
|
/*
|
317
|
-
*
|
318
|
-
*
|
319
|
-
*
|
404
|
+
* uv_tcp_t is a subclass of uv_stream_t
|
405
|
+
*
|
406
|
+
* Represents a TCP stream or TCP server.
|
320
407
|
*/
|
321
408
|
struct uv_tcp_s {
|
322
409
|
UV_HANDLE_FIELDS
|
@@ -324,7 +411,7 @@ struct uv_tcp_s {
|
|
324
411
|
UV_TCP_PRIVATE_FIELDS
|
325
412
|
};
|
326
413
|
|
327
|
-
int uv_tcp_init(uv_tcp_t* handle);
|
414
|
+
int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle);
|
328
415
|
|
329
416
|
int uv_tcp_bind(uv_tcp_t* handle, struct sockaddr_in);
|
330
417
|
int uv_tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6);
|
@@ -335,6 +422,12 @@ int uv_tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6);
|
|
335
422
|
* initialized TCP handle and an uninitialized uv_connect_t*. The callback
|
336
423
|
* will be made when the connection is estabished.
|
337
424
|
*/
|
425
|
+
int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle,
|
426
|
+
struct sockaddr_in address, uv_connect_cb cb);
|
427
|
+
int uv_tcp_connect6(uv_connect_t* req, uv_tcp_t* handle,
|
428
|
+
struct sockaddr_in6 address, uv_connect_cb cb);
|
429
|
+
|
430
|
+
/* uv_connect_t is a subclass of uv_req_t */
|
338
431
|
struct uv_connect_s {
|
339
432
|
UV_REQ_FIELDS
|
340
433
|
uv_connect_cb cb;
|
@@ -342,16 +435,163 @@ struct uv_connect_s {
|
|
342
435
|
UV_CONNECT_PRIVATE_FIELDS
|
343
436
|
};
|
344
437
|
|
345
|
-
int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle,
|
346
|
-
struct sockaddr_in address, uv_connect_cb cb);
|
347
|
-
int uv_tcp_connect6(uv_connect_t* req, uv_tcp_t* handle,
|
348
|
-
struct sockaddr_in6 address, uv_connect_cb cb);
|
349
438
|
|
350
|
-
int uv_getsockname(
|
439
|
+
int uv_getsockname(uv_handle_t* handle, struct sockaddr* name, int* namelen);
|
440
|
+
|
441
|
+
|
442
|
+
/*
|
443
|
+
* UDP support.
|
444
|
+
*/
|
445
|
+
|
446
|
+
enum uv_udp_flags {
|
447
|
+
/* Disables dual stack mode. Used with uv_udp_bind6(). */
|
448
|
+
UV_UDP_IPV6ONLY = 1,
|
449
|
+
/*
|
450
|
+
* Indicates message was truncated because read buffer was too small. The
|
451
|
+
* remainder was discarded by the OS. Used in uv_udp_recv_cb.
|
452
|
+
*/
|
453
|
+
UV_UDP_PARTIAL = 2
|
454
|
+
};
|
455
|
+
|
456
|
+
/*
|
457
|
+
* Called after a uv_udp_send() or uv_udp_send6(). status 0 indicates
|
458
|
+
* success otherwise error.
|
459
|
+
*/
|
460
|
+
typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
|
461
|
+
|
462
|
+
/*
|
463
|
+
* Callback that is invoked when a new UDP datagram is received.
|
464
|
+
*
|
465
|
+
* handle UDP handle.
|
466
|
+
* nread Number of bytes that have been received.
|
467
|
+
* 0 if there is no more data to read. You may
|
468
|
+
* discard or repurpose the read buffer.
|
469
|
+
* -1 if a transmission error was detected.
|
470
|
+
* buf uv_buf_t with the received data.
|
471
|
+
* addr struct sockaddr_in or struct sockaddr_in6.
|
472
|
+
* Valid for the duration of the callback only.
|
473
|
+
* flags One or more OR'ed UV_UDP_* constants.
|
474
|
+
* Right now only UV_UDP_PARTIAL is used.
|
475
|
+
*/
|
476
|
+
typedef void (*uv_udp_recv_cb)(uv_udp_t* handle, ssize_t nread, uv_buf_t buf,
|
477
|
+
struct sockaddr* addr, unsigned flags);
|
478
|
+
|
479
|
+
/* uv_udp_t is a subclass of uv_handle_t */
|
480
|
+
struct uv_udp_s {
|
481
|
+
UV_HANDLE_FIELDS
|
482
|
+
UV_UDP_PRIVATE_FIELDS
|
483
|
+
};
|
484
|
+
|
485
|
+
/* uv_udp_send_t is a subclass of uv_req_t */
|
486
|
+
struct uv_udp_send_s {
|
487
|
+
UV_REQ_FIELDS
|
488
|
+
uv_udp_t* handle;
|
489
|
+
uv_udp_send_cb cb;
|
490
|
+
UV_UDP_SEND_PRIVATE_FIELDS
|
491
|
+
};
|
492
|
+
|
493
|
+
/*
|
494
|
+
* Initialize a new UDP handle. The actual socket is created lazily.
|
495
|
+
* Returns 0 on success.
|
496
|
+
*/
|
497
|
+
int uv_udp_init(uv_loop_t*, uv_udp_t* handle);
|
498
|
+
|
499
|
+
/*
|
500
|
+
* Bind to a IPv4 address and port.
|
501
|
+
*
|
502
|
+
* Arguments:
|
503
|
+
* handle UDP handle. Should have been initialized with `uv_udp_init`.
|
504
|
+
* addr struct sockaddr_in with the address and port to bind to.
|
505
|
+
* flags Unused.
|
506
|
+
*
|
507
|
+
* Returns:
|
508
|
+
* 0 on success, -1 on error.
|
509
|
+
*/
|
510
|
+
int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr, unsigned flags);
|
511
|
+
|
512
|
+
/*
|
513
|
+
* Bind to a IPv6 address and port.
|
514
|
+
*
|
515
|
+
* Arguments:
|
516
|
+
* handle UDP handle. Should have been initialized with `uv_udp_init`.
|
517
|
+
* addr struct sockaddr_in with the address and port to bind to.
|
518
|
+
* flags Should be 0 or UV_UDP_IPV6ONLY.
|
519
|
+
*
|
520
|
+
* Returns:
|
521
|
+
* 0 on success, -1 on error.
|
522
|
+
*/
|
523
|
+
int uv_udp_bind6(uv_udp_t* handle, struct sockaddr_in6 addr, unsigned flags);
|
524
|
+
|
525
|
+
/*
|
526
|
+
* Send data. If the socket has not previously been bound with `uv_udp_bind`
|
527
|
+
* or `uv_udp_bind6`, it is bound to 0.0.0.0 (the "all interfaces" address)
|
528
|
+
* and a random port number.
|
529
|
+
*
|
530
|
+
* Arguments:
|
531
|
+
* req UDP request handle. Need not be initialized.
|
532
|
+
* handle UDP handle. Should have been initialized with `uv_udp_init`.
|
533
|
+
* bufs List of buffers to send.
|
534
|
+
* bufcnt Number of buffers in `bufs`.
|
535
|
+
* addr Address of the remote peer. See `uv_ip4_addr`.
|
536
|
+
* send_cb Callback to invoke when the data has been sent out.
|
537
|
+
*
|
538
|
+
* Returns:
|
539
|
+
* 0 on success, -1 on error.
|
540
|
+
*/
|
541
|
+
int uv_udp_send(uv_udp_send_t* req, uv_udp_t* handle, uv_buf_t bufs[],
|
542
|
+
int bufcnt, struct sockaddr_in addr, uv_udp_send_cb send_cb);
|
543
|
+
|
544
|
+
/*
|
545
|
+
* Send data. If the socket has not previously been bound with `uv_udp_bind6`,
|
546
|
+
* it is bound to ::0 (the "all interfaces" address) and a random port number.
|
547
|
+
*
|
548
|
+
* Arguments:
|
549
|
+
* req UDP request handle. Need not be initialized.
|
550
|
+
* handle UDP handle. Should have been initialized with `uv_udp_init`.
|
551
|
+
* bufs List of buffers to send.
|
552
|
+
* bufcnt Number of buffers in `bufs`.
|
553
|
+
* addr Address of the remote peer. See `uv_ip6_addr`.
|
554
|
+
* send_cb Callback to invoke when the data has been sent out.
|
555
|
+
*
|
556
|
+
* Returns:
|
557
|
+
* 0 on success, -1 on error.
|
558
|
+
*/
|
559
|
+
int uv_udp_send6(uv_udp_send_t* req, uv_udp_t* handle, uv_buf_t bufs[],
|
560
|
+
int bufcnt, struct sockaddr_in6 addr, uv_udp_send_cb send_cb);
|
561
|
+
|
562
|
+
/*
|
563
|
+
* Send data. If the socket has not previously been bound with `uv_udp_bind`
|
564
|
+
* or `uv_udp_bind6`, it is bound to 0.0.0.0 (the "all interfaces" address)
|
565
|
+
* and a random port number.
|
566
|
+
*
|
567
|
+
* Arguments:
|
568
|
+
* handle UDP handle. Should have been initialized with `uv_udp_init`.
|
569
|
+
* alloc_cb Callback to invoke when temporary storage is needed.
|
570
|
+
* recv_cb Callback to invoke with received data.
|
571
|
+
*
|
572
|
+
* Returns:
|
573
|
+
* 0 on success, -1 on error.
|
574
|
+
*/
|
575
|
+
int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
|
576
|
+
uv_udp_recv_cb recv_cb);
|
577
|
+
|
578
|
+
/*
|
579
|
+
* Stop listening for incoming datagrams.
|
580
|
+
*
|
581
|
+
* Arguments:
|
582
|
+
* handle UDP handle. Should have been initialized with `uv_udp_init`.
|
583
|
+
*
|
584
|
+
* Returns:
|
585
|
+
* 0 on success, -1 on error.
|
586
|
+
*/
|
587
|
+
int uv_udp_recv_stop(uv_udp_t* handle);
|
351
588
|
|
352
589
|
|
353
590
|
/*
|
354
|
-
*
|
591
|
+
* uv_pipe_t is a subclass of uv_stream_t
|
592
|
+
*
|
593
|
+
* Representing a pipe stream or pipe server. On Windows this is a Named
|
594
|
+
* Pipe. On Unix this is a UNIX domain socket.
|
355
595
|
*/
|
356
596
|
struct uv_pipe_s {
|
357
597
|
UV_HANDLE_FIELDS
|
@@ -359,7 +599,7 @@ struct uv_pipe_s {
|
|
359
599
|
UV_PIPE_PRIVATE_FIELDS
|
360
600
|
};
|
361
601
|
|
362
|
-
int uv_pipe_init(uv_pipe_t* handle);
|
602
|
+
int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle);
|
363
603
|
|
364
604
|
int uv_pipe_bind(uv_pipe_t* handle, const char* name);
|
365
605
|
|
@@ -368,16 +608,18 @@ int uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle,
|
|
368
608
|
|
369
609
|
|
370
610
|
/*
|
371
|
-
*
|
372
|
-
*
|
373
|
-
*
|
611
|
+
* uv_prepare_t is a subclass of uv_handle_t.
|
612
|
+
*
|
613
|
+
* libev wrapper. Every active prepare handle gets its callback called
|
614
|
+
* exactly once per loop iteration, just before the system blocks to wait
|
615
|
+
* for completed i/o.
|
374
616
|
*/
|
375
617
|
struct uv_prepare_s {
|
376
618
|
UV_HANDLE_FIELDS
|
377
619
|
UV_PREPARE_PRIVATE_FIELDS
|
378
620
|
};
|
379
621
|
|
380
|
-
int uv_prepare_init(uv_prepare_t* prepare);
|
622
|
+
int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare);
|
381
623
|
|
382
624
|
int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb);
|
383
625
|
|
@@ -385,16 +627,17 @@ int uv_prepare_stop(uv_prepare_t* prepare);
|
|
385
627
|
|
386
628
|
|
387
629
|
/*
|
388
|
-
*
|
389
|
-
*
|
390
|
-
*
|
630
|
+
* uv_check_t is a subclass of uv_handle_t.
|
631
|
+
*
|
632
|
+
* libev wrapper. Every active check handle gets its callback called exactly
|
633
|
+
* once per loop iteration, just after the system returns from blocking.
|
391
634
|
*/
|
392
635
|
struct uv_check_s {
|
393
636
|
UV_HANDLE_FIELDS
|
394
637
|
UV_CHECK_PRIVATE_FIELDS
|
395
638
|
};
|
396
639
|
|
397
|
-
int uv_check_init(uv_check_t* check);
|
640
|
+
int uv_check_init(uv_loop_t*, uv_check_t* check);
|
398
641
|
|
399
642
|
int uv_check_start(uv_check_t* check, uv_check_cb cb);
|
400
643
|
|
@@ -402,17 +645,19 @@ int uv_check_stop(uv_check_t* check);
|
|
402
645
|
|
403
646
|
|
404
647
|
/*
|
405
|
-
*
|
406
|
-
*
|
407
|
-
*
|
408
|
-
*
|
648
|
+
* uv_idle_t is a subclass of uv_handle_t.
|
649
|
+
*
|
650
|
+
* libev wrapper. Every active idle handle gets its callback called
|
651
|
+
* repeatedly until it is stopped. This happens after all other types of
|
652
|
+
* callbacks are processed. When there are multiple "idle" handles active,
|
653
|
+
* their callbacks are called in turn.
|
409
654
|
*/
|
410
655
|
struct uv_idle_s {
|
411
656
|
UV_HANDLE_FIELDS
|
412
657
|
UV_IDLE_PRIVATE_FIELDS
|
413
658
|
};
|
414
659
|
|
415
|
-
int uv_idle_init(uv_idle_t* idle);
|
660
|
+
int uv_idle_init(uv_loop_t*, uv_idle_t* idle);
|
416
661
|
|
417
662
|
int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb);
|
418
663
|
|
@@ -420,7 +665,9 @@ int uv_idle_stop(uv_idle_t* idle);
|
|
420
665
|
|
421
666
|
|
422
667
|
/*
|
423
|
-
*
|
668
|
+
* uv_async_t is a subclass of uv_handle_t.
|
669
|
+
*
|
670
|
+
* libev wrapper. uv_async_send wakes up the event
|
424
671
|
* loop and calls the async handle's callback There is no guarantee that
|
425
672
|
* every uv_async_send call leads to exactly one invocation of the callback;
|
426
673
|
* The only guarantee is that the callback function is called at least once
|
@@ -432,23 +679,31 @@ struct uv_async_s {
|
|
432
679
|
UV_ASYNC_PRIVATE_FIELDS
|
433
680
|
};
|
434
681
|
|
435
|
-
int uv_async_init(uv_async_t* async, uv_async_cb async_cb);
|
682
|
+
int uv_async_init(uv_loop_t*, uv_async_t* async, uv_async_cb async_cb);
|
436
683
|
|
684
|
+
/*
|
685
|
+
* This can be called from other threads to wake up a libuv thread.
|
686
|
+
*
|
687
|
+
* libuv is single threaded at the moment.
|
688
|
+
*/
|
437
689
|
int uv_async_send(uv_async_t* async);
|
438
690
|
|
439
691
|
|
440
692
|
/*
|
441
|
-
*
|
442
|
-
*
|
693
|
+
* uv_timer_t is a subclass of uv_handle_t.
|
694
|
+
*
|
695
|
+
* Wraps libev's ev_timer watcher. Used to get woken up at a specified time
|
696
|
+
* in the future.
|
443
697
|
*/
|
444
698
|
struct uv_timer_s {
|
445
699
|
UV_HANDLE_FIELDS
|
446
700
|
UV_TIMER_PRIVATE_FIELDS
|
447
701
|
};
|
448
702
|
|
449
|
-
int uv_timer_init(uv_timer_t* timer);
|
703
|
+
int uv_timer_init(uv_loop_t*, uv_timer_t* timer);
|
450
704
|
|
451
|
-
int uv_timer_start(uv_timer_t* timer, uv_timer_cb cb, int64_t timeout,
|
705
|
+
int uv_timer_start(uv_timer_t* timer, uv_timer_cb cb, int64_t timeout,
|
706
|
+
int64_t repeat);
|
452
707
|
|
453
708
|
int uv_timer_stop(uv_timer_t* timer);
|
454
709
|
|
@@ -471,15 +726,21 @@ int64_t uv_timer_get_repeat(uv_timer_t* timer);
|
|
471
726
|
|
472
727
|
|
473
728
|
/* c-ares integration initialize and terminate */
|
474
|
-
int uv_ares_init_options(
|
475
|
-
|
476
|
-
|
729
|
+
int uv_ares_init_options(uv_loop_t*,
|
730
|
+
ares_channel *channelptr,
|
731
|
+
struct ares_options *options,
|
732
|
+
int optmask);
|
477
733
|
|
478
|
-
|
734
|
+
/* TODO remove the loop argument from this function? */
|
735
|
+
void uv_ares_destroy(uv_loop_t*, ares_channel channel);
|
479
736
|
|
480
737
|
|
481
738
|
/*
|
482
|
-
*
|
739
|
+
* uv_getaddrinfo_t is a subclass of uv_handle_t
|
740
|
+
*
|
741
|
+
* TODO this should be a subclass of uv_req_t
|
742
|
+
*
|
743
|
+
* Request object for uv_getaddrinfo.
|
483
744
|
*/
|
484
745
|
struct uv_getaddrinfo_s {
|
485
746
|
UV_HANDLE_FIELDS
|
@@ -487,38 +748,61 @@ struct uv_getaddrinfo_s {
|
|
487
748
|
};
|
488
749
|
|
489
750
|
|
490
|
-
/*
|
491
|
-
*
|
492
|
-
*
|
493
|
-
*
|
494
|
-
*
|
495
|
-
*
|
751
|
+
/*
|
752
|
+
* Asynchronous getaddrinfo(3).
|
753
|
+
*
|
754
|
+
* Return code 0 means that request is accepted and callback will be called
|
755
|
+
* with result. Other return codes mean that there will not be a callback.
|
756
|
+
* Input arguments may be released after return from this call. Callback
|
757
|
+
* must not call freeaddrinfo.
|
496
758
|
*/
|
497
|
-
int uv_getaddrinfo(
|
759
|
+
int uv_getaddrinfo(uv_loop_t*,
|
760
|
+
uv_getaddrinfo_t* handle,
|
498
761
|
uv_getaddrinfo_cb getaddrinfo_cb,
|
499
762
|
const char* node,
|
500
763
|
const char* service,
|
501
764
|
const struct addrinfo* hints);
|
502
765
|
|
503
|
-
/*
|
504
|
-
* Child process. Subclass of uv_handle_t.
|
505
|
-
*/
|
766
|
+
/* uv_spawn() options */
|
506
767
|
typedef struct uv_process_options_s {
|
507
|
-
uv_exit_cb exit_cb;
|
508
|
-
const char* file;
|
768
|
+
uv_exit_cb exit_cb; /* Called after the process exits. */
|
769
|
+
const char* file; /* Path to program to execute. */
|
770
|
+
/*
|
771
|
+
* Command line arguments. args[0] should be the path to the program. On
|
772
|
+
* Windows this uses CreateProcess which concatinates the arguments into a
|
773
|
+
* string this can cause some strange errors. See the note at
|
774
|
+
* windows_verbatim_arguments.
|
775
|
+
*/
|
509
776
|
char** args;
|
777
|
+
/*
|
778
|
+
* This will be set as the environ variable in the subprocess. If this is
|
779
|
+
* NULL then the parents environ will be used.
|
780
|
+
*/
|
510
781
|
char** env;
|
782
|
+
/*
|
783
|
+
* If non-null this represents a directory the subprocess should execute
|
784
|
+
* in. Stands for current working directory.
|
785
|
+
*/
|
511
786
|
char* cwd;
|
787
|
+
|
788
|
+
/*
|
789
|
+
* TODO describe how this works.
|
790
|
+
*/
|
512
791
|
int windows_verbatim_arguments;
|
792
|
+
|
513
793
|
/*
|
514
794
|
* The user should supply pointers to initialized uv_pipe_t structs for
|
515
|
-
* stdio.
|
795
|
+
* stdio. This is used to to send or receive input from the subprocess.
|
796
|
+
* The user is reponsible for calling uv_close on them.
|
516
797
|
*/
|
517
798
|
uv_pipe_t* stdin_stream;
|
518
799
|
uv_pipe_t* stdout_stream;
|
519
800
|
uv_pipe_t* stderr_stream;
|
520
801
|
} uv_process_options_t;
|
521
802
|
|
803
|
+
/*
|
804
|
+
* uv_process_t is a subclass of uv_handle_t
|
805
|
+
*/
|
522
806
|
struct uv_process_s {
|
523
807
|
UV_HANDLE_FIELDS
|
524
808
|
uv_exit_cb exit_cb;
|
@@ -527,7 +811,7 @@ struct uv_process_s {
|
|
527
811
|
};
|
528
812
|
|
529
813
|
/* Initializes uv_process_t and starts the process. */
|
530
|
-
int uv_spawn(uv_process_t*, uv_process_options_t options);
|
814
|
+
int uv_spawn(uv_loop_t*, uv_process_t*, uv_process_options_t options);
|
531
815
|
|
532
816
|
/*
|
533
817
|
* Kills the process with the specified signal. The user must still
|
@@ -537,26 +821,147 @@ int uv_process_kill(uv_process_t*, int signum);
|
|
537
821
|
|
538
822
|
|
539
823
|
/*
|
540
|
-
*
|
541
|
-
* On error the user should then call uv_last_error() to determine
|
542
|
-
* the error code.
|
824
|
+
* uv_work_t is a subclass of uv_req_t
|
543
825
|
*/
|
544
|
-
|
545
|
-
|
546
|
-
|
826
|
+
struct uv_work_s {
|
827
|
+
UV_REQ_FIELDS
|
828
|
+
uv_loop_t* loop;
|
829
|
+
uv_work_cb work_cb;
|
830
|
+
uv_after_work_cb after_work_cb;
|
831
|
+
UV_WORK_PRIVATE_FIELDS
|
832
|
+
};
|
833
|
+
|
834
|
+
/* Queues a work request to execute asynchronously on the thread pool. */
|
835
|
+
int uv_queue_work(uv_loop_t* loop, uv_work_t* req, uv_work_cb work_cb,
|
836
|
+
uv_after_work_cb after_work_cb);
|
837
|
+
|
838
|
+
|
547
839
|
|
548
|
-
void uv_init();
|
549
|
-
int uv_run();
|
550
840
|
|
551
841
|
/*
|
552
|
-
*
|
553
|
-
*
|
842
|
+
* File System Methods.
|
843
|
+
*
|
844
|
+
* The uv_fs_* functions execute a blocking system call asynchronously (in a
|
845
|
+
* thread pool) and call the specified callback in the specified loop after
|
846
|
+
* completion. If the user gives NULL as the callback the blocking system
|
847
|
+
* call will be called synchronously. req should be a pointer to an
|
848
|
+
* uninitialized uv_fs_t object.
|
849
|
+
*
|
850
|
+
* uv_fs_req_cleanup() must be called after completion of the uv_fs_
|
851
|
+
* function to free any internal memory allocations associted with the
|
852
|
+
* request.
|
554
853
|
*/
|
555
|
-
void uv_ref();
|
556
|
-
void uv_unref();
|
557
854
|
|
558
|
-
|
559
|
-
|
855
|
+
typedef enum {
|
856
|
+
UV_FS_UNKNOWN = -1,
|
857
|
+
UV_FS_CUSTOM,
|
858
|
+
UV_FS_OPEN,
|
859
|
+
UV_FS_CLOSE,
|
860
|
+
UV_FS_READ,
|
861
|
+
UV_FS_WRITE,
|
862
|
+
UV_FS_SENDFILE,
|
863
|
+
UV_FS_STAT,
|
864
|
+
UV_FS_LSTAT,
|
865
|
+
UV_FS_FSTAT,
|
866
|
+
UV_FS_FTRUNCATE,
|
867
|
+
UV_FS_UTIME,
|
868
|
+
UV_FS_FUTIME,
|
869
|
+
UV_FS_CHMOD,
|
870
|
+
UV_FS_FCHMOD,
|
871
|
+
UV_FS_FSYNC,
|
872
|
+
UV_FS_FDATASYNC,
|
873
|
+
UV_FS_UNLINK,
|
874
|
+
UV_FS_RMDIR,
|
875
|
+
UV_FS_MKDIR,
|
876
|
+
UV_FS_RENAME,
|
877
|
+
UV_FS_READDIR,
|
878
|
+
UV_FS_LINK,
|
879
|
+
UV_FS_SYMLINK,
|
880
|
+
UV_FS_READLINK,
|
881
|
+
UV_FS_CHOWN,
|
882
|
+
UV_FS_FCHOWN
|
883
|
+
} uv_fs_type;
|
884
|
+
|
885
|
+
/* uv_fs_t is a subclass of uv_req_t */
|
886
|
+
struct uv_fs_s {
|
887
|
+
UV_REQ_FIELDS
|
888
|
+
uv_loop_t* loop;
|
889
|
+
uv_fs_type fs_type;
|
890
|
+
uv_fs_cb cb;
|
891
|
+
ssize_t result;
|
892
|
+
void* ptr;
|
893
|
+
int errorno;
|
894
|
+
UV_FS_PRIVATE_FIELDS
|
895
|
+
};
|
896
|
+
|
897
|
+
void uv_fs_req_cleanup(uv_fs_t* req);
|
898
|
+
|
899
|
+
int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb);
|
900
|
+
|
901
|
+
int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
|
902
|
+
int mode, uv_fs_cb cb);
|
903
|
+
|
904
|
+
int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file file, void* buf,
|
905
|
+
size_t length, off_t offset, uv_fs_cb cb);
|
906
|
+
|
907
|
+
int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb);
|
908
|
+
|
909
|
+
int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, void* buf,
|
910
|
+
size_t length, off_t offset, uv_fs_cb cb);
|
911
|
+
|
912
|
+
int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode,
|
913
|
+
uv_fs_cb cb);
|
914
|
+
|
915
|
+
int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb);
|
916
|
+
|
917
|
+
int uv_fs_readdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
|
918
|
+
uv_fs_cb cb);
|
919
|
+
|
920
|
+
int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb);
|
921
|
+
|
922
|
+
int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb);
|
923
|
+
|
924
|
+
int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
925
|
+
const char* new_path, uv_fs_cb cb);
|
926
|
+
|
927
|
+
int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb);
|
928
|
+
|
929
|
+
int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb);
|
930
|
+
|
931
|
+
int uv_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req, uv_file file,
|
932
|
+
off_t offset, uv_fs_cb cb);
|
933
|
+
|
934
|
+
int uv_fs_sendfile(uv_loop_t* loop, uv_fs_t* req, uv_file out_fd,
|
935
|
+
uv_file in_fd, off_t in_offset, size_t length, uv_fs_cb cb);
|
936
|
+
|
937
|
+
int uv_fs_chmod(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode,
|
938
|
+
uv_fs_cb cb);
|
939
|
+
|
940
|
+
int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime,
|
941
|
+
double mtime, uv_fs_cb cb);
|
942
|
+
|
943
|
+
int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime,
|
944
|
+
double mtime, uv_fs_cb cb);
|
945
|
+
|
946
|
+
int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb);
|
947
|
+
|
948
|
+
int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
949
|
+
const char* new_path, uv_fs_cb cb);
|
950
|
+
|
951
|
+
int uv_fs_symlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
952
|
+
const char* new_path, uv_fs_cb cb);
|
953
|
+
|
954
|
+
int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
955
|
+
uv_fs_cb cb);
|
956
|
+
|
957
|
+
int uv_fs_fchmod(uv_loop_t* loop, uv_fs_t* req, uv_file file, int mode,
|
958
|
+
uv_fs_cb cb);
|
959
|
+
|
960
|
+
int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path, int uid,
|
961
|
+
int gid, uv_fs_cb cb);
|
962
|
+
|
963
|
+
int uv_fs_fchown(uv_loop_t* loop, uv_fs_t* req, uv_file file, int uid,
|
964
|
+
int gid, uv_fs_cb cb);
|
560
965
|
|
561
966
|
|
562
967
|
/* Utility */
|
@@ -601,15 +1006,18 @@ union uv_any_req {
|
|
601
1006
|
uv_write_t write;
|
602
1007
|
uv_connect_t connect;
|
603
1008
|
uv_shutdown_t shutdown;
|
1009
|
+
uv_fs_t fs_req;
|
1010
|
+
uv_work_t work_req;
|
604
1011
|
};
|
605
1012
|
|
606
1013
|
|
607
|
-
|
608
|
-
|
1014
|
+
struct uv_counters_s {
|
1015
|
+
uint64_t eio_init;
|
609
1016
|
uint64_t req_init;
|
610
1017
|
uint64_t handle_init;
|
611
1018
|
uint64_t stream_init;
|
612
1019
|
uint64_t tcp_init;
|
1020
|
+
uint64_t udp_init;
|
613
1021
|
uint64_t pipe_init;
|
614
1022
|
uint64_t prepare_init;
|
615
1023
|
uint64_t check_init;
|
@@ -617,9 +1025,24 @@ typedef struct {
|
|
617
1025
|
uint64_t async_init;
|
618
1026
|
uint64_t timer_init;
|
619
1027
|
uint64_t process_init;
|
620
|
-
}
|
1028
|
+
};
|
621
1029
|
|
622
|
-
|
1030
|
+
|
1031
|
+
struct uv_loop_s {
|
1032
|
+
UV_LOOP_PRIVATE_FIELDS
|
1033
|
+
/* list used for ares task handles */
|
1034
|
+
uv_ares_task_t* uv_ares_handles_;
|
1035
|
+
/* Various thing for libeio. */
|
1036
|
+
uv_async_t uv_eio_want_poll_notifier;
|
1037
|
+
uv_async_t uv_eio_done_poll_notifier;
|
1038
|
+
uv_idle_t uv_eio_poller;
|
1039
|
+
/* Diagnostic counters */
|
1040
|
+
uv_counters_t counters;
|
1041
|
+
/* The last error */
|
1042
|
+
uv_err_t last_err;
|
1043
|
+
/* User data - use this for whatever. */
|
1044
|
+
void* data;
|
1045
|
+
};
|
623
1046
|
|
624
1047
|
|
625
1048
|
/* Don't export the private CPP symbols. */
|
@@ -633,6 +1056,8 @@ uv_counters_t* uv_counters();
|
|
633
1056
|
#undef UV_ASYNC_PRIVATE_FIELDS
|
634
1057
|
#undef UV_TIMER_PRIVATE_FIELDS
|
635
1058
|
#undef UV_GETADDRINFO_PRIVATE_FIELDS
|
1059
|
+
#undef UV_FS_REQ_PRIVATE_FIELDS
|
1060
|
+
#undef UV_WORK_PRIVATE_FIELDS
|
636
1061
|
|
637
1062
|
#ifdef __cplusplus
|
638
1063
|
}
|