koffi 2.14.1 → 2.15.0

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 (102) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/koffi/darwin_arm64/koffi.node +0 -0
  3. package/build/koffi/darwin_x64/koffi.node +0 -0
  4. package/build/koffi/freebsd_arm64/koffi.node +0 -0
  5. package/build/koffi/freebsd_ia32/koffi.node +0 -0
  6. package/build/koffi/freebsd_x64/koffi.node +0 -0
  7. package/build/koffi/linux_arm64/koffi.node +0 -0
  8. package/build/koffi/linux_armhf/koffi.node +0 -0
  9. package/build/koffi/linux_ia32/koffi.node +0 -0
  10. package/build/koffi/linux_loong64/koffi.node +0 -0
  11. package/build/koffi/linux_riscv64d/koffi.node +0 -0
  12. package/build/koffi/linux_x64/koffi.node +0 -0
  13. package/build/koffi/musl_arm64/koffi.node +0 -0
  14. package/build/koffi/musl_x64/koffi.node +0 -0
  15. package/build/koffi/openbsd_ia32/koffi.node +0 -0
  16. package/build/koffi/openbsd_x64/koffi.node +0 -0
  17. package/build/koffi/win32_arm64/koffi.node +0 -0
  18. package/build/koffi/win32_ia32/koffi.node +0 -0
  19. package/build/koffi/win32_x64/koffi.node +0 -0
  20. package/doc/assets.ini +2 -1
  21. package/doc/build.sh +9 -0
  22. package/doc/pages/404.md +17 -0
  23. package/doc/pages/index.md +1 -1
  24. package/doc/pages/misc.md +16 -11
  25. package/doc/pages.ini +4 -0
  26. package/doc/static/highlight.js +2 -14
  27. package/doc/static/koffi.css +3 -15
  28. package/doc/static/print.css +2 -14
  29. package/index.d.ts +29 -24
  30. package/index.js +8 -8
  31. package/indirect.js +8 -8
  32. package/{src/core → lib/native}/base/base.cc +1058 -630
  33. package/{src/core → lib/native}/base/base.hh +334 -165
  34. package/{src/core → lib/native}/base/crc.inc +2 -20
  35. package/lib/native/base/crc_gen.py +72 -0
  36. package/{src/core → lib/native}/base/mimetypes.inc +2 -20
  37. package/{src/core → lib/native}/base/mimetypes_gen.py +2 -21
  38. package/lib/native/base/tower.cc +821 -0
  39. package/lib/native/base/tower.hh +81 -0
  40. package/{src/core → lib/native}/base/unicode.inc +2 -20
  41. package/{src/core → lib/native}/base/unicode_gen.py +4 -41
  42. package/package.json +1 -1
  43. package/src/cnoke/assets/FindCNoke.cmake +8 -20
  44. package/src/cnoke/assets/win_delay_hook.c +2 -20
  45. package/src/cnoke/cnoke.js +2 -21
  46. package/src/cnoke/src/builder.js +2 -20
  47. package/src/cnoke/src/index.js +2 -20
  48. package/src/cnoke/src/tools.js +2 -20
  49. package/src/koffi/CMakeLists.txt +19 -22
  50. package/src/koffi/cmake/raylib.cmake +5 -22
  51. package/src/koffi/cmake/sqlite3.cmake +2 -20
  52. package/src/koffi/src/abi_arm32.cc +7 -25
  53. package/src/koffi/src/abi_arm32_asm.S +2 -20
  54. package/src/koffi/src/abi_arm64.cc +7 -25
  55. package/src/koffi/src/abi_arm64_asm.S +2 -20
  56. package/src/koffi/src/abi_arm64_asm.asm +2 -20
  57. package/src/koffi/src/abi_loong64.cc +2 -20
  58. package/src/koffi/src/abi_loong64_asm.S +2 -20
  59. package/src/koffi/src/abi_riscv64.cc +7 -25
  60. package/src/koffi/src/abi_riscv64_asm.S +2 -20
  61. package/src/koffi/src/abi_x64_sysv.cc +7 -25
  62. package/src/koffi/src/abi_x64_sysv_asm.S +2 -20
  63. package/src/koffi/src/abi_x64_win.cc +12 -30
  64. package/src/koffi/src/abi_x64_win_asm.asm +2 -20
  65. package/src/koffi/src/abi_x86.cc +7 -25
  66. package/src/koffi/src/abi_x86_asm.S +2 -20
  67. package/src/koffi/src/abi_x86_asm.asm +2 -20
  68. package/src/koffi/src/call.cc +25 -45
  69. package/src/koffi/src/call.hh +3 -21
  70. package/src/koffi/src/errno.inc +2 -20
  71. package/src/koffi/src/ffi.cc +62 -62
  72. package/src/koffi/src/ffi.hh +14 -29
  73. package/src/koffi/src/init.js +2 -20
  74. package/src/koffi/src/parser.cc +13 -27
  75. package/src/koffi/src/parser.hh +3 -21
  76. package/src/koffi/src/trampolines/armasm.inc +0 -21
  77. package/src/koffi/src/trampolines/gnu.inc +0 -21
  78. package/src/koffi/src/trampolines/masm32.inc +0 -21
  79. package/src/koffi/src/trampolines/masm64.inc +0 -21
  80. package/src/koffi/src/trampolines/prototypes.inc +0 -21
  81. package/src/koffi/src/util.cc +44 -59
  82. package/src/koffi/src/util.hh +6 -24
  83. package/src/koffi/src/uv.cc +193 -0
  84. package/src/koffi/src/uv.def +10 -0
  85. package/src/koffi/src/uv.hh +40 -0
  86. package/src/koffi/src/win32.cc +2 -20
  87. package/src/koffi/src/win32.hh +3 -21
  88. package/vendor/node-api-headers/include/uv/aix.h +32 -0
  89. package/vendor/node-api-headers/include/uv/bsd.h +34 -0
  90. package/vendor/node-api-headers/include/uv/darwin.h +61 -0
  91. package/vendor/node-api-headers/include/uv/errno.h +483 -0
  92. package/vendor/node-api-headers/include/uv/linux.h +34 -0
  93. package/vendor/node-api-headers/include/uv/os390.h +33 -0
  94. package/vendor/node-api-headers/include/uv/posix.h +31 -0
  95. package/vendor/node-api-headers/include/uv/sunos.h +44 -0
  96. package/vendor/node-api-headers/include/uv/threadpool.h +37 -0
  97. package/vendor/node-api-headers/include/uv/tree.h +521 -0
  98. package/vendor/node-api-headers/include/uv/unix.h +512 -0
  99. package/vendor/node-api-headers/include/uv/version.h +43 -0
  100. package/vendor/node-api-headers/include/uv/win.h +698 -0
  101. package/vendor/node-api-headers/include/uv.h +1990 -0
  102. package/src/core/base/crc_gen.py +0 -109
@@ -0,0 +1,483 @@
1
+ /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ #ifndef UV_ERRNO_H_
23
+ #define UV_ERRNO_H_
24
+
25
+ #include <errno.h>
26
+ #if EDOM > 0
27
+ # define UV__ERR(x) (-(x))
28
+ #else
29
+ # define UV__ERR(x) (x)
30
+ #endif
31
+
32
+ #define UV__EOF (-4095)
33
+ #define UV__UNKNOWN (-4094)
34
+
35
+ #define UV__EAI_ADDRFAMILY (-3000)
36
+ #define UV__EAI_AGAIN (-3001)
37
+ #define UV__EAI_BADFLAGS (-3002)
38
+ #define UV__EAI_CANCELED (-3003)
39
+ #define UV__EAI_FAIL (-3004)
40
+ #define UV__EAI_FAMILY (-3005)
41
+ #define UV__EAI_MEMORY (-3006)
42
+ #define UV__EAI_NODATA (-3007)
43
+ #define UV__EAI_NONAME (-3008)
44
+ #define UV__EAI_OVERFLOW (-3009)
45
+ #define UV__EAI_SERVICE (-3010)
46
+ #define UV__EAI_SOCKTYPE (-3011)
47
+ #define UV__EAI_BADHINTS (-3013)
48
+ #define UV__EAI_PROTOCOL (-3014)
49
+
50
+ /* Only map to the system errno on non-Windows platforms. It's apparently
51
+ * a fairly common practice for Windows programmers to redefine errno codes.
52
+ */
53
+ #if defined(E2BIG) && !defined(_WIN32)
54
+ # define UV__E2BIG UV__ERR(E2BIG)
55
+ #else
56
+ # define UV__E2BIG (-4093)
57
+ #endif
58
+
59
+ #if defined(EACCES) && !defined(_WIN32)
60
+ # define UV__EACCES UV__ERR(EACCES)
61
+ #else
62
+ # define UV__EACCES (-4092)
63
+ #endif
64
+
65
+ #if defined(EADDRINUSE) && !defined(_WIN32)
66
+ # define UV__EADDRINUSE UV__ERR(EADDRINUSE)
67
+ #else
68
+ # define UV__EADDRINUSE (-4091)
69
+ #endif
70
+
71
+ #if defined(EADDRNOTAVAIL) && !defined(_WIN32)
72
+ # define UV__EADDRNOTAVAIL UV__ERR(EADDRNOTAVAIL)
73
+ #else
74
+ # define UV__EADDRNOTAVAIL (-4090)
75
+ #endif
76
+
77
+ #if defined(EAFNOSUPPORT) && !defined(_WIN32)
78
+ # define UV__EAFNOSUPPORT UV__ERR(EAFNOSUPPORT)
79
+ #else
80
+ # define UV__EAFNOSUPPORT (-4089)
81
+ #endif
82
+
83
+ #if defined(EAGAIN) && !defined(_WIN32)
84
+ # define UV__EAGAIN UV__ERR(EAGAIN)
85
+ #else
86
+ # define UV__EAGAIN (-4088)
87
+ #endif
88
+
89
+ #if defined(EALREADY) && !defined(_WIN32)
90
+ # define UV__EALREADY UV__ERR(EALREADY)
91
+ #else
92
+ # define UV__EALREADY (-4084)
93
+ #endif
94
+
95
+ #if defined(EBADF) && !defined(_WIN32)
96
+ # define UV__EBADF UV__ERR(EBADF)
97
+ #else
98
+ # define UV__EBADF (-4083)
99
+ #endif
100
+
101
+ #if defined(EBUSY) && !defined(_WIN32)
102
+ # define UV__EBUSY UV__ERR(EBUSY)
103
+ #else
104
+ # define UV__EBUSY (-4082)
105
+ #endif
106
+
107
+ #if defined(ECANCELED) && !defined(_WIN32)
108
+ # define UV__ECANCELED UV__ERR(ECANCELED)
109
+ #else
110
+ # define UV__ECANCELED (-4081)
111
+ #endif
112
+
113
+ #if defined(ECHARSET) && !defined(_WIN32)
114
+ # define UV__ECHARSET UV__ERR(ECHARSET)
115
+ #else
116
+ # define UV__ECHARSET (-4080)
117
+ #endif
118
+
119
+ #if defined(ECONNABORTED) && !defined(_WIN32)
120
+ # define UV__ECONNABORTED UV__ERR(ECONNABORTED)
121
+ #else
122
+ # define UV__ECONNABORTED (-4079)
123
+ #endif
124
+
125
+ #if defined(ECONNREFUSED) && !defined(_WIN32)
126
+ # define UV__ECONNREFUSED UV__ERR(ECONNREFUSED)
127
+ #else
128
+ # define UV__ECONNREFUSED (-4078)
129
+ #endif
130
+
131
+ #if defined(ECONNRESET) && !defined(_WIN32)
132
+ # define UV__ECONNRESET UV__ERR(ECONNRESET)
133
+ #else
134
+ # define UV__ECONNRESET (-4077)
135
+ #endif
136
+
137
+ #if defined(EDESTADDRREQ) && !defined(_WIN32)
138
+ # define UV__EDESTADDRREQ UV__ERR(EDESTADDRREQ)
139
+ #else
140
+ # define UV__EDESTADDRREQ (-4076)
141
+ #endif
142
+
143
+ #if defined(EEXIST) && !defined(_WIN32)
144
+ # define UV__EEXIST UV__ERR(EEXIST)
145
+ #else
146
+ # define UV__EEXIST (-4075)
147
+ #endif
148
+
149
+ #if defined(EFAULT) && !defined(_WIN32)
150
+ # define UV__EFAULT UV__ERR(EFAULT)
151
+ #else
152
+ # define UV__EFAULT (-4074)
153
+ #endif
154
+
155
+ #if defined(EHOSTUNREACH) && !defined(_WIN32)
156
+ # define UV__EHOSTUNREACH UV__ERR(EHOSTUNREACH)
157
+ #else
158
+ # define UV__EHOSTUNREACH (-4073)
159
+ #endif
160
+
161
+ #if defined(EINTR) && !defined(_WIN32)
162
+ # define UV__EINTR UV__ERR(EINTR)
163
+ #else
164
+ # define UV__EINTR (-4072)
165
+ #endif
166
+
167
+ #if defined(EINVAL) && !defined(_WIN32)
168
+ # define UV__EINVAL UV__ERR(EINVAL)
169
+ #else
170
+ # define UV__EINVAL (-4071)
171
+ #endif
172
+
173
+ #if defined(EIO) && !defined(_WIN32)
174
+ # define UV__EIO UV__ERR(EIO)
175
+ #else
176
+ # define UV__EIO (-4070)
177
+ #endif
178
+
179
+ #if defined(EISCONN) && !defined(_WIN32)
180
+ # define UV__EISCONN UV__ERR(EISCONN)
181
+ #else
182
+ # define UV__EISCONN (-4069)
183
+ #endif
184
+
185
+ #if defined(EISDIR) && !defined(_WIN32)
186
+ # define UV__EISDIR UV__ERR(EISDIR)
187
+ #else
188
+ # define UV__EISDIR (-4068)
189
+ #endif
190
+
191
+ #if defined(ELOOP) && !defined(_WIN32)
192
+ # define UV__ELOOP UV__ERR(ELOOP)
193
+ #else
194
+ # define UV__ELOOP (-4067)
195
+ #endif
196
+
197
+ #if defined(EMFILE) && !defined(_WIN32)
198
+ # define UV__EMFILE UV__ERR(EMFILE)
199
+ #else
200
+ # define UV__EMFILE (-4066)
201
+ #endif
202
+
203
+ #if defined(EMSGSIZE) && !defined(_WIN32)
204
+ # define UV__EMSGSIZE UV__ERR(EMSGSIZE)
205
+ #else
206
+ # define UV__EMSGSIZE (-4065)
207
+ #endif
208
+
209
+ #if defined(ENAMETOOLONG) && !defined(_WIN32)
210
+ # define UV__ENAMETOOLONG UV__ERR(ENAMETOOLONG)
211
+ #else
212
+ # define UV__ENAMETOOLONG (-4064)
213
+ #endif
214
+
215
+ #if defined(ENETDOWN) && !defined(_WIN32)
216
+ # define UV__ENETDOWN UV__ERR(ENETDOWN)
217
+ #else
218
+ # define UV__ENETDOWN (-4063)
219
+ #endif
220
+
221
+ #if defined(ENETUNREACH) && !defined(_WIN32)
222
+ # define UV__ENETUNREACH UV__ERR(ENETUNREACH)
223
+ #else
224
+ # define UV__ENETUNREACH (-4062)
225
+ #endif
226
+
227
+ #if defined(ENFILE) && !defined(_WIN32)
228
+ # define UV__ENFILE UV__ERR(ENFILE)
229
+ #else
230
+ # define UV__ENFILE (-4061)
231
+ #endif
232
+
233
+ #if defined(ENOBUFS) && !defined(_WIN32)
234
+ # define UV__ENOBUFS UV__ERR(ENOBUFS)
235
+ #else
236
+ # define UV__ENOBUFS (-4060)
237
+ #endif
238
+
239
+ #if defined(ENODEV) && !defined(_WIN32)
240
+ # define UV__ENODEV UV__ERR(ENODEV)
241
+ #else
242
+ # define UV__ENODEV (-4059)
243
+ #endif
244
+
245
+ #if defined(ENOENT) && !defined(_WIN32)
246
+ # define UV__ENOENT UV__ERR(ENOENT)
247
+ #else
248
+ # define UV__ENOENT (-4058)
249
+ #endif
250
+
251
+ #if defined(ENOMEM) && !defined(_WIN32)
252
+ # define UV__ENOMEM UV__ERR(ENOMEM)
253
+ #else
254
+ # define UV__ENOMEM (-4057)
255
+ #endif
256
+
257
+ #if defined(ENONET) && !defined(_WIN32)
258
+ # define UV__ENONET UV__ERR(ENONET)
259
+ #else
260
+ # define UV__ENONET (-4056)
261
+ #endif
262
+
263
+ #if defined(ENOSPC) && !defined(_WIN32)
264
+ # define UV__ENOSPC UV__ERR(ENOSPC)
265
+ #else
266
+ # define UV__ENOSPC (-4055)
267
+ #endif
268
+
269
+ #if defined(ENOSYS) && !defined(_WIN32)
270
+ # define UV__ENOSYS UV__ERR(ENOSYS)
271
+ #else
272
+ # define UV__ENOSYS (-4054)
273
+ #endif
274
+
275
+ #if defined(ENOTCONN) && !defined(_WIN32)
276
+ # define UV__ENOTCONN UV__ERR(ENOTCONN)
277
+ #else
278
+ # define UV__ENOTCONN (-4053)
279
+ #endif
280
+
281
+ #if defined(ENOTDIR) && !defined(_WIN32)
282
+ # define UV__ENOTDIR UV__ERR(ENOTDIR)
283
+ #else
284
+ # define UV__ENOTDIR (-4052)
285
+ #endif
286
+
287
+ #if defined(ENOTEMPTY) && !defined(_WIN32)
288
+ # define UV__ENOTEMPTY UV__ERR(ENOTEMPTY)
289
+ #else
290
+ # define UV__ENOTEMPTY (-4051)
291
+ #endif
292
+
293
+ #if defined(ENOTSOCK) && !defined(_WIN32)
294
+ # define UV__ENOTSOCK UV__ERR(ENOTSOCK)
295
+ #else
296
+ # define UV__ENOTSOCK (-4050)
297
+ #endif
298
+
299
+ #if defined(ENOTSUP) && !defined(_WIN32)
300
+ # define UV__ENOTSUP UV__ERR(ENOTSUP)
301
+ #else
302
+ # define UV__ENOTSUP (-4049)
303
+ #endif
304
+
305
+ #if defined(EPERM) && !defined(_WIN32)
306
+ # define UV__EPERM UV__ERR(EPERM)
307
+ #else
308
+ # define UV__EPERM (-4048)
309
+ #endif
310
+
311
+ #if defined(EPIPE) && !defined(_WIN32)
312
+ # define UV__EPIPE UV__ERR(EPIPE)
313
+ #else
314
+ # define UV__EPIPE (-4047)
315
+ #endif
316
+
317
+ #if defined(EPROTO) && !defined(_WIN32)
318
+ # define UV__EPROTO UV__ERR(EPROTO)
319
+ #else
320
+ # define UV__EPROTO (-4046)
321
+ #endif
322
+
323
+ #if defined(EPROTONOSUPPORT) && !defined(_WIN32)
324
+ # define UV__EPROTONOSUPPORT UV__ERR(EPROTONOSUPPORT)
325
+ #else
326
+ # define UV__EPROTONOSUPPORT (-4045)
327
+ #endif
328
+
329
+ #if defined(EPROTOTYPE) && !defined(_WIN32)
330
+ # define UV__EPROTOTYPE UV__ERR(EPROTOTYPE)
331
+ #else
332
+ # define UV__EPROTOTYPE (-4044)
333
+ #endif
334
+
335
+ #if defined(EROFS) && !defined(_WIN32)
336
+ # define UV__EROFS UV__ERR(EROFS)
337
+ #else
338
+ # define UV__EROFS (-4043)
339
+ #endif
340
+
341
+ #if defined(ESHUTDOWN) && !defined(_WIN32)
342
+ # define UV__ESHUTDOWN UV__ERR(ESHUTDOWN)
343
+ #else
344
+ # define UV__ESHUTDOWN (-4042)
345
+ #endif
346
+
347
+ #if defined(ESPIPE) && !defined(_WIN32)
348
+ # define UV__ESPIPE UV__ERR(ESPIPE)
349
+ #else
350
+ # define UV__ESPIPE (-4041)
351
+ #endif
352
+
353
+ #if defined(ESRCH) && !defined(_WIN32)
354
+ # define UV__ESRCH UV__ERR(ESRCH)
355
+ #else
356
+ # define UV__ESRCH (-4040)
357
+ #endif
358
+
359
+ #if defined(ETIMEDOUT) && !defined(_WIN32)
360
+ # define UV__ETIMEDOUT UV__ERR(ETIMEDOUT)
361
+ #else
362
+ # define UV__ETIMEDOUT (-4039)
363
+ #endif
364
+
365
+ #if defined(ETXTBSY) && !defined(_WIN32)
366
+ # define UV__ETXTBSY UV__ERR(ETXTBSY)
367
+ #else
368
+ # define UV__ETXTBSY (-4038)
369
+ #endif
370
+
371
+ #if defined(EXDEV) && !defined(_WIN32)
372
+ # define UV__EXDEV UV__ERR(EXDEV)
373
+ #else
374
+ # define UV__EXDEV (-4037)
375
+ #endif
376
+
377
+ #if defined(EFBIG) && !defined(_WIN32)
378
+ # define UV__EFBIG UV__ERR(EFBIG)
379
+ #else
380
+ # define UV__EFBIG (-4036)
381
+ #endif
382
+
383
+ #if defined(ENOPROTOOPT) && !defined(_WIN32)
384
+ # define UV__ENOPROTOOPT UV__ERR(ENOPROTOOPT)
385
+ #else
386
+ # define UV__ENOPROTOOPT (-4035)
387
+ #endif
388
+
389
+ #if defined(ERANGE) && !defined(_WIN32)
390
+ # define UV__ERANGE UV__ERR(ERANGE)
391
+ #else
392
+ # define UV__ERANGE (-4034)
393
+ #endif
394
+
395
+ #if defined(ENXIO) && !defined(_WIN32)
396
+ # define UV__ENXIO UV__ERR(ENXIO)
397
+ #else
398
+ # define UV__ENXIO (-4033)
399
+ #endif
400
+
401
+ #if defined(EMLINK) && !defined(_WIN32)
402
+ # define UV__EMLINK UV__ERR(EMLINK)
403
+ #else
404
+ # define UV__EMLINK (-4032)
405
+ #endif
406
+
407
+ /* EHOSTDOWN is not visible on BSD-like systems when _POSIX_C_SOURCE is
408
+ * defined. Fortunately, its value is always 64 so it's possible albeit
409
+ * icky to hard-code it.
410
+ */
411
+ #if defined(EHOSTDOWN) && !defined(_WIN32)
412
+ # define UV__EHOSTDOWN UV__ERR(EHOSTDOWN)
413
+ #elif defined(__APPLE__) || \
414
+ defined(__DragonFly__) || \
415
+ defined(__FreeBSD__) || \
416
+ defined(__NetBSD__) || \
417
+ defined(__OpenBSD__)
418
+ # define UV__EHOSTDOWN (-64)
419
+ #else
420
+ # define UV__EHOSTDOWN (-4031)
421
+ #endif
422
+
423
+ #if defined(EREMOTEIO) && !defined(_WIN32)
424
+ # define UV__EREMOTEIO UV__ERR(EREMOTEIO)
425
+ #else
426
+ # define UV__EREMOTEIO (-4030)
427
+ #endif
428
+
429
+ #if defined(ENOTTY) && !defined(_WIN32)
430
+ # define UV__ENOTTY UV__ERR(ENOTTY)
431
+ #else
432
+ # define UV__ENOTTY (-4029)
433
+ #endif
434
+
435
+ #if defined(EFTYPE) && !defined(_WIN32)
436
+ # define UV__EFTYPE UV__ERR(EFTYPE)
437
+ #else
438
+ # define UV__EFTYPE (-4028)
439
+ #endif
440
+
441
+ #if defined(EILSEQ) && !defined(_WIN32)
442
+ # define UV__EILSEQ UV__ERR(EILSEQ)
443
+ #else
444
+ # define UV__EILSEQ (-4027)
445
+ #endif
446
+
447
+ #if defined(EOVERFLOW) && !defined(_WIN32)
448
+ # define UV__EOVERFLOW UV__ERR(EOVERFLOW)
449
+ #else
450
+ # define UV__EOVERFLOW (-4026)
451
+ #endif
452
+
453
+ #if defined(ESOCKTNOSUPPORT) && !defined(_WIN32)
454
+ # define UV__ESOCKTNOSUPPORT UV__ERR(ESOCKTNOSUPPORT)
455
+ #else
456
+ # define UV__ESOCKTNOSUPPORT (-4025)
457
+ #endif
458
+
459
+ /* FreeBSD defines ENODATA in /usr/include/c++/v1/errno.h which is only visible
460
+ * if C++ is being used. Define it directly to avoid problems when integrating
461
+ * libuv in a C++ project.
462
+ */
463
+ #if defined(ENODATA) && !defined(_WIN32)
464
+ # define UV__ENODATA UV__ERR(ENODATA)
465
+ #elif defined(__FreeBSD__)
466
+ # define UV__ENODATA (-9919)
467
+ #else
468
+ # define UV__ENODATA (-4024)
469
+ #endif
470
+
471
+ #if defined(EUNATCH) && !defined(_WIN32)
472
+ # define UV__EUNATCH UV__ERR(EUNATCH)
473
+ #else
474
+ # define UV__EUNATCH (-4023)
475
+ #endif
476
+
477
+ #if defined(ENOEXEC) && !defined(_WIN32)
478
+ # define UV__ENOEXEC UV__ERR(ENOEXEC)
479
+ #else
480
+ # define UV__ENOEXEC (-4022)
481
+ #endif
482
+
483
+ #endif /* UV_ERRNO_H_ */
@@ -0,0 +1,34 @@
1
+ /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ #ifndef UV_LINUX_H
23
+ #define UV_LINUX_H
24
+
25
+ #define UV_PLATFORM_LOOP_FIELDS \
26
+ uv__io_t inotify_read_watcher; \
27
+ void* inotify_watchers; \
28
+ int inotify_fd; \
29
+
30
+ #define UV_PLATFORM_FS_EVENT_FIELDS \
31
+ struct uv__queue watchers; \
32
+ int wd; \
33
+
34
+ #endif /* UV_LINUX_H */
@@ -0,0 +1,33 @@
1
+ /* Copyright libuv project contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ #ifndef UV_MVS_H
23
+ #define UV_MVS_H
24
+
25
+ #define UV_PLATFORM_SEM_T long
26
+
27
+ #define UV_PLATFORM_LOOP_FIELDS \
28
+ void* ep; \
29
+
30
+ #define UV_PLATFORM_FS_EVENT_FIELDS \
31
+ char rfis_rftok[8]; \
32
+
33
+ #endif /* UV_MVS_H */
@@ -0,0 +1,31 @@
1
+ /* Copyright libuv project contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ #ifndef UV_POSIX_H
23
+ #define UV_POSIX_H
24
+
25
+ #define UV_PLATFORM_LOOP_FIELDS \
26
+ struct pollfd* poll_fds; \
27
+ size_t poll_fds_used; \
28
+ size_t poll_fds_size; \
29
+ unsigned char poll_fds_iterating; \
30
+
31
+ #endif /* UV_POSIX_H */
@@ -0,0 +1,44 @@
1
+ /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ #ifndef UV_SUNOS_H
23
+ #define UV_SUNOS_H
24
+
25
+ #include <sys/port.h>
26
+ #include <port.h>
27
+
28
+ /* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c,
29
+ * add the fs_event fields even when this version of SunOS doesn't support
30
+ * file watching.
31
+ */
32
+ #define UV_PLATFORM_LOOP_FIELDS \
33
+ uv__io_t fs_event_watcher; \
34
+ int fs_fd; \
35
+
36
+ #if defined(PORT_SOURCE_FILE)
37
+
38
+ # define UV_PLATFORM_FS_EVENT_FIELDS \
39
+ file_obj_t fo; \
40
+ int fd; \
41
+
42
+ #endif /* defined(PORT_SOURCE_FILE) */
43
+
44
+ #endif /* UV_SUNOS_H */
@@ -0,0 +1,37 @@
1
+ /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ /*
23
+ * This file is private to libuv. It provides common functionality to both
24
+ * Windows and Unix backends.
25
+ */
26
+
27
+ #ifndef UV_THREADPOOL_H_
28
+ #define UV_THREADPOOL_H_
29
+
30
+ struct uv__work {
31
+ void (*work)(struct uv__work *w);
32
+ void (*done)(struct uv__work *w, int status);
33
+ struct uv_loop_s* loop;
34
+ struct uv__queue wq;
35
+ };
36
+
37
+ #endif /* UV_THREADPOOL_H_ */