Skip to content
This repository
Browse code

deps: upgrade libuv to 665a316

  • Loading branch information...
commit b6a3b0a6297ee205aa34d357edd55b79f91cdf09 1 parent e2bcff9
Ben Noordhuis authored November 16, 2012

Showing 88 changed files with 1,146 additions and 56,391 deletions. Show diff stats Hide diff stats

  1. 40  LICENSE
  2. 10  deps/uv/.gitignore
  3. 3  deps/uv/LICENSE
  4. 27  deps/uv/Makefile
  5. 4  deps/uv/README.md
  6. 33  deps/uv/config-unix.mk
  7. 7  deps/uv/gyp_uv
  8. 838  deps/uv/include/uv-private/ev.h
  9. 4  deps/uv/include/uv-private/uv-bsd.h
  10. 4  deps/uv/include/uv-private/uv-darwin.h
  11. 29  deps/uv/include/uv-private/uv-unix.h
  12. 40  deps/uv/include/uv.h
  13. 11  deps/uv/src/unix/async.c
  14. 153  deps/uv/src/unix/core.c
  15. 18  deps/uv/src/unix/darwin.c
  16. 388  deps/uv/src/unix/ev/Changes
  17. 36  deps/uv/src/unix/ev/LICENSE
  18. 18  deps/uv/src/unix/ev/Makefile.am
  19. 771  deps/uv/src/unix/ev/Makefile.in
  20. 58  deps/uv/src/unix/ev/README
  21. 8,957  deps/uv/src/unix/ev/aclocal.m4
  22. 6  deps/uv/src/unix/ev/autogen.sh
  23. 1,526  deps/uv/src/unix/ev/config.guess
  24. 125  deps/uv/src/unix/ev/config.h.in
  25. 1,658  deps/uv/src/unix/ev/config.sub
  26. 122  deps/uv/src/unix/ev/config_aix.h
  27. 123  deps/uv/src/unix/ev/config_cygwin.h
  28. 122  deps/uv/src/unix/ev/config_darwin.h
  29. 120  deps/uv/src/unix/ev/config_freebsd.h
  30. 141  deps/uv/src/unix/ev/config_linux.h
  31. 120  deps/uv/src/unix/ev/config_netbsd.h
  32. 126  deps/uv/src/unix/ev/config_openbsd.h
  33. 122  deps/uv/src/unix/ev/config_sunos.h
  34. 13,037  deps/uv/src/unix/ev/configure
  35. 18  deps/uv/src/unix/ev/configure.ac
  36. 630  deps/uv/src/unix/ev/depcomp
  37. 816  deps/uv/src/unix/ev/ev++.h
  38. 5,311  deps/uv/src/unix/ev/ev.3
  39. 3,925  deps/uv/src/unix/ev/ev.c
  40. 5,243  deps/uv/src/unix/ev/ev.pod
  41. 266  deps/uv/src/unix/ev/ev_epoll.c
  42. 235  deps/uv/src/unix/ev/ev_kqueue.c
  43. 148  deps/uv/src/unix/ev/ev_poll.c
  44. 179  deps/uv/src/unix/ev/ev_port.c
  45. 310  deps/uv/src/unix/ev/ev_select.c
  46. 203  deps/uv/src/unix/ev/ev_vars.h
  47. 153  deps/uv/src/unix/ev/ev_win32.c
  48. 196  deps/uv/src/unix/ev/ev_wrap.h
  49. 402  deps/uv/src/unix/ev/event.c
  50. 170  deps/uv/src/unix/ev/event.h
  51. 294  deps/uv/src/unix/ev/install-sh
  52. 39  deps/uv/src/unix/ev/libev.m4
  53. 8,413  deps/uv/src/unix/ev/ltmain.sh
  54. 336  deps/uv/src/unix/ev/missing
  55. 111  deps/uv/src/unix/ev/mkinstalldirs
  56. 2  deps/uv/src/unix/freebsd.c
  57. 6  deps/uv/src/unix/fsevents.c
  58. 51  deps/uv/src/unix/internal.h
  59. 263  deps/uv/src/unix/kqueue.c
  60. 15  deps/uv/src/unix/linux/inotify.c
  61. 167  deps/uv/src/unix/linux/linux-core.c
  62. 39  deps/uv/src/unix/loop.c
  63. 2  deps/uv/src/unix/netbsd.c
  64. 2  deps/uv/src/unix/openbsd.c
  65. 40  deps/uv/src/unix/pipe.c
  66. 34  deps/uv/src/unix/poll.c
  67. 2  deps/uv/src/unix/process.c
  68. 15  deps/uv/src/unix/signal.c
  69. 145  deps/uv/src/unix/stream.c
  70. 163  deps/uv/src/unix/sunos.c
  71. 88  deps/uv/src/unix/tcp.c
  72. 6  deps/uv/src/unix/tty.c
  73. 135  deps/uv/src/unix/udp.c
  74. 1  deps/uv/src/win/error.c
  75. 20  deps/uv/test/benchmark-async-pummel.c
  76. 3  deps/uv/test/benchmark-async.c
  77. 11  deps/uv/test/benchmark-million-timers.c
  78. 4  deps/uv/test/benchmark-multi-accept.c
  79. 8  deps/uv/test/benchmark-pump.c
  80. 12  deps/uv/test/benchmark-udp-pummel.c
  81. 5  deps/uv/test/runner-unix.c
  82. 15  deps/uv/test/test-async.c
  83. 4  deps/uv/test/test-fs-event.c
  84. 4  deps/uv/test/test-fs-poll.c
  85. 10  deps/uv/test/test-getsockname.c
  86. 4  deps/uv/test/test-spawn.c
  87. 2  deps/uv/test/test-tcp-unexpected-read.c
  88. 64  deps/uv/uv.gyp
40  LICENSE
@@ -84,46 +84,6 @@ maintained libraries. The externally maintained libraries used by Node are:
84 84
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85 85
   """
86 86
 
87  
-- libev, located at deps/uv/src/unix/ev. libev's license follows:
88  
-  """
89  
-    All files in libev are Copyright (C)2007,2008,2009 Marc Alexander Lehmann.
90  
-
91  
-    Redistribution and use in source and binary forms, with or without
92  
-    modification, are permitted provided that the following conditions are
93  
-    met:
94  
-
95  
-        * Redistributions of source code must retain the above copyright
96  
-          notice, this list of conditions and the following disclaimer.
97  
-
98  
-        * Redistributions in binary form must reproduce the above
99  
-          copyright notice, this list of conditions and the following
100  
-          disclaimer in the documentation and/or other materials provided
101  
-          with the distribution.
102  
-
103  
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
104  
-    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
105  
-    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
106  
-    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
107  
-    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
108  
-    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
109  
-    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
110  
-    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
111  
-    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
112  
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
113  
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
114  
-
115  
-    Alternatively, the contents of this package may be used under the terms
116  
-    of the GNU General Public License ("GPL") version 2 or any later version,
117  
-    in which case the provisions of the GPL are applicable instead of the
118  
-    above. If you wish to allow the use of your version of this package only
119  
-    under the terms of the GPL and not to allow others to use your version of
120  
-    this file under the BSD license, indicate your decision by deleting the
121  
-    provisions above and replace them with the notice and other provisions
122  
-    required by the GPL in this and the other files of this package. If you do
123  
-    not delete the provisions above, a recipient may use your version of this
124  
-    file under either the BSD or the GPL.
125  
-  """
126  
-
127 87
 - C-Ares, an asynchronous DNS client, located at deps/cares. C-Ares license
128 88
   follows:
129 89
   """
10  deps/uv/.gitignore
... ...
@@ -1,14 +1,16 @@
1 1
 *.swp
2  
-*.o
3  
-*.lo
4  
-*.la
5  
-*.a
  2
+*.[oa]
  3
+*.l[oa]
6 4
 *.opensdf
7 5
 *.orig
8 6
 *.sdf
9 7
 *.suo
10 8
 core
11 9
 vgcore.*
  10
+
  11
+/libuv.so
  12
+/libuv.dylib
  13
+
12 14
 /out/
13 15
 /build/gyp
14 16
 
3  deps/uv/LICENSE
@@ -33,9 +33,6 @@ The externally maintained libraries used by libuv are:
33 33
 
34 34
   - ngx_queue.h (from Nginx), copyright Igor Sysoev. Two clause BSD license.
35 35
 
36  
-  - libev, located at ev/ is copyright Marc Alexander Lehmann, and
37  
-    dual-licensed under the MIT license and GPL2.
38  
-
39 36
   - inet_pton and inet_ntop implementations, contained in src/inet.c, are
40 37
     copyright the Internet Systems Consortium, Inc., and licensed under the ISC
41 38
     license.
27  deps/uv/Makefile
@@ -26,6 +26,12 @@ endif
26 26
 
27 27
 CPPFLAGS += -Iinclude -Iinclude/uv-private
28 28
 
  29
+ifeq (Darwin,$(uname_S))
  30
+SOEXT = dylib
  31
+else
  32
+SOEXT = so
  33
+endif
  34
+
29 35
 ifneq (,$(findstring MINGW,$(uname_S)))
30 36
 include config-mingw.mk
31 37
 else
@@ -37,32 +43,23 @@ BENCHMARKS=test/blackhole-server.c test/echo-server.c test/dns-server.c test/ben
37 43
 
38 44
 all: libuv.a
39 45
 
40  
-test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) libuv.a
41  
-	$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-tests test/run-tests.c \
42  
-		test/runner.c $(RUNNER_SRC) $(TESTS) libuv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
  46
+test/run-tests$(E): test/run-tests.c test/runner.c $(RUNNER_SRC) $(TESTS) libuv.$(SOEXT)
  47
+	$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
43 48
 
44  
-test/run-benchmarks$(E): test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) libuv.a
45  
-	$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-benchmarks test/run-benchmarks.c \
46  
-		 test/runner.c $(RUNNER_SRC) $(BENCHMARKS) libuv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
  49
+test/run-benchmarks$(E): test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) libuv.$(SOEXT)
  50
+	$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
47 51
 
48 52
 test/echo.o: test/echo.c test/echo.h
49  
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o
50 53
 
51 54
 
52 55
 .PHONY: clean clean-platform distclean distclean-platform test bench
53 56
 
54 57
 
55 58
 test: test/run-tests$(E)
56  
-	test/run-tests
57  
-
58  
-#test-%:	test/run-tests$(E)
59  
-#	test/run-tests $(@:test-%=%)
  59
+	$<
60 60
 
61 61
 bench: test/run-benchmarks$(E)
62  
-	test/run-benchmarks
63  
-
64  
-#bench-%:	test/run-benchmarks$(E)
65  
-#	test/run-benchmarks $(@:bench-%=%)
  62
+	$<
66 63
 
67 64
 clean: clean-platform
68 65
 	$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
4  deps/uv/README.md
Source Rendered
... ...
@@ -1,8 +1,8 @@
1 1
 # libuv [![Build Status](https://secure.travis-ci.org/joyent/libuv.png)](http://travis-ci.org/joyent/libuv)
2 2
 
3 3
 libuv is a new platform layer for Node. Its purpose is to abstract IOCP on
4  
-Windows and libev on Unix systems. We intend to eventually contain all
5  
-platform differences in this library.
  4
+Windows and epoll/kqueue/event ports/etc. on Unix systems. We intend to
  5
+eventually contain all platform differences in this library.
6 6
 
7 7
 http://nodejs.org/
8 8
 
33  deps/uv/config-unix.mk
@@ -21,12 +21,16 @@
21 21
 E=
22 22
 CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
23 23
 CFLAGS += -g
24  
-CPPFLAGS += -Isrc -Isrc/unix/ev
  24
+CPPFLAGS += -Isrc
25 25
 LINKFLAGS=-lm
26 26
 
27 27
 CPPFLAGS += -D_LARGEFILE_SOURCE
28 28
 CPPFLAGS += -D_FILE_OFFSET_BITS=64
29 29
 
  30
+RUNNER_SRC=test/runner-unix.c
  31
+RUNNER_CFLAGS=$(CFLAGS) -Itest
  32
+RUNNER_LINKFLAGS=-L"$(PWD)" -luv -Xlinker -rpath -Xlinker "$(PWD)"
  33
+
30 34
 OBJS += src/unix/async.o
31 35
 OBJS += src/unix/core.o
32 36
 OBJS += src/unix/dl.o
@@ -46,11 +50,16 @@ OBJS += src/unix/threadpool.o
46 50
 OBJS += src/unix/timer.o
47 51
 OBJS += src/unix/tty.o
48 52
 OBJS += src/unix/udp.o
  53
+OBJS += src/fs-poll.o
  54
+OBJS += src/uv-common.o
  55
+OBJS += src/inet.o
49 56
 
50 57
 ifeq (SunOS,$(uname_S))
51 58
 EV_CONFIG=config_sunos.h
52 59
 CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
53 60
 LINKFLAGS+=-lkstat -lnsl -lsendfile -lsocket
  61
+# Library dependencies are not transitive.
  62
+RUNNER_LINKFLAGS += $(LINKFLAGS)
54 63
 OBJS += src/unix/sunos.o
55 64
 endif
56 65
 
@@ -64,7 +73,8 @@ endif
64 73
 ifeq (Darwin,$(uname_S))
65 74
 EV_CONFIG=config_darwin.h
66 75
 CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
67  
-LINKFLAGS+=-framework CoreServices
  76
+LINKFLAGS+=-framework CoreServices -dynamiclib -install_name "@rpath/libuv.dylib"
  77
+SOEXT = dylib
68 78
 OBJS += src/unix/darwin.o
69 79
 OBJS += src/unix/kqueue.o
70 80
 OBJS += src/unix/fsevents.o
@@ -74,6 +84,7 @@ ifeq (Linux,$(uname_S))
74 84
 EV_CONFIG=config_linux.h
75 85
 CSTDFLAG += -D_GNU_SOURCE
76 86
 LINKFLAGS+=-ldl -lrt
  87
+RUNNER_CFLAGS += -D_GNU_SOURCE
77 88
 OBJS += src/unix/linux/linux-core.o \
78 89
         src/unix/linux/inotify.o    \
79 90
         src/unix/linux/syscalls.o
@@ -115,39 +126,31 @@ LINKFLAGS+=
115 126
 OBJS += src/unix/cygwin.o
116 127
 endif
117 128
 
118  
-# Need _GNU_SOURCE for strdup?
119  
-RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE
120  
-RUNNER_LINKFLAGS=$(LINKFLAGS)
121  
-
122 129
 ifeq (SunOS,$(uname_S))
123 130
 RUNNER_LINKFLAGS += -pthreads
124 131
 else
125 132
 RUNNER_LINKFLAGS += -pthread
126 133
 endif
127 134
 
128  
-RUNNER_LIBS=
129  
-RUNNER_SRC=test/runner-unix.c
130  
-
131  
-libuv.a: $(OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/unix/ev/ev.o
  135
+libuv.a: $(OBJS)
132 136
 	$(AR) rcs $@ $^
133 137
 
  138
+libuv.$(SOEXT):	CFLAGS += -fPIC
  139
+libuv.$(SOEXT):	$(OBJS)
  140
+	$(CC) -shared -o $@ $^ $(LINKFLAGS)
  141
+
134 142
 src/%.o: src/%.c include/uv.h include/uv-private/uv-unix.h
135 143
 	$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
136 144
 
137 145
 src/unix/%.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h
138 146
 	$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
139 147
 
140  
-src/unix/ev/ev.o: src/unix/ev/ev.c
141  
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c src/unix/ev/ev.c -o src/unix/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"
142  
-
143 148
 clean-platform:
144 149
 	-rm -f src/unix/*.o
145  
-	-rm -f src/unix/ev/*.o
146 150
 	-rm -f src/unix/linux/*.o
147 151
 	-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
148 152
 
149 153
 distclean-platform:
150 154
 	-rm -f src/unix/*.o
151  
-	-rm -f src/unix/ev/*.o
152 155
 	-rm -f src/unix/linux/*.o
153 156
 	-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
7  deps/uv/gyp_uv
@@ -72,13 +72,14 @@ if __name__ == '__main__':
72 72
     args.append('-Dgcc_version=%d' % (10 * major + minor))
73 73
     args.append('-Dclang=%d' % int(is_clang))
74 74
 
75  
-  if not any(a.startswith('-Dtarget_arch') for a in args):
  75
+  if not any(a.startswith('-Dtarget_arch=') for a in args):
76 76
     args.append('-Dtarget_arch=ia32')
77 77
 
78  
-  if not any(a.startswith('-Dlibrary') for a in args):
  78
+  if not any(a.startswith('-Dlibrary=') for a in args):
79 79
     args.append('-Dlibrary=static_library')
80 80
 
81  
-  args.append('-Dcomponent=static_library')
  81
+  if not any(a.startswith('-Dcomponent=') for a in args):
  82
+    args.append('-Dcomponent=static_library')
82 83
 
83 84
   gyp_args = list(args)
84 85
   print gyp_args
838  deps/uv/include/uv-private/ev.h
... ...
@@ -1,838 +0,0 @@
1  
-/*
2  
- * libev native API header
3  
- *
4  
- * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
5  
- * All rights reserved.
6  
- *
7  
- * Redistribution and use in source and binary forms, with or without modifica-
8  
- * tion, are permitted provided that the following conditions are met:
9  
- *
10  
- *   1.  Redistributions of source code must retain the above copyright notice,
11  
- *       this list of conditions and the following disclaimer.
12  
- *
13  
- *   2.  Redistributions in binary form must reproduce the above copyright
14  
- *       notice, this list of conditions and the following disclaimer in the
15  
- *       documentation and/or other materials provided with the distribution.
16  
- *
17  
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
18  
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
19  
- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
20  
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
21  
- * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22  
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23  
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
25  
- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
26  
- * OF THE POSSIBILITY OF SUCH DAMAGE.
27  
- *
28  
- * Alternatively, the contents of this file may be used under the terms of
29  
- * the GNU General Public License ("GPL") version 2 or any later version,
30  
- * in which case the provisions of the GPL are applicable instead of
31  
- * the above. If you wish to allow the use of your version of this file
32  
- * only under the terms of the GPL and not to allow others to use your
33  
- * version of this file under the BSD license, indicate your decision
34  
- * by deleting the provisions above and replace them with the notice
35  
- * and other provisions required by the GPL. If you do not delete the
36  
- * provisions above, a recipient may use your version of this file under
37  
- * either the BSD or the GPL.
38  
- */
39  
-
40  
-#ifndef EV_H_
41  
-#define EV_H_
42  
-
43  
-#ifdef __cplusplus
44  
-# define EV_CPP(x) x
45  
-#else
46  
-# define EV_CPP(x)
47  
-#endif
48  
-
49  
-EV_CPP(extern "C" {)
50  
-
51  
-#ifdef __GNUC__
52  
-# define EV_MAYBE_UNUSED __attribute__ ((unused))
53  
-#else
54  
-# define EV_MAYBE_UNUSED
55  
-#endif
56  
-
57  
-/*****************************************************************************/
58  
-
59  
-/* pre-4.0 compatibility */
60  
-#ifndef EV_COMPAT3
61  
-# define EV_COMPAT3 1
62  
-#endif
63  
-
64  
-#ifndef EV_FEATURES
65  
-# define EV_FEATURES 0x7f
66  
-#endif
67  
-
68  
-#define EV_FEATURE_CODE     ((EV_FEATURES) &  1)
69  
-#define EV_FEATURE_DATA     ((EV_FEATURES) &  2)
70  
-#define EV_FEATURE_CONFIG   ((EV_FEATURES) &  4)
71  
-#define EV_FEATURE_API      ((EV_FEATURES) &  8)
72  
-#define EV_FEATURE_WATCHERS ((EV_FEATURES) & 16)
73  
-#define EV_FEATURE_BACKENDS ((EV_FEATURES) & 32)
74  
-#define EV_FEATURE_OS       ((EV_FEATURES) & 64)
75  
-
76  
-/* these priorities are inclusive, higher priorities will be invoked earlier */
77  
-#ifndef EV_MINPRI
78  
-# define EV_MINPRI (EV_FEATURE_CONFIG ? -2 : 0)
79  
-#endif
80  
-#ifndef EV_MAXPRI
81  
-# define EV_MAXPRI (EV_FEATURE_CONFIG ? +2 : 0)
82  
-#endif
83  
-
84  
-#ifndef EV_MULTIPLICITY
85  
-# define EV_MULTIPLICITY EV_FEATURE_CONFIG
86  
-#endif
87  
-
88  
-#ifndef EV_PERIODIC_ENABLE
89  
-# define EV_PERIODIC_ENABLE EV_FEATURE_WATCHERS
90  
-#endif
91  
-
92  
-#ifndef EV_STAT_ENABLE
93  
-# define EV_STAT_ENABLE EV_FEATURE_WATCHERS
94  
-#endif
95  
-
96  
-#ifndef EV_PREPARE_ENABLE
97  
-# define EV_PREPARE_ENABLE EV_FEATURE_WATCHERS
98  
-#endif
99  
-
100  
-#ifndef EV_CHECK_ENABLE
101  
-# define EV_CHECK_ENABLE EV_FEATURE_WATCHERS
102  
-#endif
103  
-
104  
-#ifndef EV_IDLE_ENABLE
105  
-# define EV_IDLE_ENABLE EV_FEATURE_WATCHERS
106  
-#endif
107  
-
108  
-#ifndef EV_FORK_ENABLE
109  
-# define EV_FORK_ENABLE EV_FEATURE_WATCHERS
110  
-#endif
111  
-
112  
-#ifndef EV_CLEANUP_ENABLE
113  
-# define EV_CLEANUP_ENABLE EV_FEATURE_WATCHERS
114  
-#endif
115  
-
116  
-#ifndef EV_SIGNAL_ENABLE
117  
-# define EV_SIGNAL_ENABLE EV_FEATURE_WATCHERS
118  
-#endif
119  
-
120  
-#ifndef EV_CHILD_ENABLE
121  
-# ifdef _WIN32
122  
-#  define EV_CHILD_ENABLE 0
123  
-# else
124  
-#  define EV_CHILD_ENABLE EV_FEATURE_WATCHERS
125  
-#endif
126  
-#endif
127  
-
128  
-#ifndef EV_ASYNC_ENABLE
129  
-# define EV_ASYNC_ENABLE EV_FEATURE_WATCHERS
130  
-#endif
131  
-
132  
-#ifndef EV_EMBED_ENABLE
133  
-# define EV_EMBED_ENABLE EV_FEATURE_WATCHERS
134  
-#endif
135  
-
136  
-#ifndef EV_WALK_ENABLE
137  
-# define EV_WALK_ENABLE 0 /* not yet */
138  
-#endif
139  
-
140  
-/*****************************************************************************/
141  
-
142  
-#if EV_CHILD_ENABLE && !EV_SIGNAL_ENABLE
143  
-# undef EV_SIGNAL_ENABLE
144  
-# define EV_SIGNAL_ENABLE 1
145  
-#endif
146  
-
147  
-/*****************************************************************************/
148  
-
149  
-typedef double ev_tstamp;
150  
-
151  
-#ifndef EV_ATOMIC_T
152  
-# include <signal.h>
153  
-# define EV_ATOMIC_T sig_atomic_t volatile
154  
-#endif
155  
-
156  
-#if EV_STAT_ENABLE
157  
-# ifdef _WIN32
158  
-#  include <time.h>
159  
-#  include <sys/types.h>
160  
-# endif
161  
-# include <sys/stat.h>
162  
-#endif
163  
-
164  
-/* support multiple event loops? */
165  
-#if EV_MULTIPLICITY
166  
-struct ev_loop;
167  
-# define EV_P  struct ev_loop *loop               /* a loop as sole parameter in a declaration */
168  
-# define EV_P_ EV_P,                              /* a loop as first of multiple parameters */
169  
-# define EV_A  loop                               /* a loop as sole argument to a function call */
170  
-# define EV_A_ EV_A,                              /* a loop as first of multiple arguments */
171  
-# define EV_DEFAULT_UC  ev_default_loop_uc_ ()    /* the default loop, if initialised, as sole arg */
172  
-# define EV_DEFAULT_UC_ EV_DEFAULT_UC,            /* the default loop as first of multiple arguments */
173  
-# define EV_DEFAULT  ev_default_loop (0)          /* the default loop as sole arg */
174  
-# define EV_DEFAULT_ EV_DEFAULT,                  /* the default loop as first of multiple arguments */
175  
-#else
176  
-# define EV_P void
177  
-# define EV_P_
178  
-# define EV_A
179  
-# define EV_A_
180  
-# define EV_DEFAULT
181  
-# define EV_DEFAULT_
182  
-# define EV_DEFAULT_UC
183  
-# define EV_DEFAULT_UC_
184  
-# undef EV_EMBED_ENABLE
185  
-#endif
186  
-
187  
-/* EV_INLINE is used for functions in header files */
188  
-#if __STDC_VERSION__ >= 199901L && __GNUC__ >= 3
189  
-# define EV_INLINE static inline
190  
-#else
191  
-# define EV_INLINE static
192  
-#endif
193  
-
194  
-/* EV_PROTOTYPES can be used to switch of prototype declarations */
195  
-#ifndef EV_PROTOTYPES
196  
-# define EV_PROTOTYPES 1
197  
-#endif
198  
-
199  
-/*****************************************************************************/
200  
-
201  
-#define EV_VERSION_MAJOR 4
202  
-#define EV_VERSION_MINOR 4
203  
-
204  
-/* eventmask, revents, events... */
205  
-enum {
206  
-  EV_UNDEF    =         -1, /* guaranteed to be invalid */
207  
-  EV_NONE     =       0x00, /* no events */
208  
-  EV_READ     =       0x01, /* ev_io detected read will not block */
209  
-  EV_WRITE    =       0x02, /* ev_io detected write will not block */
210  
-  EV_LIBUV_KQUEUE_HACK = 0x40,
211  
-  EV__IOFDSET =       0x80, /* internal use only */
212  
-  EV_IO       =    EV_READ, /* alias for type-detection */
213  
-  EV_TIMER    = 0x00000100, /* timer timed out */
214  
-#if EV_COMPAT3
215  
-  EV_TIMEOUT  =   EV_TIMER, /* pre 4.0 API compatibility */
216  
-#endif
217  
-  EV_PERIODIC = 0x00000200, /* periodic timer timed out */
218  
-  EV_SIGNAL   = 0x00000400, /* signal was received */
219  
-  EV_CHILD    = 0x00000800, /* child/pid had status change */
220  
-  EV_STAT     = 0x00001000, /* stat data changed */
221  
-  EV_IDLE     = 0x00002000, /* event loop is idling */
222  
-  EV_PREPARE  = 0x00004000, /* event loop about to poll */
223  
-  EV_CHECK    = 0x00008000, /* event loop finished poll */
224  
-  EV_EMBED    = 0x00010000, /* embedded event loop needs sweep */
225  
-  EV_FORK     = 0x00020000, /* event loop resumed in child */
226  
-  EV_CLEANUP  = 0x00040000, /* event loop resumed in child */
227  
-  EV_ASYNC    = 0x00080000, /* async intra-loop signal */
228  
-  EV_CUSTOM   = 0x01000000, /* for use by user code */
229  
-  EV_ERROR    = (-2147483647 - 1) /* sent when an error occurs */
230  
-};
231  
-
232  
-/* can be used to add custom fields to all watchers, while losing binary compatibility */
233  
-#ifndef EV_COMMON
234  
-# define EV_COMMON void *data;
235  
-#endif
236  
-
237  
-#ifndef EV_CB_DECLARE
238  
-# define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents);
239  
-#endif
240  
-#ifndef EV_CB_INVOKE
241  
-# define EV_CB_INVOKE(watcher,revents) (watcher)->cb (EV_A_ (watcher), (revents))
242  
-#endif
243  
-
244  
-/* not official, do not use */
245  
-#define EV_CB(type,name) void name (EV_P_ struct ev_ ## type *w, int revents)
246  
-
247  
-/*
248  
- * struct member types:
249  
- * private: you may look at them, but not change them,
250  
- *          and they might not mean anything to you.
251  
- * ro: can be read anytime, but only changed when the watcher isn't active.
252  
- * rw: can be read and modified anytime, even when the watcher is active.
253  
- *
254  
- * some internal details that might be helpful for debugging:
255  
- *
256  
- * active is either 0, which means the watcher is not active,
257  
- *           or the array index of the watcher (periodics, timers)
258  
- *           or the array index + 1 (most other watchers)
259  
- *           or simply 1 for watchers that aren't in some array.
260  
- * pending is either 0, in which case the watcher isn't,
261  
- *           or the array index + 1 in the pendings array.
262  
- */
263  
-
264  
-#if EV_MINPRI == EV_MAXPRI
265  
-# define EV_DECL_PRIORITY
266  
-#elif !defined (EV_DECL_PRIORITY)
267  
-# define EV_DECL_PRIORITY int priority;
268  
-#endif
269  
-
270  
-/* shared by all watchers */
271  
-#define EV_WATCHER(type)			\
272  
-  int active; /* private */			\
273  
-  int pending; /* private */			\
274  
-  EV_DECL_PRIORITY /* private */		\
275  
-  EV_COMMON /* rw */				\
276  
-  EV_CB_DECLARE (type) /* private */
277  
-
278  
-#define EV_WATCHER_LIST(type)			\
279  
-  EV_WATCHER (type)				\
280  
-  struct ev_watcher_list *next; /* private */
281  
-
282  
-#define EV_WATCHER_TIME(type)			\
283  
-  EV_WATCHER (type)				\
284  
-  ev_tstamp at;     /* private */
285  
-
286  
-/* base class, nothing to see here unless you subclass */
287  
-typedef struct ev_watcher
288  
-{
289  
-  EV_WATCHER (ev_watcher)
290  
-} ev_watcher;
291  
-
292  
-/* base class, nothing to see here unless you subclass */
293  
-typedef struct ev_watcher_list
294  
-{
295  
-  EV_WATCHER_LIST (ev_watcher_list)
296  
-} ev_watcher_list;
297  
-
298  
-/* base class, nothing to see here unless you subclass */
299  
-typedef struct ev_watcher_time
300  
-{
301  
-  EV_WATCHER_TIME (ev_watcher_time)
302  
-} ev_watcher_time;
303  
-
304  
-/* invoked when fd is either EV_READable or EV_WRITEable */
305  
-/* revent EV_READ, EV_WRITE */
306  
-typedef struct ev_io
307  
-{
308  
-  EV_WATCHER_LIST (ev_io)
309  
-
310  
-  int fd;     /* ro */
311  
-  int events; /* ro */
312  
-} ev_io;
313  
-
314  
-/* invoked after a specific time, repeatable (based on monotonic clock) */
315  
-/* revent EV_TIMEOUT */
316  
-typedef struct ev_timer
317  
-{
318  
-  EV_WATCHER_TIME (ev_timer)
319  
-
320  
-  ev_tstamp repeat; /* rw */
321  
-} ev_timer;
322  
-
323  
-/* invoked at some specific time, possibly repeating at regular intervals (based on UTC) */
324  
-/* revent EV_PERIODIC */
325  
-typedef struct ev_periodic
326  
-{
327  
-  EV_WATCHER_TIME (ev_periodic)
328  
-
329  
-  ev_tstamp offset; /* rw */
330  
-  ev_tstamp interval; /* rw */
331  
-  ev_tstamp (*reschedule_cb)(struct ev_periodic *w, ev_tstamp now); /* rw */
332  
-} ev_periodic;
333  
-
334  
-/* invoked when the given signal has been received */
335  
-/* revent EV_SIGNAL */
336  
-typedef struct ev_signal
337  
-{
338  
-  EV_WATCHER_LIST (ev_signal)
339  
-
340  
-  int signum; /* ro */
341  
-} ev_signal;
342  
-
343  
-/* invoked when sigchld is received and waitpid indicates the given pid */
344  
-/* revent EV_CHILD */
345  
-/* does not support priorities */
346  
-typedef struct ev_child
347  
-{
348  
-  EV_WATCHER_LIST (ev_child)
349  
-
350  
-  int flags;   /* private */
351  
-  int pid;     /* ro */
352  
-  int rpid;    /* rw, holds the received pid */
353  
-  int rstatus; /* rw, holds the exit status, use the macros from sys/wait.h */
354  
-} ev_child;
355  
-
356  
-#if EV_STAT_ENABLE
357  
-/* st_nlink = 0 means missing file or other error */
358  
-# ifdef _WIN32
359  
-typedef struct _stati64 ev_statdata;
360  
-# else
361  
-typedef struct stat ev_statdata;
362  
-# endif
363  
-
364  
-/* invoked each time the stat data changes for a given path */
365  
-/* revent EV_STAT */
366  
-typedef struct ev_stat
367  
-{
368  
-  EV_WATCHER_LIST (ev_stat)
369  
-
370  
-  ev_timer timer;     /* private */
371  
-  ev_tstamp interval; /* ro */
372  
-  const char *path;   /* ro */
373  
-  ev_statdata prev;   /* ro */
374  
-  ev_statdata attr;   /* ro */
375  
-
376  
-  int wd; /* wd for inotify, fd for kqueue */
377  
-} ev_stat;
378  
-#endif
379  
-
380  
-#if EV_IDLE_ENABLE
381  
-/* invoked when the nothing else needs to be done, keeps the process from blocking */
382  
-/* revent EV_IDLE */
383  
-typedef struct ev_idle
384  
-{
385  
-  EV_WATCHER (ev_idle)
386  
-} ev_idle;
387  
-#endif
388  
-
389  
-/* invoked for each run of the mainloop, just before the blocking call */
390  
-/* you can still change events in any way you like */
391  
-/* revent EV_PREPARE */
392  
-typedef struct ev_prepare
393  
-{
394  
-  EV_WATCHER (ev_prepare)
395  
-} ev_prepare;
396  
-
397  
-/* invoked for each run of the mainloop, just after the blocking call */
398  
-/* revent EV_CHECK */
399  
-typedef struct ev_check
400  
-{
401  
-  EV_WATCHER (ev_check)
402  
-} ev_check;
403  
-
404  
-#if EV_FORK_ENABLE
405  
-/* the callback gets invoked before check in the child process when a fork was detected */
406  
-/* revent EV_FORK */
407  
-typedef struct ev_fork
408  
-{
409  
-  EV_WATCHER (ev_fork)
410  
-} ev_fork;
411  
-#endif
412  
-
413  
-#if EV_CLEANUP_ENABLE
414  
-/* is invoked just before the loop gets destroyed */
415  
-/* revent EV_CLEANUP */
416  
-typedef struct ev_cleanup
417  
-{
418  
-  EV_WATCHER (ev_cleanup)
419  
-} ev_cleanup;
420  
-#endif
421  
-
422  
-#if EV_EMBED_ENABLE
423  
-/* used to embed an event loop inside another */
424  
-/* the callback gets invoked when the event loop has handled events, and can be 0 */
425  
-typedef struct ev_embed
426  
-{
427  
-  EV_WATCHER (ev_embed)
428  
-
429  
-  struct ev_loop *other; /* ro */
430  
-  ev_io io;              /* private */
431  
-  ev_prepare prepare;    /* private */
432  
-  ev_check check;        /* unused */
433  
-  ev_timer timer;        /* unused */
434  
-  ev_periodic periodic;  /* unused */
435  
-  ev_idle idle;          /* unused */
436  
-  ev_fork fork;          /* private */
437  
-#if EV_CLEANUP_ENABLE
438  
-  ev_cleanup cleanup;    /* unused */
439  
-#endif
440  
-} ev_embed;
441  
-#endif
442  
-
443  
-#if EV_ASYNC_ENABLE
444  
-/* invoked when somebody calls ev_async_send on the watcher */
445  
-/* revent EV_ASYNC */
446  
-typedef struct ev_async
447  
-{
448  
-  EV_WATCHER (ev_async)
449  
-
450  
-  EV_ATOMIC_T sent; /* private */
451  
-} ev_async;
452  
-
453  
-# define ev_async_pending(w) (+(w)->sent)
454  
-#endif
455  
-
456  
-/* the presence of this union forces similar struct layout */
457  
-union ev_any_watcher
458  
-{
459  
-  struct ev_watcher w;
460  
-  struct ev_watcher_list wl;
461  
-
462  
-  struct ev_io io;
463  
-  struct ev_timer timer;
464  
-  struct ev_periodic periodic;
465  
-  struct ev_signal signal;
466  
-  struct ev_child child;
467  
-#if EV_STAT_ENABLE
468  
-  struct ev_stat stat;
469  
-#endif
470  
-#if EV_IDLE_ENABLE
471  
-  struct ev_idle idle;
472  
-#endif
473  
-  struct ev_prepare prepare;
474  
-  struct ev_check check;
475  
-#if EV_FORK_ENABLE
476  
-  struct ev_fork fork;
477  
-#endif
478  
-#if EV_CLEANUP_ENABLE
479  
-  struct ev_cleanup cleanup;
480  
-#endif
481  
-#if EV_EMBED_ENABLE
482  
-  struct ev_embed embed;
483  
-#endif
484  
-#if EV_ASYNC_ENABLE
485  
-  struct ev_async async;
486  
-#endif
487  
-};
488  
-
489  
-/* flag bits for ev_default_loop and ev_loop_new */
490  
-enum {
491  
-  /* the default */
492  
-  EVFLAG_AUTO      = 0x00000000U, /* not quite a mask */
493  
-  /* flag bits */
494  
-  EVFLAG_NOENV     = 0x01000000U, /* do NOT consult environment */
495  
-  EVFLAG_FORKCHECK = 0x02000000U, /* check for a fork in each iteration */
496  
-  /* debugging/feature disable */
497  
-  EVFLAG_NOINOTIFY = 0x00100000U, /* do not attempt to use inotify */
498  
-#if EV_COMPAT3
499  
-  EVFLAG_NOSIGFD   = 0, /* compatibility to pre-3.9 */
500  
-#endif
501  
-  EVFLAG_SIGNALFD  = 0x00200000U, /* attempt to use signalfd */
502  
-  EVFLAG_NOSIGMASK = 0x00400000U  /* avoid modifying the signal mask */
503  
-};
504  
-
505  
-/* method bits to be ored together */
506  
-enum {
507  
-  EVBACKEND_SELECT  = 0x00000001U, /* about anywhere */
508  
-  EVBACKEND_POLL    = 0x00000002U, /* !win */
509  
-  EVBACKEND_EPOLL   = 0x00000004U, /* linux */
510  
-  EVBACKEND_KQUEUE  = 0x00000008U, /* bsd */
511  
-  EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */
512  
-  EVBACKEND_PORT    = 0x00000020U, /* solaris 10 */
513  
-  EVBACKEND_ALL     = 0x0000003FU, /* all known backends */
514  
-  EVBACKEND_MASK    = 0x0000FFFFU  /* all future backends */
515  
-};
516  
-
517  
-#if EV_PROTOTYPES
518  
-int ev_version_major (void);
519  
-int ev_version_minor (void);
520  
-
521  
-unsigned int ev_supported_backends (void);
522  
-unsigned int ev_recommended_backends (void);
523  
-unsigned int ev_embeddable_backends (void);
524  
-
525  
-ev_tstamp ev_time (void);
526  
-void ev_sleep (ev_tstamp delay); /* sleep for a while */
527  
-
528  
-/* Sets the allocation function to use, works like realloc.
529  
- * It is used to allocate and free memory.
530  
- * If it returns zero when memory needs to be allocated, the library might abort
531  
- * or take some potentially destructive action.
532  
- * The default is your system realloc function.
533  
- */
534  
-void ev_set_allocator (void *(*cb)(void *ptr, long size));
535  
-
536  
-/* set the callback function to call on a
537  
- * retryable syscall error
538  
- * (such as failed select, poll, epoll_wait)
539  
- */
540  
-void ev_set_syserr_cb (void (*cb)(const char *msg));
541  
-
542  
-#if EV_MULTIPLICITY
543  
-
544  
-/* the default loop is the only one that handles signals and child watchers */
545  
-/* you can call this as often as you like */
546  
-struct ev_loop *ev_default_loop (unsigned int flags EV_CPP (= 0));
547  
-
548  
-EV_INLINE struct ev_loop *
549  
-EV_MAYBE_UNUSED ev_default_loop_uc_ (void)
550  
-{
551  
-  extern struct ev_loop *ev_default_loop_ptr;
552  
-
553  
-  return ev_default_loop_ptr;
554  
-}
555  
-
556  
-EV_INLINE int
557  
-EV_MAYBE_UNUSED ev_is_default_loop (EV_P)
558  
-{
559  
-  return EV_A == EV_DEFAULT_UC;
560  
-}
561  
-
562  
-/* create and destroy alternative loops that don't handle signals */
563  
-struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0));
564  
-
565  
-int ev_loop_refcount (EV_P);
566  
-
567  
-ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */
568  
-
569  
-#else
570  
-
571  
-int ev_default_loop (unsigned int flags EV_CPP (= 0)); /* returns true when successful */
572  
-
573  
-EV_INLINE ev_tstamp
574  
-ev_now (void)
575  
-{
576  
-  extern ev_tstamp ev_rt_now;
577  
-
578  
-  return ev_rt_now;
579  
-}
580  
-
581  
-/* looks weird, but ev_is_default_loop (EV_A) still works if this exists */
582  
-EV_INLINE int
583  
-ev_is_default_loop (void)
584  
-{
585  
-  return 1;
586  
-}
587  
-
588  
-#endif /* multiplicity */
589  
-
590  
-/* destroy event loops, also works for the default loop */
591  
-void ev_loop_destroy (EV_P);
592  
-
593  
-/* this needs to be called after fork, to duplicate the loop */
594  
-/* when you want to re-use it in the child */
595  
-/* you can call it in either the parent or the child */
596  
-/* you can actually call it at any time, anywhere :) */
597  
-void ev_loop_fork (EV_P);
598  
-
599  
-unsigned int ev_backend (EV_P); /* backend in use by loop */
600  
-
601  
-void ev_now_update (EV_P); /* update event loop time */
602  
-
603  
-#if EV_WALK_ENABLE
604  
-/* walk (almost) all watchers in the loop of a given type, invoking the */
605  
-/* callback on every such watcher. The callback might stop the watcher, */
606  
-/* but do nothing else with the loop */
607  
-void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w));
608  
-#endif
609  
-
610  
-#endif /* prototypes */
611  
-
612  
-/* ev_run flags values */
613  
-enum {
614  
-  EVRUN_NOWAIT = 1, /* do not block/wait */
615  
-  EVRUN_ONCE   = 2  /* block *once* only */
616  
-};
617  
-
618  
-/* ev_break how values */
619  
-enum {
620  
-  EVBREAK_CANCEL = 0, /* undo unloop */
621  
-  EVBREAK_ONE    = 1, /* unloop once */
622  
-  EVBREAK_ALL    = 2  /* unloop all loops */
623  
-};
624  
-
625  
-#if EV_PROTOTYPES
626  
-void ev_run (EV_P_ int flags EV_CPP (= 0));
627  
-void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */
628  
-
629  
-/*
630  
- * ref/unref can be used to add or remove a refcount on the mainloop. every watcher
631  
- * keeps one reference. if you have a long-running watcher you never unregister that
632  
- * should not keep ev_loop from running, unref() after starting, and ref() before stopping.
633  
- */
634  
-void ev_ref   (EV_P);
635  
-void ev_unref (EV_P);
636  
-
637  
-/*
638  
- * convenience function, wait for a single event, without registering an event watcher
639  
- * if timeout is < 0, do wait indefinitely
640  
- */
641  
-void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg);
642  
-
643  
-# if EV_FEATURE_API
644  
-unsigned int ev_iteration (EV_P); /* number of loop iterations */
645  
-unsigned int ev_depth     (EV_P); /* #ev_loop enters - #ev_loop leaves */
646  
-void         ev_verify    (EV_P); /* abort if loop data corrupted */
647  
-
648  
-void ev_set_io_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
649  
-void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
650  
-
651  
-/* advanced stuff for threading etc. support, see docs */
652  
-void ev_set_userdata (EV_P_ void *data);
653  
-void *ev_userdata (EV_P);
654  
-void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P));
655  
-void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P));
656  
-
657  
-unsigned int ev_pending_count (EV_P); /* number of pending events, if any */
658  
-void ev_invoke_pending (EV_P); /* invoke all pending watchers */
659  
-
660  
-/*
661  
- * stop/start the timer handling.
662  
- */
663  
-void ev_suspend (EV_P);
664  
-void ev_resume  (EV_P);
665  
-#endif
666  
-
667  
-#endif
668  
-
669  
-/* these may evaluate ev multiple times, and the other arguments at most once */
670  
-/* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */
671  
-#define ev_init(ev,cb_) do {			\
672  
-  ((ev_watcher *)(void *)(ev))->active  =	\
673  
-  ((ev_watcher *)(void *)(ev))->pending = 0;	\
674  
-  ev_set_priority ((ev), 0);			\
675  
-  ev_set_cb ((ev), cb_);			\
676  
-} while (0)
677  
-
678  
-#define ev_io_set(ev,fd_,events_)            do { (ev)->fd = (fd_); (ev)->events = (events_) | EV__IOFDSET; } while (0)
679  
-#define ev_timer_set(ev,after_,repeat_)      do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
680  
-#define ev_periodic_set(ev,ofs_,ival_,rcb_)  do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb = (rcb_); } while (0)
681  
-#define ev_signal_set(ev,signum_)            do { (ev)->signum = (signum_); } while (0)
682  
-#define ev_child_set(ev,pid_,trace_)         do { (ev)->pid = (pid_); (ev)->flags = !!(trace_); } while (0)
683  
-#define ev_stat_set(ev,path_,interval_)      do { (ev)->path = (path_); (ev)->interval = (interval_); (ev)->wd = -2; } while (0)
684  
-#define ev_idle_set(ev)                      /* nop, yes, this is a serious in-joke */
685  
-#define ev_prepare_set(ev)                   /* nop, yes, this is a serious in-joke */
686  
-#define ev_check_set(ev)                     /* nop, yes, this is a serious in-joke */
687  
-#define ev_embed_set(ev,other_)              do { (ev)->other = (other_); } while (0)
688  
-#define ev_fork_set(ev)                      /* nop, yes, this is a serious in-joke */
689  
-#define ev_cleanup_set(ev)                   /* nop, yes, this is a serious in-joke */
690  
-#define ev_async_set(ev)                     /* nop, yes, this is a serious in-joke */
691  
-
692  
-#define ev_io_init(ev,cb,fd,events)          do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0)
693  
-#define ev_timer_init(ev,cb,after,repeat)    do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0)
694  
-#define ev_periodic_init(ev,cb,ofs,ival,rcb) do { ev_init ((ev), (cb)); ev_periodic_set ((ev),(ofs),(ival),(rcb)); } while (0)
695  
-#define ev_signal_init(ev,cb,signum)         do { ev_init ((ev), (cb)); ev_signal_set ((ev), (signum)); } while (0)
696  
-#define ev_child_init(ev,cb,pid,trace)       do { ev_init ((ev), (cb)); ev_child_set ((ev),(pid),(trace)); } while (0)
697  
-#define ev_stat_init(ev,cb,path,interval)    do { ev_init ((ev), (cb)); ev_stat_set ((ev),(path),(interval)); } while (0)
698  
-#define ev_idle_init(ev,cb)                  do { ev_init ((ev), (cb)); ev_idle_set ((ev)); } while (0)
699  
-#define ev_prepare_init(ev,cb)               do { ev_init ((ev), (cb)); ev_prepare_set ((ev)); } while (0)
700  
-#define ev_check_init(ev,cb)                 do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0)
701  
-#define ev_embed_init(ev,cb,other)           do { ev_init ((ev), (cb)); ev_embed_set ((ev),(other)); } while (0)
702  
-#define ev_fork_init(ev,cb)                  do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0)
703  
-#define ev_cleanup_init(ev,cb)               do { ev_init ((ev), (cb)); ev_cleanup_set ((ev)); } while (0)
704  
-#define ev_async_init(ev,cb)                 do { ev_init ((ev), (cb)); ev_async_set ((ev)); } while (0)
705  
-
706  
-#define ev_is_pending(ev)                    (0 + ((ev_watcher *)(void *)(ev))->pending) /* ro, true when watcher is waiting for callback invocation */
707  
-#define ev_is_active(ev)                     (0 + ((ev_watcher *)(void *)(ev))->active) /* ro, true when the watcher has been started */
708  
-
709  
-#define ev_cb(ev)                            (ev)->cb /* rw */
710  
-
711  
-#if EV_MINPRI == EV_MAXPRI
712  
-# define ev_priority(ev)                     ((ev), EV_MINPRI)
713  
-# define ev_set_priority(ev,pri)             ((ev), (pri))
714  
-#else
715  
-# define ev_priority(ev)                     (+(((ev_watcher *)(void *)(ev))->priority))
716  
-# define ev_set_priority(ev,pri)             (   (ev_watcher *)(void *)(ev))->priority = (pri)
717  
-#endif
718  
-
719  
-#define ev_periodic_at(ev)                   (+((ev_watcher_time *)(ev))->at)
720  
-
721  
-#ifndef ev_set_cb
722  
-# define ev_set_cb(ev,cb_)                   ev_cb (ev) = (cb_)
723  
-#endif
724  
-
725  
-/* stopping (enabling, adding) a watcher does nothing if it is already running */
726  
-/* stopping (disabling, deleting) a watcher does nothing unless its already running */
727  
-#if EV_PROTOTYPES
728  
-
729  
-/* feeds an event into a watcher as if the event actually occured */
730  
-/* accepts any ev_watcher type */
731  
-void ev_feed_event     (EV_P_ void *w, int revents);
732  
-void ev_feed_fd_event  (EV_P_ int fd, int revents);
733  
-#if EV_SIGNAL_ENABLE
734  
-void ev_feed_signal    (int signum);
735  
-void ev_feed_signal_event (EV_P_ int signum);
736  
-#endif
737  
-void ev_invoke         (EV_P_ void *w, int revents);
738  
-int  ev_clear_pending  (EV_P_ void *w);
739  
-
740  
-void ev_io_start       (EV_P_ ev_io *w);
741  
-void ev_io_stop        (EV_P_ ev_io *w);
742  
-
743  
-void ev_timer_start    (EV_P_ ev_timer *w);
744  
-void ev_timer_stop     (EV_P_ ev_timer *w);
745  
-/* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */
746  
-void ev_timer_again    (EV_P_ ev_timer *w);
747  
-/* return remaining time */
748  
-ev_tstamp ev_timer_remaining (EV_P_ ev_timer *w);
749  
-
750  
-#if EV_PERIODIC_ENABLE
751  
-void ev_periodic_start (EV_P_ ev_periodic *w);
752  
-void ev_periodic_stop  (EV_P_ ev_periodic *w);
753  
-void ev_periodic_again (EV_P_ ev_periodic *w);
754  
-#endif
755  
-
756  
-/* only supported in the default loop */
757  
-#if EV_SIGNAL_ENABLE
758  
-void ev_signal_start   (EV_P_ ev_signal *w);
759  
-void ev_signal_stop    (EV_P_ ev_signal *w);
760  
-#endif
761  
-
762  
-/* only supported in the default loop */
763  
-# if EV_CHILD_ENABLE
764  
-void ev_child_start    (EV_P_ ev_child *w);
765  
-void ev_child_stop     (EV_P_ ev_child *w);
766  
-# endif
767  
-
768  
-# if EV_STAT_ENABLE
769  
-void ev_stat_start     (EV_P_ ev_stat *w);
770  
-void ev_stat_stop      (EV_P_ ev_stat *w);
771  
-void ev_stat_stat      (EV_P_ ev_stat *w);
772  
-# endif
773  
-
774  
-# if EV_IDLE_ENABLE
775  
-void ev_idle_start     (EV_P_ ev_idle *w);
776  
-void ev_idle_stop      (EV_P_ ev_idle *w);
777  
-# endif
778  
-
779  
-#if EV_PREPARE_ENABLE
780  
-void ev_prepare_start  (EV_P_ ev_prepare *w);
781  
-void ev_prepare_stop   (EV_P_ ev_prepare *w);
782  
-#endif
783  
-
784  
-#if EV_CHECK_ENABLE
785  
-void ev_check_start    (EV_P_ ev_check *w);
786  
-void ev_check_stop     (EV_P_ ev_check *w);
787  
-#endif
788  
-
789  
-# if EV_FORK_ENABLE
790  
-void ev_fork_start     (EV_P_ ev_fork *w);
791  
-void ev_fork_stop      (EV_P_ ev_fork *w);
792  
-# endif
793  
-
794  
-# if EV_CLEANUP_ENABLE
795  
-void ev_cleanup_start  (EV_P_ ev_cleanup *w);
796  
-void ev_cleanup_stop   (EV_P_ ev_cleanup *w);
797  
-# endif
798  
-
799  
-# if EV_EMBED_ENABLE
800  
-/* only supported when loop to be embedded is in fact embeddable */
801  
-void ev_embed_start    (EV_P_ ev_embed *w);
802  
-void ev_embed_stop     (EV_P_ ev_embed *w);
803  
-void ev_embed_sweep    (EV_P_ ev_embed *w);
804  
-# endif
805  
-
806  
-# if EV_ASYNC_ENABLE
807  
-void ev_async_start    (EV_P_ ev_async *w);
808  
-void ev_async_stop     (EV_P_ ev_async *w);
809  
-void ev_async_send     (EV_P_ ev_async *w);
810  
-# endif
811  
-
812  
-#if EV_COMPAT3
813  
-  #define EVLOOP_NONBLOCK EVRUN_NOWAIT
814  
-  #define EVLOOP_ONESHOT  EVRUN_ONCE
815  
-  #define EVUNLOOP_CANCEL EVBREAK_CANCEL
816  
-  #define EVUNLOOP_ONE    EVBREAK_ONE
817  
-  #define EVUNLOOP_ALL    EVBREAK_ALL
818  
-  #if EV_PROTOTYPES
819  
-    EV_INLINE void EV_MAYBE_UNUSED ev_loop   (EV_P_ int flags) { ev_run   (EV_A_ flags); }
820  
-    EV_INLINE void EV_MAYBE_UNUSED ev_unloop (EV_P_ int how  ) { ev_break (EV_A_ how  ); }
821  
-    EV_INLINE void EV_MAYBE_UNUSED ev_default_destroy (void) { ev_loop_destroy (EV_DEFAULT); }
822  
-    EV_INLINE void EV_MAYBE_UNUSED ev_default_fork    (void) { ev_loop_fork    (EV_DEFAULT); }
823  
-    #if EV_FEATURE_API
824  
-      EV_INLINE unsigned int EV_MAYBE_UNUSED ev_loop_count  (EV_P) { return ev_iteration  (EV_A); }
825  
-      EV_INLINE unsigned int EV_MAYBE_UNUSED ev_loop_depth  (EV_P) { return ev_depth      (EV_A); }
826  
-      EV_INLINE void         EV_MAYBE_UNUSED ev_loop_verify (EV_P) {        ev_verify     (EV_A); }
827  
-    #endif
828  
-  #endif
829  
-#else
830  
-  typedef struct ev_loop ev_loop;
831  
-#endif
832  
-
833  
-#endif
834  
-
835  
-EV_CPP(})
836  
-
837  
-#endif
838  
-
4  deps/uv/include/uv-private/uv-bsd.h
@@ -23,8 +23,6 @@
23 23
 #define UV_BSD_H
24 24
 
25 25
 #define UV_PLATFORM_FS_EVENT_FIELDS                                           \
26  
-  ev_io event_watcher;                                                        \
27  
-  int fflags;                                                                 \
28  
-  int fd;                                                                     \
  26
+  uv__io_t event_watcher;                                                     \
29 27
 
30 28
 #endif /* UV_BSD_H */
4  deps/uv/include/uv-private/uv-darwin.h
@@ -39,9 +39,7 @@
39 39