noderb 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. data/ext/noderb_extension/extconf.rb +4 -2
  2. data/ext/noderb_extension/libuv/AUTHORS +2 -0
  3. data/ext/noderb_extension/libuv/Makefile +1 -1
  4. data/ext/noderb_extension/libuv/common.gypi +51 -51
  5. data/ext/noderb_extension/libuv/config-mingw.mk +3 -9
  6. data/ext/noderb_extension/libuv/config-unix.mk +10 -1
  7. data/ext/noderb_extension/libuv/include/uv-private/uv-unix.h +3 -2
  8. data/ext/noderb_extension/libuv/include/uv-private/uv-win.h +7 -6
  9. data/ext/noderb_extension/libuv/include/uv.h +47 -13
  10. data/ext/noderb_extension/libuv/src/ares/config_netbsd/ares_config.h +510 -0
  11. data/ext/noderb_extension/libuv/src/unix/core.c +20 -65
  12. data/ext/noderb_extension/libuv/src/unix/darwin.c +1 -0
  13. data/ext/noderb_extension/libuv/src/unix/eio/config_netbsd.h +81 -0
  14. data/ext/noderb_extension/libuv/src/unix/error.c +9 -1
  15. data/ext/noderb_extension/libuv/src/unix/ev/config_netbsd.h +120 -0
  16. data/ext/noderb_extension/libuv/src/unix/fs.c +151 -21
  17. data/ext/noderb_extension/libuv/src/unix/internal.h +30 -0
  18. data/ext/noderb_extension/libuv/src/unix/netbsd.c +68 -0
  19. data/ext/noderb_extension/libuv/src/unix/pipe.c +20 -30
  20. data/ext/noderb_extension/libuv/src/unix/process.c +13 -0
  21. data/ext/noderb_extension/libuv/src/unix/stream.c +105 -63
  22. data/ext/noderb_extension/libuv/src/unix/tcp.c +75 -21
  23. data/ext/noderb_extension/libuv/src/unix/tty.c +69 -0
  24. data/ext/noderb_extension/libuv/src/unix/udp.c +31 -0
  25. data/ext/noderb_extension/libuv/src/uv-common.c +2 -0
  26. data/ext/noderb_extension/libuv/src/uv-common.h +0 -6
  27. data/ext/noderb_extension/libuv/src/win/cares.c +7 -7
  28. data/ext/noderb_extension/libuv/src/win/core.c +25 -17
  29. data/ext/noderb_extension/libuv/src/win/error.c +7 -0
  30. data/ext/noderb_extension/libuv/src/win/fs.c +587 -92
  31. data/ext/noderb_extension/libuv/src/win/getaddrinfo.c +3 -1
  32. data/ext/noderb_extension/libuv/src/win/handle.c +0 -17
  33. data/ext/noderb_extension/libuv/src/win/internal.h +15 -5
  34. data/ext/noderb_extension/libuv/src/win/loop-watcher.c +1 -1
  35. data/ext/noderb_extension/libuv/src/win/pipe.c +6 -0
  36. data/ext/noderb_extension/libuv/src/win/process.c +90 -43
  37. data/ext/noderb_extension/libuv/src/win/tcp.c +37 -4
  38. data/ext/noderb_extension/libuv/src/win/threads.c +81 -0
  39. data/ext/noderb_extension/libuv/src/win/timer.c +15 -15
  40. data/ext/noderb_extension/libuv/src/win/tty.c +37 -0
  41. data/ext/noderb_extension/libuv/src/win/udp.c +8 -2
  42. data/ext/noderb_extension/libuv/src/win/winapi.c +12 -0
  43. data/ext/noderb_extension/libuv/src/win/winapi.h +1146 -1015
  44. data/ext/noderb_extension/libuv/test/benchmark-ares.c +0 -1
  45. data/ext/noderb_extension/libuv/test/benchmark-getaddrinfo.c +0 -1
  46. data/ext/noderb_extension/libuv/test/benchmark-ping-pongs.c +0 -1
  47. data/ext/noderb_extension/libuv/test/benchmark-pound.c +0 -1
  48. data/ext/noderb_extension/libuv/test/benchmark-pump.c +4 -6
  49. data/ext/noderb_extension/libuv/test/benchmark-spawn.c +0 -1
  50. data/ext/noderb_extension/libuv/test/benchmark-udp-packet-storm.c +0 -1
  51. data/ext/noderb_extension/libuv/test/dns-server.c +2 -2
  52. data/ext/noderb_extension/libuv/test/echo-server.c +4 -5
  53. data/ext/noderb_extension/libuv/test/run-tests.c +0 -2
  54. data/ext/noderb_extension/libuv/test/test-async.c +0 -2
  55. data/ext/noderb_extension/libuv/test/test-callback-stack.c +0 -2
  56. data/ext/noderb_extension/libuv/test/test-connection-fail.c +3 -5
  57. data/ext/noderb_extension/libuv/test/test-delayed-accept.c +2 -3
  58. data/ext/noderb_extension/libuv/test/test-fs.c +578 -42
  59. data/ext/noderb_extension/libuv/test/test-get-currentexe.c +12 -2
  60. data/ext/noderb_extension/libuv/test/test-getaddrinfo.c +10 -5
  61. data/ext/noderb_extension/libuv/test/test-gethostbyname.c +0 -2
  62. data/ext/noderb_extension/libuv/test/test-getsockname.c +92 -72
  63. data/ext/noderb_extension/libuv/test/test-idle.c +0 -3
  64. data/ext/noderb_extension/libuv/test/test-list.h +13 -0
  65. data/ext/noderb_extension/libuv/test/test-loop-handles.c +0 -3
  66. data/ext/noderb_extension/libuv/test/test-ping-pong.c +13 -19
  67. data/ext/noderb_extension/libuv/test/test-pipe-bind-error.c +0 -12
  68. data/ext/noderb_extension/libuv/test/test-ref.c +0 -7
  69. data/ext/noderb_extension/libuv/test/test-shutdown-eof.c +3 -3
  70. data/ext/noderb_extension/libuv/test/test-spawn.c +2 -11
  71. data/ext/noderb_extension/libuv/test/test-tcp-bind-error.c +0 -19
  72. data/ext/noderb_extension/libuv/test/test-tcp-bind6-error.c +0 -15
  73. data/ext/noderb_extension/libuv/test/test-tcp-close.c +129 -0
  74. data/ext/noderb_extension/libuv/test/test-tcp-writealot.c +0 -3
  75. data/ext/noderb_extension/libuv/test/test-threadpool.c +0 -2
  76. data/ext/noderb_extension/libuv/test/test-timer-again.c +0 -3
  77. data/ext/noderb_extension/libuv/test/test-timer.c +0 -2
  78. data/ext/noderb_extension/libuv/test/test-udp-dgram-too-big.c +0 -2
  79. data/ext/noderb_extension/libuv/test/test-udp-ipv6.c +0 -2
  80. data/ext/noderb_extension/libuv/test/test-udp-send-and-recv.c +0 -2
  81. data/ext/noderb_extension/libuv/uv.gyp +18 -2
  82. data/ext/noderb_extension/noderb_fs.c +1 -2
  83. data/lib/noderb/version.rb +1 -1
  84. metadata +10 -2
@@ -1,17 +1,19 @@
1
1
  require "mkmf"
2
2
 
3
- cflags = " -shared "
3
+ cflags = " -shared -fPIC "
4
4
 
5
5
  if $solaris
6
6
  cflags = " -G -fPIC "
7
7
  # From EventMachine
8
8
  CONFIG['LDSHARED'] = "$(CXX) -G -fPIC"
9
9
  if CONFIG['CC'] == 'cc'
10
- $CFLAGS = CONFIG['CFLAGS'] = "-g -O2 -fPIC"
10
+ cflags = "-g -O2 -fPIC"
11
11
  CONFIG['CCDLFLAGS'] = "-fPIC"
12
12
  end
13
13
  end
14
14
 
15
+ $CFLAGS = CONFIG['CFLAGS'] = cflags
16
+
15
17
  `cd libuv; CFLAGS="#{cflags}" make; cd ..; cp libuv/uv.a libuv.a`
16
18
 
17
19
  dir_config("uv", File.expand_path("../libuv/include", __FILE__), File.expand_path("../libuv", __FILE__))
@@ -19,3 +19,5 @@ Andrea Lattuada <ndr.lattuada@gmail.com>
19
19
  Augusto Henrique Hentz <ahhentz@gmail.com>
20
20
  Clifford Heath <clifford.heath@gmail.com>
21
21
  Jorge Chamorro Bieling <jorge@jorgechamorro.com>
22
+ Luis Lavena <luislavena@gmail.com>
23
+ Matthew Sporleder <msporleder@gmail.com>
@@ -80,7 +80,7 @@ endif
80
80
  TESTS=test/echo-server.c test/test-*.c
81
81
  BENCHMARKS=test/echo-server.c test/dns-server.c test/benchmark-*.c
82
82
 
83
- all: uv.a test/run-tests test/run-benchmarks
83
+ all: uv.a test/run-tests$(E) test/run-benchmarks$(E)
84
84
 
85
85
  $(CARES_OBJS): %.o: %.c
86
86
  $(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H
@@ -1,5 +1,6 @@
1
1
  {
2
2
  'variables': {
3
+ 'visibility%': 'hidden', # V8's visibility setting
3
4
  'target_arch%': 'ia32', # set v8's target architecture
4
5
  'host_arch%': 'ia32', # set v8's host architecture
5
6
  'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
@@ -87,6 +88,11 @@
87
88
  'DataExecutionPrevention': 2, # enable DEP
88
89
  'AllowIsolation': 'true',
89
90
  'SuppressStartupBanner': 'true',
91
+ 'target_conditions': [
92
+ ['_type=="executable"', {
93
+ 'SubSystem': 1, # console executable
94
+ }],
95
+ ],
90
96
  },
91
97
  },
92
98
  'conditions': [
@@ -103,61 +109,55 @@
103
109
  ],
104
110
  }],
105
111
  [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
106
- 'target_defaults': {
107
- 'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions' ],
108
- 'ldflags': [ '-pthread', ],
109
- 'conditions': [
110
- [ 'target_arch=="ia32"', {
111
- 'cflags': [ '-m32' ],
112
- 'ldflags': [ '-m32' ],
113
- }],
114
- [ 'OS=="linux"', {
115
- 'cflags': [ '-ansi' ],
116
- }],
117
- [ 'visibility=="hidden"', {
118
- 'cflags': [ '-fvisibility=hidden' ],
119
- }],
120
- ],
121
- },
112
+ 'cflags': [ '-Wall', '-pthread', ],
113
+ 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
114
+ 'ldflags': [ '-pthread', ],
115
+ 'conditions': [
116
+ [ 'target_arch=="ia32"', {
117
+ 'cflags': [ '-m32' ],
118
+ 'ldflags': [ '-m32' ],
119
+ }],
120
+ [ 'OS=="linux"', {
121
+ 'cflags': [ '-ansi' ],
122
+ }],
123
+ [ 'visibility=="hidden"', {
124
+ 'cflags': [ '-fvisibility=hidden' ],
125
+ }],
126
+ ],
122
127
  }],
123
128
  ['OS=="mac"', {
124
- 'target_defaults': {
125
- 'xcode_settings': {
126
- 'ALWAYS_SEARCH_USER_PATHS': 'NO',
127
- 'GCC_C_LANGUAGE_STANDARD': 'ansi', # -ansi
128
- 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
129
- 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
130
- # (Equivalent to -fPIC)
131
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
132
- 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
133
- 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
134
- # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
135
- 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
136
- 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
137
- 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
138
- 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
139
- 'GCC_VERSION': '4.2',
140
- 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
141
- 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
142
- 'PREBINDING': 'NO', # No -Wl,-prebind
143
- 'USE_HEADERMAP': 'NO',
144
- 'OTHER_CFLAGS': [
145
- '-fno-strict-aliasing',
146
- ],
147
- 'WARNING_CFLAGS': [
148
- '-Wall',
149
- '-Wendif-labels',
150
- '-W',
151
- '-Wno-unused-parameter',
152
- '-Wnon-virtual-dtor',
153
- ],
154
- },
155
- 'target_conditions': [
156
- ['_type!="static_library"', {
157
- 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
158
- }],
129
+ 'xcode_settings': {
130
+ 'ALWAYS_SEARCH_USER_PATHS': 'NO',
131
+ 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
132
+ 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
133
+ # (Equivalent to -fPIC)
134
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
135
+ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
136
+ 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
137
+ # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
138
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
139
+ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
140
+ 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
141
+ 'GCC_VERSION': '4.2',
142
+ 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
143
+ 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
144
+ 'PREBINDING': 'NO', # No -Wl,-prebind
145
+ 'USE_HEADERMAP': 'NO',
146
+ 'OTHER_CFLAGS': [
147
+ '-fno-strict-aliasing',
148
+ ],
149
+ 'WARNING_CFLAGS': [
150
+ '-Wall',
151
+ '-Wendif-labels',
152
+ '-W',
153
+ '-Wno-unused-parameter',
159
154
  ],
160
155
  },
156
+ 'target_conditions': [
157
+ ['_type!="static_library"', {
158
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
159
+ }],
160
+ ],
161
161
  }],
162
162
  ],
163
163
  },
@@ -36,25 +36,19 @@ RUNNER_LINKFLAGS=$(LINKFLAGS)
36
36
  RUNNER_LIBS=-lws2_32
37
37
  RUNNER_SRC=test/runner-win.c
38
38
 
39
- uv.a: $(WIN_OBJS) src/uv-common.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
40
- $(AR) rcs uv.a src/win/*.o src/uv-common.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
39
+ uv.a: $(WIN_OBJS) src/uv-common.o $(CARES_OBJS)
40
+ $(AR) rcs uv.a src/win/*.o src/uv-common.o $(CARES_OBJS)
41
41
 
42
42
  src/win/%.o: src/win/%.c src/win/internal.h
43
43
  $(CC) $(CFLAGS) -o $@ -c $<
44
44
 
45
- src/uv-common.o: src/uv-common.c include/uv.h include/uv-win.h
45
+ src/uv-common.o: src/uv-common.c include/uv.h include/uv-private/uv-win.h
46
46
  $(CC) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
47
47
 
48
48
  EIO_CPPFLAGS += $(CPPFLAGS)
49
49
  EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
50
50
  EIO_CPPFLAGS += -D_GNU_SOURCE
51
51
 
52
- src/eio/eio.o: src/eio/eio.c
53
- $(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o
54
-
55
- src/uv-eio.o: src/uv-eio.c
56
- $(CC) $(CPPFLAGS) -Isrc/eio/ $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o
57
-
58
52
  clean-platform:
59
53
  -rm -f src/ares/*.o
60
54
  -rm -f src/eio/*.o
@@ -37,6 +37,7 @@ OBJS += src/unix/error.o
37
37
  OBJS += src/unix/process.o
38
38
  OBJS += src/unix/tcp.o
39
39
  OBJS += src/unix/pipe.o
40
+ OBJS += src/unix/tty.o
40
41
  OBJS += src/unix/stream.o
41
42
 
42
43
  ifeq (SunOS,$(uname_S))
@@ -58,7 +59,7 @@ endif
58
59
  ifeq (Linux,$(uname_S))
59
60
  EV_CONFIG=config_linux.h
60
61
  EIO_CONFIG=config_linux.h
61
- CSTDFLAG += -D_XOPEN_SOURCE=600
62
+ CSTDFLAG += -D_GNU_SOURCE
62
63
  CPPFLAGS += -Isrc/ares/config_linux
63
64
  LINKFLAGS+=-lrt
64
65
  OBJS += src/unix/linux.o
@@ -72,6 +73,14 @@ LINKFLAGS+=
72
73
  OBJS += src/unix/freebsd.o
73
74
  endif
74
75
 
76
+ ifeq (NetBSD,$(uname_S))
77
+ EV_CONFIG=config_netbsd.h
78
+ EIO_CONFIG=config_netbsd.h
79
+ CPPFLAGS += -Isrc/ares/config_netbsd
80
+ LINKFLAGS+=
81
+ OBJS += src/unix/netbsd.o
82
+ endif
83
+
75
84
  ifneq (,$(findstring CYGWIN,$(uname_S)))
76
85
  EV_CONFIG=config_cygwin.h
77
86
  EIO_CONFIG=config_cygwin.h
@@ -61,6 +61,7 @@ typedef int uv_file;
61
61
  int write_index; \
62
62
  uv_buf_t* bufs; \
63
63
  int bufcnt; \
64
+ int error; \
64
65
  uv_buf_t bufsml[UV_REQ_BUFSML_SIZE];
65
66
 
66
67
  #define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */
@@ -117,9 +118,7 @@ typedef int uv_file;
117
118
 
118
119
 
119
120
  /* UV_NAMED_PIPE */
120
- #define UV_PIPE_PRIVATE_TYPEDEF
121
121
  #define UV_PIPE_PRIVATE_FIELDS \
122
- UV_TCP_PRIVATE_FIELDS \
123
122
  const char* pipe_fname; /* strdup'ed */
124
123
 
125
124
 
@@ -175,4 +174,6 @@ typedef int uv_file;
175
174
  #define UV_WORK_PRIVATE_FIELDS \
176
175
  eio_req* eio;
177
176
 
177
+ #define UV_TTY_PRIVATE_FIELDS /* empty */
178
+
178
179
  #endif /* UV_UNIX_H */
@@ -73,7 +73,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
73
73
  uv_prepare_t* next_prepare_handle; \
74
74
  uv_check_t* next_check_handle; \
75
75
  uv_idle_t* next_idle_handle; \
76
- ares_channel ares_channel; \
76
+ ares_channel ares_chan; \
77
77
  int ares_active_sockets; \
78
78
  uv_timer_t ares_polling_timer; \
79
79
  /* Last error code */ \
@@ -235,10 +235,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
235
235
  struct uv_process_close_s { \
236
236
  UV_REQ_FIELDS \
237
237
  } close_req; \
238
- struct uv_process_stdio_s { \
239
- uv_pipe_t* server_pipe; \
240
- HANDLE child_pipe; \
241
- } stdio_pipes[3]; \
238
+ HANDLE child_stdio[3]; \
242
239
  int exit_signal; \
243
240
  DWORD spawn_errno; \
244
241
  HANDLE wait_handle; \
@@ -247,7 +244,8 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
247
244
 
248
245
  #define UV_FS_PRIVATE_FIELDS \
249
246
  int flags; \
250
- struct _stat stat; \
247
+ int last_error; \
248
+ struct _stati64 stat; \
251
249
  void* arg0; \
252
250
  union { \
253
251
  struct { \
@@ -263,6 +261,9 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
263
261
 
264
262
  #define UV_WORK_PRIVATE_FIELDS \
265
263
 
264
+
265
+ #define UV_TTY_PRIVATE_FIELDS /* empty */
266
+
266
267
  int uv_utf16_to_utf8(const wchar_t* utf16Buffer, size_t utf16Size,
267
268
  char* utf8Buffer, size_t utf8Size);
268
269
  int uv_utf8_to_utf16(const char* utf8Buffer, wchar_t* utf16Buffer,
@@ -49,6 +49,7 @@ typedef struct uv_stream_s uv_stream_t;
49
49
  typedef struct uv_tcp_s uv_tcp_t;
50
50
  typedef struct uv_udp_s uv_udp_t;
51
51
  typedef struct uv_pipe_s uv_pipe_t;
52
+ typedef struct uv_tty_s uv_tty_t;
52
53
  typedef struct uv_timer_s uv_timer_t;
53
54
  typedef struct uv_prepare_s uv_prepare_t;
54
55
  typedef struct uv_check_s uv_check_t;
@@ -81,11 +82,10 @@ typedef struct uv_work_s uv_work_t;
81
82
  * All callbacks in libuv are made asynchronously. That is they are never
82
83
  * made by the function that takes them as a parameter.
83
84
  */
84
- void uv_init();
85
85
  uv_loop_t* uv_loop_new();
86
-
87
86
  void uv_loop_delete(uv_loop_t*);
88
87
 
88
+
89
89
  /*
90
90
  * Returns the default loop.
91
91
  */
@@ -172,6 +172,7 @@ typedef enum {
172
172
  UV_ENOTCONN,
173
173
  UV_ENOTSOCK,
174
174
  UV_ENOTSUP,
175
+ UV_ENOENT,
175
176
  UV_EPIPE,
176
177
  UV_EPROTO,
177
178
  UV_EPROTONOSUPPORT,
@@ -182,7 +183,8 @@ typedef enum {
182
183
  UV_EAINONAME,
183
184
  UV_EAISERVICE,
184
185
  UV_EAISOCKTYPE,
185
- UV_ESHUTDOWN
186
+ UV_ESHUTDOWN,
187
+ UV_EEXIST
186
188
  } uv_err_code;
187
189
 
188
190
  typedef enum {
@@ -199,7 +201,6 @@ typedef enum {
199
201
  UV_ASYNC,
200
202
  UV_ARES_TASK,
201
203
  UV_ARES_EVENT,
202
- UV_GETADDRINFO,
203
204
  UV_PROCESS
204
205
  } uv_handle_type;
205
206
 
@@ -214,6 +215,7 @@ typedef enum {
214
215
  UV_UDP_SEND,
215
216
  UV_FS,
216
217
  UV_WORK,
218
+ UV_GETADDRINFO,
217
219
  UV_REQ_TYPE_PRIVATE
218
220
  } uv_req_type;
219
221
 
@@ -324,7 +326,7 @@ uv_buf_t uv_buf_init(char* base, size_t len);
324
326
  *
325
327
  * uv_stream is an abstract class.
326
328
  *
327
- * uv_stream_t is the parent class of uv_tcp_t, uv_pipe_t
329
+ * uv_stream_t is the parent class of uv_tcp_t, uv_pipe_t, uv_tty_t
328
330
  * and soon uv_file_t.
329
331
  */
330
332
  struct uv_stream_s {
@@ -415,6 +417,8 @@ int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle);
415
417
 
416
418
  int uv_tcp_bind(uv_tcp_t* handle, struct sockaddr_in);
417
419
  int uv_tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6);
420
+ int uv_tcp_getsockname(uv_tcp_t* handle, struct sockaddr* name, int* namelen);
421
+ int uv_tcp_getpeername(uv_tcp_t* handle, struct sockaddr* name, int* namelen);
418
422
 
419
423
  /*
420
424
  * uv_tcp_connect, uv_tcp_connect6
@@ -436,9 +440,6 @@ struct uv_connect_s {
436
440
  };
437
441
 
438
442
 
439
- int uv_getsockname(uv_handle_t* handle, struct sockaddr* name, int* namelen);
440
-
441
-
442
443
  /*
443
444
  * UDP support.
444
445
  */
@@ -521,6 +522,7 @@ int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr, unsigned flags);
521
522
  * 0 on success, -1 on error.
522
523
  */
523
524
  int uv_udp_bind6(uv_udp_t* handle, struct sockaddr_in6 addr, unsigned flags);
525
+ int uv_udp_getsockname(uv_udp_t* handle, struct sockaddr* name, int* namelen);
524
526
 
525
527
  /*
526
528
  * Send data. If the socket has not previously been bound with `uv_udp_bind`
@@ -587,6 +589,25 @@ int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
587
589
  int uv_udp_recv_stop(uv_udp_t* handle);
588
590
 
589
591
 
592
+ /*
593
+ * uv_tty_t is a subclass of uv_stream_t
594
+ *
595
+ * Representing a stream for the console.
596
+ */
597
+ struct uv_tty_s {
598
+ UV_HANDLE_FIELDS
599
+ UV_STREAM_FIELDS
600
+ UV_TTY_PRIVATE_FIELDS
601
+ };
602
+
603
+ int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd);
604
+
605
+ /*
606
+ * Set mode. 0 for normal, 1 for raw.
607
+ */
608
+ int uv_tty_set_mode(uv_tty_t*, int mode);
609
+
610
+
590
611
  /*
591
612
  * uv_pipe_t is a subclass of uv_stream_t
592
613
  *
@@ -601,6 +622,11 @@ struct uv_pipe_s {
601
622
 
602
623
  int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle);
603
624
 
625
+ /*
626
+ * Opens an existing file descriptor or HANDLE as a pipe.
627
+ */
628
+ void uv_pipe_open(uv_pipe_t*, uv_file file);
629
+
604
630
  int uv_pipe_bind(uv_pipe_t* handle, const char* name);
605
631
 
606
632
  int uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle,
@@ -736,14 +762,14 @@ void uv_ares_destroy(uv_loop_t*, ares_channel channel);
736
762
 
737
763
 
738
764
  /*
739
- * uv_getaddrinfo_t is a subclass of uv_handle_t
740
- *
741
- * TODO this should be a subclass of uv_req_t
765
+ * uv_getaddrinfo_t is a subclass of uv_req_t
742
766
  *
743
767
  * Request object for uv_getaddrinfo.
744
768
  */
745
769
  struct uv_getaddrinfo_s {
746
- UV_HANDLE_FIELDS
770
+ UV_REQ_FIELDS
771
+ /* read-only */
772
+ uv_loop_t* loop; \
747
773
  UV_GETADDRINFO_PRIVATE_FIELDS
748
774
  };
749
775
 
@@ -890,6 +916,7 @@ struct uv_fs_s {
890
916
  uv_fs_cb cb;
891
917
  ssize_t result;
892
918
  void* ptr;
919
+ char* path;
893
920
  int errorno;
894
921
  UV_FS_PRIVATE_FIELDS
895
922
  };
@@ -948,8 +975,14 @@ int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb);
948
975
  int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path,
949
976
  const char* new_path, uv_fs_cb cb);
950
977
 
978
+ /*
979
+ * This flag can be used with uv_fs_symlink on Windows
980
+ * to specify whether path argument points to a directory.
981
+ */
982
+ #define UV_FS_SYMLINK_DIR 0x0001
983
+
951
984
  int uv_fs_symlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
952
- const char* new_path, uv_fs_cb cb);
985
+ const char* new_path, int flags, uv_fs_cb cb);
953
986
 
954
987
  int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
955
988
  uv_fs_cb cb);
@@ -1019,6 +1052,7 @@ struct uv_counters_s {
1019
1052
  uint64_t tcp_init;
1020
1053
  uint64_t udp_init;
1021
1054
  uint64_t pipe_init;
1055
+ uint64_t tty_init;
1022
1056
  uint64_t prepare_init;
1023
1057
  uint64_t check_init;
1024
1058
  uint64_t idle_init;