-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathuv.nelua
1326 lines (1326 loc) · 55 KB
/
uv.nelua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##[[
cinclude '<uv.h>'
linklib 'uv'
if ccinfo.is_gcc then
cflags '-fno-strict-aliasing'
end
]]
global FILE: type <cimport,nodecl,forwarddecl> = @record{}
global DIR: type <cimport,nodecl,forwarddecl> = @record{}
global sockaddr: type <cimport,nodecl,ctypedef> = @record{
sa_family: cushort,
sa_data: [14]cchar
}
global in_addr: type <cimport,nodecl,ctypedef> = @record{
s_addr: cuint
}
global in6_addr: type <cimport,nodecl,ctypedef> = @record{
__in6_u: union{
__u6_addr8: [16]uint8,
__u6_addr16: [8]uint16,
__u6_addr32: [4]uint32
}
}
global sockaddr_in: type <cimport,nodecl,ctypedef> = @record{
sin_family: cushort,
sin_port: cushort,
sin_addr: in_addr,
sin_zero: [8]cuchar
}
global sockaddr_in6: type <cimport,nodecl,ctypedef> = @record{
sin6_family: cushort,
sin6_port: cushort,
sin6_flowinfo: uint32,
sin6_addr: in6_addr,
sin6_scope_id: uint32
}
global addrinfo: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
addrinfo = @record{
ai_flags: cint,
ai_family: cint,
ai_socktype: cint,
ai_protocol: cint,
ai_addrlen: cuint,
ai_addr: *sockaddr,
ai_canonname: cstring,
ai_next: *addrinfo
}
global uv_loop_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv__io_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_buf_t: type <cimport,nodecl> = @record{
base: cstring,
len: csize
}
global uv_file: type <cimport,nodecl,cincomplete> = @record{}
global uv_os_sock_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_os_fd_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_pid_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_once_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_thread_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_mutex_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_rwlock_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_sem_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_cond_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_key_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_barrier_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_gid_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_uid_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_lib_t: type <cimport,nodecl,cincomplete> = @record{}
global uv_errno_t: type <cimport,nodecl,using> = @enum(cint){
UV_E2BIG = -7,
UV_EACCES = -13,
UV_EADDRINUSE = -98,
UV_EADDRNOTAVAIL = -99,
UV_EAFNOSUPPORT = -97,
UV_EAGAIN = -11,
UV_EAI_ADDRFAMILY = -3000,
UV_EAI_AGAIN = -3001,
UV_EAI_BADFLAGS = -3002,
UV_EAI_BADHINTS = -3013,
UV_EAI_CANCELED = -3003,
UV_EAI_FAIL = -3004,
UV_EAI_FAMILY = -3005,
UV_EAI_MEMORY = -3006,
UV_EAI_NODATA = -3007,
UV_EAI_NONAME = -3008,
UV_EAI_OVERFLOW = -3009,
UV_EAI_PROTOCOL = -3014,
UV_EAI_SERVICE = -3010,
UV_EAI_SOCKTYPE = -3011,
UV_EALREADY = -114,
UV_EBADF = -9,
UV_EBUSY = -16,
UV_ECANCELED = -125,
UV_ECHARSET = -4080,
UV_ECONNABORTED = -103,
UV_ECONNREFUSED = -111,
UV_ECONNRESET = -104,
UV_EDESTADDRREQ = -89,
UV_EEXIST = -17,
UV_EFAULT = -14,
UV_EFBIG = -27,
UV_EHOSTUNREACH = -113,
UV_EINTR = -4,
UV_EINVAL = -22,
UV_EIO = -5,
UV_EISCONN = -106,
UV_EISDIR = -21,
UV_ELOOP = -40,
UV_EMFILE = -24,
UV_EMSGSIZE = -90,
UV_ENAMETOOLONG = -36,
UV_ENETDOWN = -100,
UV_ENETUNREACH = -101,
UV_ENFILE = -23,
UV_ENOBUFS = -105,
UV_ENODEV = -19,
UV_ENOENT = -2,
UV_ENOMEM = -12,
UV_ENONET = -64,
UV_ENOPROTOOPT = -92,
UV_ENOSPC = -28,
UV_ENOSYS = -38,
UV_ENOTCONN = -107,
UV_ENOTDIR = -20,
UV_ENOTEMPTY = -39,
UV_ENOTSOCK = -88,
UV_ENOTSUP = -95,
UV_EOVERFLOW = -75,
UV_EPERM = -1,
UV_EPIPE = -32,
UV_EPROTO = -71,
UV_EPROTONOSUPPORT = -93,
UV_EPROTOTYPE = -91,
UV_ERANGE = -34,
UV_EROFS = -30,
UV_ESHUTDOWN = -108,
UV_ESPIPE = -29,
UV_ESRCH = -3,
UV_ETIMEDOUT = -110,
UV_ETXTBSY = -26,
UV_EXDEV = -18,
UV_UNKNOWN = -4094,
UV_EOF = -4095,
UV_ENXIO = -6,
UV_EMLINK = -31,
UV_EHOSTDOWN = -112,
UV_EREMOTEIO = -121,
UV_ENOTTY = -25,
UV_EFTYPE = -4028,
UV_EILSEQ = -84,
UV_ESOCKTNOSUPPORT = -94,
UV_ERRNO_MAX = -4096
}
global uv_handle_type: type <cimport,nodecl,using> = @enum(cint){
UV_UNKNOWN_HANDLE = 0,
UV_ASYNC = 1,
UV_CHECK = 2,
UV_FS_EVENT = 3,
UV_FS_POLL = 4,
UV_HANDLE = 5,
UV_IDLE = 6,
UV_NAMED_PIPE = 7,
UV_POLL = 8,
UV_PREPARE = 9,
UV_PROCESS = 10,
UV_STREAM = 11,
UV_TCP = 12,
UV_TIMER = 13,
UV_TTY = 14,
UV_UDP = 15,
UV_SIGNAL = 16,
UV_FILE = 17,
UV_HANDLE_TYPE_MAX = 18
}
global uv_req_type: type <cimport,nodecl,using> = @enum(cint){
UV_UNKNOWN_REQ = 0,
UV_REQ = 1,
UV_CONNECT = 2,
UV_WRITE = 3,
UV_SHUTDOWN = 4,
UV_UDP_SEND = 5,
UV_FS = 6,
UV_WORK = 7,
UV_GETADDRINFO = 8,
UV_GETNAMEINFO = 9,
UV_RANDOM = 10,
UV_REQ_TYPE_MAX = 11
}
global uv_loop_t: type = @uv_loop_s
global uv_handle_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_handle_t: type = @uv_handle_s
global uv_dir_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_dir_t: type = @uv_dir_s
global uv_stream_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_stream_t: type = @uv_stream_s
global uv_tcp_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_tcp_t: type = @uv_tcp_s
global uv_udp_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_udp_t: type = @uv_udp_s
global uv_pipe_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_pipe_t: type = @uv_pipe_s
global uv_tty_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_tty_t: type = @uv_tty_s
global uv_poll_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_poll_t: type = @uv_poll_s
global uv_timer_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_timer_t: type = @uv_timer_s
global uv_prepare_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_prepare_t: type = @uv_prepare_s
global uv_check_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_check_t: type = @uv_check_s
global uv_idle_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_idle_t: type = @uv_idle_s
global uv_async_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_async_t: type = @uv_async_s
global uv_process_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_process_t: type = @uv_process_s
global uv_fs_event_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_fs_event_t: type = @uv_fs_event_s
global uv_fs_poll_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_fs_poll_t: type = @uv_fs_poll_s
global uv_signal_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_signal_t: type = @uv_signal_s
global uv_req_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_req_t: type = @uv_req_s
global uv_getaddrinfo_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_getaddrinfo_t: type = @uv_getaddrinfo_s
global uv_getnameinfo_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_getnameinfo_t: type = @uv_getnameinfo_s
global uv_shutdown_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_shutdown_t: type = @uv_shutdown_s
global uv_write_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_write_t: type = @uv_write_s
global uv_connect_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_connect_t: type = @uv_connect_s
global uv_udp_send_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_udp_send_t: type = @uv_udp_send_s
global uv_fs_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_fs_t: type = @uv_fs_s
global uv_work_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_work_t: type = @uv_work_s
global uv_random_s: type <cimport,nodecl,forwarddecl,cincomplete,ctypedef> = @record{}
global uv_random_t: type = @uv_random_s
global uv_env_item_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_env_item_t: type = @uv_env_item_s
global uv_cpu_info_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_cpu_info_t: type = @uv_cpu_info_s
global uv_interface_address_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_interface_address_t: type = @uv_interface_address_s
global uv_dirent_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_dirent_t: type = @uv_dirent_s
global uv_passwd_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_passwd_t: type = @uv_passwd_s
global uv_utsname_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_utsname_t: type = @uv_utsname_s
global uv_statfs_s: type <cimport,nodecl,forwarddecl,ctypedef> = @record{}
global uv_statfs_t: type = @uv_statfs_s
global uv_loop_option: type <cimport,nodecl,using> = @enum(cint){
UV_LOOP_BLOCK_SIGNAL = 0,
UV_METRICS_IDLE_TIME = 1
}
global uv_run_mode: type <cimport,nodecl,using> = @enum(cint){
UV_RUN_DEFAULT = 0,
UV_RUN_ONCE = 1,
UV_RUN_NOWAIT = 2
}
global function uv_version(): cuint <cimport,nodecl> end
global function uv_version_string(): cstring <cimport,nodecl> end
global uv_malloc_func: type <cimport,nodecl> = @function(csize): pointer
global uv_realloc_func: type <cimport,nodecl> = @function(pointer, csize): pointer
global uv_calloc_func: type <cimport,nodecl> = @function(csize, csize): pointer
global uv_free_func: type <cimport,nodecl> = @function(pointer): void
global function uv_library_shutdown(): void <cimport,nodecl> end
global function uv_replace_allocator(malloc_func: uv_malloc_func, realloc_func: uv_realloc_func, calloc_func: uv_calloc_func, free_func: uv_free_func): cint <cimport,nodecl> end
global function uv_default_loop(): *uv_loop_t <cimport,nodecl> end
global function uv_loop_init(loop: *uv_loop_t): cint <cimport,nodecl> end
global function uv_loop_close(loop: *uv_loop_t): cint <cimport,nodecl> end
global function uv_loop_new(): *uv_loop_t <cimport,nodecl> end
global function uv_loop_delete(a1: *uv_loop_t): void <cimport,nodecl> end
global function uv_loop_size(): csize <cimport,nodecl> end
global function uv_loop_alive(loop: *uv_loop_t): cint <cimport,nodecl> end
global function uv_loop_configure(loop: *uv_loop_t, option: uv_loop_option, ...: cvarargs): cint <cimport,nodecl> end
global function uv_loop_fork(loop: *uv_loop_t): cint <cimport,nodecl> end
global function uv_run(a1: *uv_loop_t, mode: uv_run_mode): cint <cimport,nodecl> end
global function uv_stop(a1: *uv_loop_t): void <cimport,nodecl> end
global function uv_ref(a1: *uv_handle_t): void <cimport,nodecl> end
global function uv_unref(a1: *uv_handle_t): void <cimport,nodecl> end
global function uv_has_ref(a1: *uv_handle_t): cint <cimport,nodecl> end
global function uv_update_time(a1: *uv_loop_t): void <cimport,nodecl> end
global function uv_now(a1: *uv_loop_t): uint64 <cimport,nodecl> end
global function uv_backend_fd(a1: *uv_loop_t): cint <cimport,nodecl> end
global function uv_backend_timeout(a1: *uv_loop_t): cint <cimport,nodecl> end
global uv_alloc_cb: type <cimport,nodecl> = @function(*uv_handle_t, csize, *uv_buf_t): void
global uv_read_cb: type <cimport,nodecl> = @function(*uv_stream_t, clong, *uv_buf_t): void
global uv_write_cb: type <cimport,nodecl> = @function(*uv_write_t, cint): void
global uv_connect_cb: type <cimport,nodecl> = @function(*uv_connect_t, cint): void
global uv_shutdown_cb: type <cimport,nodecl> = @function(*uv_shutdown_t, cint): void
global uv_connection_cb: type <cimport,nodecl> = @function(*uv_stream_t, cint): void
global uv_close_cb: type <cimport,nodecl> = @function(*uv_handle_t): void
global uv_poll_cb: type <cimport,nodecl> = @function(*uv_poll_t, cint, cint): void
global uv_timer_cb: type <cimport,nodecl> = @function(*uv_timer_t): void
global uv_async_cb: type <cimport,nodecl> = @function(*uv_async_t): void
global uv_prepare_cb: type <cimport,nodecl> = @function(*uv_prepare_t): void
global uv_check_cb: type <cimport,nodecl> = @function(*uv_check_t): void
global uv_idle_cb: type <cimport,nodecl> = @function(*uv_idle_t): void
global uv_exit_cb: type <cimport,nodecl> = @function(*uv_process_t, int64, cint): void
global uv_walk_cb: type <cimport,nodecl> = @function(*uv_handle_t, pointer): void
global uv_fs_cb: type <cimport,nodecl> = @function(*uv_fs_t): void
global uv_work_cb: type <cimport,nodecl> = @function(*uv_work_t): void
global uv_after_work_cb: type <cimport,nodecl> = @function(*uv_work_t, cint): void
global uv_getaddrinfo_cb: type <cimport,nodecl> = @function(*uv_getaddrinfo_t, cint, *addrinfo): void
global uv_getnameinfo_cb: type <cimport,nodecl> = @function(*uv_getnameinfo_t, cint, cstring, cstring): void
global uv_random_cb: type <cimport,nodecl> = @function(*uv_random_t, cint, pointer, csize): void
global uv_timespec_t: type <cimport,nodecl> = @record{
tv_sec: clong,
tv_nsec: clong
}
global uv_stat_t: type <cimport,nodecl> = @record{
st_dev: uint64,
st_mode: uint64,
st_nlink: uint64,
st_uid: uint64,
st_gid: uint64,
st_rdev: uint64,
st_ino: uint64,
st_size: uint64,
st_blksize: uint64,
st_blocks: uint64,
st_flags: uint64,
st_gen: uint64,
st_atim: uv_timespec_t,
st_mtim: uv_timespec_t,
st_ctim: uv_timespec_t,
st_birthtim: uv_timespec_t
}
global uv_fs_event_cb: type <cimport,nodecl> = @function(*uv_fs_event_t, cstring, cint, cint): void
global uv_fs_poll_cb: type <cimport,nodecl> = @function(*uv_fs_poll_t, cint, *uv_stat_t, *uv_stat_t): void
global uv_signal_cb: type <cimport,nodecl> = @function(*uv_signal_t, cint): void
global uv_membership: type <cimport,nodecl,using> = @enum(cint){
UV_LEAVE_GROUP = 0,
UV_JOIN_GROUP = 1
}
global function uv_translate_sys_error(sys_errno: cint): cint <cimport,nodecl> end
global function uv_strerror(err: cint): cstring <cimport,nodecl> end
global function uv_strerror_r(err: cint, buf: cstring, buflen: csize): cstring <cimport,nodecl> end
global function uv_err_name(err: cint): cstring <cimport,nodecl> end
global function uv_err_name_r(err: cint, buf: cstring, buflen: csize): cstring <cimport,nodecl> end
uv_req_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer
}
global function uv_shutdown(req: *uv_shutdown_t, handle: *uv_stream_t, cb: uv_shutdown_cb): cint <cimport,nodecl> end
uv_shutdown_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
handle: *uv_stream_t,
cb: uv_shutdown_cb
}
uv_handle_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint
}
global function uv_handle_size(type: uv_handle_type): csize <cimport,nodecl> end
global function uv_handle_get_type(handle: *uv_handle_t): uv_handle_type <cimport,nodecl> end
global function uv_handle_type_name(type: uv_handle_type): cstring <cimport,nodecl> end
global function uv_handle_get_data(handle: *uv_handle_t): pointer <cimport,nodecl> end
global function uv_handle_get_loop(handle: *uv_handle_t): *uv_loop_t <cimport,nodecl> end
global function uv_handle_set_data(handle: *uv_handle_t, data: pointer): void <cimport,nodecl> end
global function uv_req_size(type: uv_req_type): csize <cimport,nodecl> end
global function uv_req_get_data(req: *uv_req_t): pointer <cimport,nodecl> end
global function uv_req_set_data(req: *uv_req_t, data: pointer): void <cimport,nodecl> end
global function uv_req_get_type(req: *uv_req_t): uv_req_type <cimport,nodecl> end
global function uv_req_type_name(type: uv_req_type): cstring <cimport,nodecl> end
global function uv_is_active(handle: *uv_handle_t): cint <cimport,nodecl> end
global function uv_walk(loop: *uv_loop_t, walk_cb: uv_walk_cb, arg: pointer): void <cimport,nodecl> end
global function uv_print_all_handles(loop: *uv_loop_t, stream: *FILE): void <cimport,nodecl> end
global function uv_print_active_handles(loop: *uv_loop_t, stream: *FILE): void <cimport,nodecl> end
global function uv_close(handle: *uv_handle_t, close_cb: uv_close_cb): void <cimport,nodecl> end
global function uv_send_buffer_size(handle: *uv_handle_t, value: *cint): cint <cimport,nodecl> end
global function uv_recv_buffer_size(handle: *uv_handle_t, value: *cint): cint <cimport,nodecl> end
global function uv_fileno(handle: *uv_handle_t, fd: *uv_os_fd_t): cint <cimport,nodecl> end
global function uv_buf_init(base: cstring, len: cuint): uv_buf_t <cimport,nodecl> end
global function uv_pipe(fds: *uv_file, read_flags: cint, write_flags: cint): cint <cimport,nodecl> end
global function uv_socketpair(type: cint, protocol: cint, socket_vector: *uv_os_sock_t, flags0: cint, flags1: cint): cint <cimport,nodecl> end
uv_stream_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
write_queue_size: csize,
alloc_cb: uv_alloc_cb,
read_cb: uv_read_cb,
connect_req: *uv_connect_t,
shutdown_req: *uv_shutdown_t,
io_watcher: uv__io_t,
write_queue: [2]pointer,
write_completed_queue: [2]pointer,
connection_cb: uv_connection_cb,
delayed_error: cint,
accepted_fd: cint,
queued_fds: pointer
}
global function uv_stream_get_write_queue_size(stream: *uv_stream_t): csize <cimport,nodecl> end
global function uv_listen(stream: *uv_stream_t, backlog: cint, cb: uv_connection_cb): cint <cimport,nodecl> end
global function uv_accept(server: *uv_stream_t, client: *uv_stream_t): cint <cimport,nodecl> end
global function uv_read_start(a1: *uv_stream_t, alloc_cb: uv_alloc_cb, read_cb: uv_read_cb): cint <cimport,nodecl> end
global function uv_read_stop(a1: *uv_stream_t): cint <cimport,nodecl> end
global function uv_write(req: *uv_write_t, handle: *uv_stream_t, bufs: *uv_buf_t, nbufs: cuint, cb: uv_write_cb): cint <cimport,nodecl> end
global function uv_write2(req: *uv_write_t, handle: *uv_stream_t, bufs: *uv_buf_t, nbufs: cuint, send_handle: *uv_stream_t, cb: uv_write_cb): cint <cimport,nodecl> end
global function uv_try_write(handle: *uv_stream_t, bufs: *uv_buf_t, nbufs: cuint): cint <cimport,nodecl> end
global function uv_try_write2(handle: *uv_stream_t, bufs: *uv_buf_t, nbufs: cuint, send_handle: *uv_stream_t): cint <cimport,nodecl> end
uv_write_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
cb: uv_write_cb,
send_handle: *uv_stream_t,
handle: *uv_stream_t,
queue: [2]pointer,
write_index: cuint,
bufs: *uv_buf_t,
nbufs: cuint,
error: cint,
bufsml: [4]uv_buf_t
}
global function uv_is_readable(handle: *uv_stream_t): cint <cimport,nodecl> end
global function uv_is_writable(handle: *uv_stream_t): cint <cimport,nodecl> end
global function uv_stream_set_blocking(handle: *uv_stream_t, blocking: cint): cint <cimport,nodecl> end
global function uv_is_closing(handle: *uv_handle_t): cint <cimport,nodecl> end
uv_tcp_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
write_queue_size: csize,
alloc_cb: uv_alloc_cb,
read_cb: uv_read_cb,
connect_req: *uv_connect_t,
shutdown_req: *uv_shutdown_t,
io_watcher: uv__io_t,
write_queue: [2]pointer,
write_completed_queue: [2]pointer,
connection_cb: uv_connection_cb,
delayed_error: cint,
accepted_fd: cint,
queued_fds: pointer
}
global function uv_tcp_init(a1: *uv_loop_t, handle: *uv_tcp_t): cint <cimport,nodecl> end
global function uv_tcp_init_ex(a1: *uv_loop_t, handle: *uv_tcp_t, flags: cuint): cint <cimport,nodecl> end
global function uv_tcp_open(handle: *uv_tcp_t, sock: uv_os_sock_t): cint <cimport,nodecl> end
global function uv_tcp_nodelay(handle: *uv_tcp_t, enable: cint): cint <cimport,nodecl> end
global function uv_tcp_keepalive(handle: *uv_tcp_t, enable: cint, delay: cuint): cint <cimport,nodecl> end
global function uv_tcp_simultaneous_accepts(handle: *uv_tcp_t, enable: cint): cint <cimport,nodecl> end
global uv_tcp_flags: type <cimport,nodecl,using,ctypedef> = @enum(cint){
UV_TCP_IPV6ONLY = 1
}
global function uv_tcp_bind(handle: *uv_tcp_t, addr: *sockaddr, flags: cuint): cint <cimport,nodecl> end
global function uv_tcp_getsockname(handle: *uv_tcp_t, name: *sockaddr, namelen: *cint): cint <cimport,nodecl> end
global function uv_tcp_getpeername(handle: *uv_tcp_t, name: *sockaddr, namelen: *cint): cint <cimport,nodecl> end
global function uv_tcp_close_reset(handle: *uv_tcp_t, close_cb: uv_close_cb): cint <cimport,nodecl> end
global function uv_tcp_connect(req: *uv_connect_t, handle: *uv_tcp_t, addr: *sockaddr, cb: uv_connect_cb): cint <cimport,nodecl> end
uv_connect_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
cb: uv_connect_cb,
handle: *uv_stream_t,
queue: [2]pointer
}
global uv_udp_flags: type <cimport,nodecl,using,ctypedef> = @enum(cint){
UV_UDP_IPV6ONLY = 1,
UV_UDP_PARTIAL = 2,
UV_UDP_REUSEADDR = 4,
UV_UDP_MMSG_CHUNK = 8,
UV_UDP_MMSG_FREE = 16,
UV_UDP_LINUX_RECVERR = 32,
UV_UDP_RECVMMSG = 256
}
global uv_udp_send_cb: type <cimport,nodecl> = @function(*uv_udp_send_t, cint): void
global uv_udp_recv_cb: type <cimport,nodecl> = @function(*uv_udp_t, clong, *uv_buf_t, *sockaddr, cuint): void
uv_udp_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
send_queue_size: csize,
send_queue_count: csize,
alloc_cb: uv_alloc_cb,
recv_cb: uv_udp_recv_cb,
io_watcher: uv__io_t,
write_queue: [2]pointer,
write_completed_queue: [2]pointer
}
uv_udp_send_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
handle: *uv_udp_t,
cb: uv_udp_send_cb,
queue: [2]pointer,
nbufs: cuint,
bufs: *uv_buf_t,
status: clong,
send_cb: uv_udp_send_cb,
bufsml: [4]uv_buf_t
}
global function uv_udp_init(a1: *uv_loop_t, handle: *uv_udp_t): cint <cimport,nodecl> end
global function uv_udp_init_ex(a1: *uv_loop_t, handle: *uv_udp_t, flags: cuint): cint <cimport,nodecl> end
global function uv_udp_open(handle: *uv_udp_t, sock: uv_os_sock_t): cint <cimport,nodecl> end
global function uv_udp_bind(handle: *uv_udp_t, addr: *sockaddr, flags: cuint): cint <cimport,nodecl> end
global function uv_udp_connect(handle: *uv_udp_t, addr: *sockaddr): cint <cimport,nodecl> end
global function uv_udp_getpeername(handle: *uv_udp_t, name: *sockaddr, namelen: *cint): cint <cimport,nodecl> end
global function uv_udp_getsockname(handle: *uv_udp_t, name: *sockaddr, namelen: *cint): cint <cimport,nodecl> end
global function uv_udp_set_membership(handle: *uv_udp_t, multicast_addr: cstring, interface_addr: cstring, membership: uv_membership): cint <cimport,nodecl> end
global function uv_udp_set_source_membership(handle: *uv_udp_t, multicast_addr: cstring, interface_addr: cstring, source_addr: cstring, membership: uv_membership): cint <cimport,nodecl> end
global function uv_udp_set_multicast_loop(handle: *uv_udp_t, on: cint): cint <cimport,nodecl> end
global function uv_udp_set_multicast_ttl(handle: *uv_udp_t, ttl: cint): cint <cimport,nodecl> end
global function uv_udp_set_multicast_interface(handle: *uv_udp_t, interface_addr: cstring): cint <cimport,nodecl> end
global function uv_udp_set_broadcast(handle: *uv_udp_t, on: cint): cint <cimport,nodecl> end
global function uv_udp_set_ttl(handle: *uv_udp_t, ttl: cint): cint <cimport,nodecl> end
global function uv_udp_send(req: *uv_udp_send_t, handle: *uv_udp_t, bufs: *uv_buf_t, nbufs: cuint, addr: *sockaddr, send_cb: uv_udp_send_cb): cint <cimport,nodecl> end
global function uv_udp_try_send(handle: *uv_udp_t, bufs: *uv_buf_t, nbufs: cuint, addr: *sockaddr): cint <cimport,nodecl> end
global function uv_udp_recv_start(handle: *uv_udp_t, alloc_cb: uv_alloc_cb, recv_cb: uv_udp_recv_cb): cint <cimport,nodecl> end
global function uv_udp_using_recvmmsg(handle: *uv_udp_t): cint <cimport,nodecl> end
global function uv_udp_recv_stop(handle: *uv_udp_t): cint <cimport,nodecl> end
global function uv_udp_get_send_queue_size(handle: *uv_udp_t): csize <cimport,nodecl> end
global function uv_udp_get_send_queue_count(handle: *uv_udp_t): csize <cimport,nodecl> end
uv_tty_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
write_queue_size: csize,
alloc_cb: uv_alloc_cb,
read_cb: uv_read_cb,
connect_req: *uv_connect_t,
shutdown_req: *uv_shutdown_t,
io_watcher: uv__io_t,
write_queue: [2]pointer,
write_completed_queue: [2]pointer,
connection_cb: uv_connection_cb,
delayed_error: cint,
accepted_fd: cint,
queued_fds: pointer,
mode: cint
}
global uv_tty_mode_t: type <cimport,nodecl,using> = @enum(cint){
UV_TTY_MODE_NORMAL = 0,
UV_TTY_MODE_RAW = 1,
UV_TTY_MODE_IO = 2
}
global uv_tty_vtermstate_t: type <cimport,nodecl,using> = @enum(cint){
UV_TTY_SUPPORTED = 0,
UV_TTY_UNSUPPORTED = 1
}
global function uv_tty_init(a1: *uv_loop_t, a2: *uv_tty_t, fd: uv_file, readable: cint): cint <cimport,nodecl> end
global function uv_tty_set_mode(a1: *uv_tty_t, mode: uv_tty_mode_t): cint <cimport,nodecl> end
global function uv_tty_reset_mode(): cint <cimport,nodecl> end
global function uv_tty_get_winsize(a1: *uv_tty_t, width: *cint, height: *cint): cint <cimport,nodecl> end
global function uv_tty_set_vterm_state(state: uv_tty_vtermstate_t): void <cimport,nodecl> end
global function uv_tty_get_vterm_state(state: *uv_tty_vtermstate_t): cint <cimport,nodecl> end
global function uv_guess_handle(file: uv_file): uv_handle_type <cimport,nodecl> end
uv_pipe_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
write_queue_size: csize,
alloc_cb: uv_alloc_cb,
read_cb: uv_read_cb,
connect_req: *uv_connect_t,
shutdown_req: *uv_shutdown_t,
io_watcher: uv__io_t,
write_queue: [2]pointer,
write_completed_queue: [2]pointer,
connection_cb: uv_connection_cb,
delayed_error: cint,
accepted_fd: cint,
queued_fds: pointer,
ipc: cint,
pipe_fname: cstring
}
global function uv_pipe_init(a1: *uv_loop_t, handle: *uv_pipe_t, ipc: cint): cint <cimport,nodecl> end
global function uv_pipe_open(a1: *uv_pipe_t, file: uv_file): cint <cimport,nodecl> end
global function uv_pipe_bind(handle: *uv_pipe_t, name: cstring): cint <cimport,nodecl> end
global function uv_pipe_connect(req: *uv_connect_t, handle: *uv_pipe_t, name: cstring, cb: uv_connect_cb): void <cimport,nodecl> end
global function uv_pipe_getsockname(handle: *uv_pipe_t, buffer: cstring, size: *csize): cint <cimport,nodecl> end
global function uv_pipe_getpeername(handle: *uv_pipe_t, buffer: cstring, size: *csize): cint <cimport,nodecl> end
global function uv_pipe_pending_instances(handle: *uv_pipe_t, count: cint): void <cimport,nodecl> end
global function uv_pipe_pending_count(handle: *uv_pipe_t): cint <cimport,nodecl> end
global function uv_pipe_pending_type(handle: *uv_pipe_t): uv_handle_type <cimport,nodecl> end
global function uv_pipe_chmod(handle: *uv_pipe_t, flags: cint): cint <cimport,nodecl> end
uv_poll_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
poll_cb: uv_poll_cb,
io_watcher: uv__io_t
}
global uv_poll_event: type <cimport,nodecl,using,ctypedef> = @enum(cint){
UV_READABLE = 1,
UV_WRITABLE = 2,
UV_DISCONNECT = 4,
UV_PRIORITIZED = 8
}
global function uv_poll_init(loop: *uv_loop_t, handle: *uv_poll_t, fd: cint): cint <cimport,nodecl> end
global function uv_poll_init_socket(loop: *uv_loop_t, handle: *uv_poll_t, socket: uv_os_sock_t): cint <cimport,nodecl> end
global function uv_poll_start(handle: *uv_poll_t, events: cint, cb: uv_poll_cb): cint <cimport,nodecl> end
global function uv_poll_stop(handle: *uv_poll_t): cint <cimport,nodecl> end
uv_prepare_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
prepare_cb: uv_prepare_cb,
queue: [2]pointer
}
global function uv_prepare_init(a1: *uv_loop_t, prepare: *uv_prepare_t): cint <cimport,nodecl> end
global function uv_prepare_start(prepare: *uv_prepare_t, cb: uv_prepare_cb): cint <cimport,nodecl> end
global function uv_prepare_stop(prepare: *uv_prepare_t): cint <cimport,nodecl> end
uv_check_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
check_cb: uv_check_cb,
queue: [2]pointer
}
global function uv_check_init(a1: *uv_loop_t, check: *uv_check_t): cint <cimport,nodecl> end
global function uv_check_start(check: *uv_check_t, cb: uv_check_cb): cint <cimport,nodecl> end
global function uv_check_stop(check: *uv_check_t): cint <cimport,nodecl> end
uv_idle_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
idle_cb: uv_idle_cb,
queue: [2]pointer
}
global function uv_idle_init(a1: *uv_loop_t, idle: *uv_idle_t): cint <cimport,nodecl> end
global function uv_idle_start(idle: *uv_idle_t, cb: uv_idle_cb): cint <cimport,nodecl> end
global function uv_idle_stop(idle: *uv_idle_t): cint <cimport,nodecl> end
uv_async_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
async_cb: uv_async_cb,
queue: [2]pointer,
pending: cint
}
global function uv_async_init(a1: *uv_loop_t, async: *uv_async_t, async_cb: uv_async_cb): cint <cimport,nodecl> end
global function uv_async_send(async: *uv_async_t): cint <cimport,nodecl> end
uv_timer_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
timer_cb: uv_timer_cb,
heap_node: [3]pointer,
timeout: uint64,
Repeat: uint64,
start_id: uint64
}
global function uv_timer_init(a1: *uv_loop_t, handle: *uv_timer_t): cint <cimport,nodecl> end
global function uv_timer_start(handle: *uv_timer_t, cb: uv_timer_cb, timeout: uint64, Repeat: uint64): cint <cimport,nodecl> end
global function uv_timer_stop(handle: *uv_timer_t): cint <cimport,nodecl> end
global function uv_timer_again(handle: *uv_timer_t): cint <cimport,nodecl> end
global function uv_timer_set_repeat(handle: *uv_timer_t, Repeat: uint64): void <cimport,nodecl> end
global function uv_timer_get_repeat(handle: *uv_timer_t): uint64 <cimport,nodecl> end
global function uv_timer_get_due_in(handle: *uv_timer_t): uint64 <cimport,nodecl> end
uv_getaddrinfo_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
loop: *uv_loop_t,
cb: uv_getaddrinfo_cb,
hints: *addrinfo,
hostname: cstring,
service: cstring,
addrinfo: *addrinfo,
retcode: cint
}
global function uv_getaddrinfo(loop: *uv_loop_t, req: *uv_getaddrinfo_t, getaddrinfo_cb: uv_getaddrinfo_cb, node: cstring, service: cstring, hints: *addrinfo): cint <cimport,nodecl> end
global function uv_freeaddrinfo(ai: *addrinfo): void <cimport,nodecl> end
uv_getnameinfo_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
loop: *uv_loop_t,
getnameinfo_cb: uv_getnameinfo_cb,
flags: cint,
host: [1025]cchar,
service: [32]cchar,
retcode: cint
}
global function uv_getnameinfo(loop: *uv_loop_t, req: *uv_getnameinfo_t, getnameinfo_cb: uv_getnameinfo_cb, addr: *sockaddr, flags: cint): cint <cimport,nodecl> end
global uv_stdio_flags: type <cimport,nodecl,using> = @enum(cint){
UV_IGNORE = 0,
UV_CREATE_PIPE = 1,
UV_INHERIT_FD = 2,
UV_INHERIT_STREAM = 4,
UV_READABLE_PIPE = 16,
UV_WRITABLE_PIPE = 32,
UV_NONBLOCK_PIPE = 64,
UV_OVERLAPPED_PIPE = 64
}
global uv_stdio_container_s: type <cimport,nodecl,ctypedef> = @record{
flags: uv_stdio_flags,
data: union{
stream: *uv_stream_t,
fd: cint
}
}
global uv_stdio_container_t: type = @uv_stdio_container_s
global uv_process_options_s: type <cimport,nodecl,ctypedef> = @record{
exit_cb: uv_exit_cb,
file: cstring,
args: *cstring,
env: *cstring,
cwd: cstring,
flags: cuint,
stdio_count: cint,
stdio: *uv_stdio_container_t,
uid: uv_uid_t,
gid: uv_gid_t
}
global uv_process_options_t: type = @uv_process_options_s
global uv_process_flags: type <cimport,nodecl,using,ctypedef> = @enum(cint){
UV_PROCESS_SETUID = 1,
UV_PROCESS_SETGID = 2,
UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = 4,
UV_PROCESS_DETACHED = 8,
UV_PROCESS_WINDOWS_HIDE = 16,
UV_PROCESS_WINDOWS_HIDE_CONSOLE = 32,
UV_PROCESS_WINDOWS_HIDE_GUI = 64
}
uv_process_s = @record{
data: pointer,
loop: *uv_loop_t,
type: uv_handle_type,
close_cb: uv_close_cb,
handle_queue: [2]pointer,
u: union{
fd: cint,
reserved: [4]pointer
},
next_closing: *uv_handle_t,
flags: cuint,
exit_cb: uv_exit_cb,
pid: cint,
queue: [2]pointer,
status: cint
}
global function uv_spawn(loop: *uv_loop_t, handle: *uv_process_t, options: *uv_process_options_t): cint <cimport,nodecl> end
global function uv_process_kill(a1: *uv_process_t, signum: cint): cint <cimport,nodecl> end
global function uv_kill(pid: cint, signum: cint): cint <cimport,nodecl> end
global function uv_process_get_pid(a1: *uv_process_t): uv_pid_t <cimport,nodecl> end
uv_work_s = @record{
data: pointer,
type: uv_req_type,
reserved: [6]pointer,
loop: *uv_loop_t,
work_cb: uv_work_cb,
after_work_cb: uv_after_work_cb,
}
global function uv_queue_work(loop: *uv_loop_t, req: *uv_work_t, work_cb: uv_work_cb, after_work_cb: uv_after_work_cb): cint <cimport,nodecl> end
global function uv_cancel(req: *uv_req_t): cint <cimport,nodecl> end
global uv_cpu_times_s: type <cimport,nodecl,ctypedef> = @record{
user: uint64,
nice: uint64,
sys: uint64,
idle: uint64,
irq: uint64
}
uv_cpu_info_s = @record{
model: cstring,
speed: cint,
cpu_times: uv_cpu_times_s
}
uv_interface_address_s = @record{
name: cstring,
phys_addr: [6]cchar,
is_internal: cint,
address: union{
address4: sockaddr_in,
address6: sockaddr_in6
},
netmask: union{
netmask4: sockaddr_in,
netmask6: sockaddr_in6
}
}
uv_passwd_s = @record{
username: cstring,
uid: culong,
gid: culong,
shell: cstring,
homedir: cstring
}
uv_utsname_s = @record{
sysname: [256]cchar,
release: [256]cchar,
version: [256]cchar,
machine: [256]cchar
}
uv_statfs_s = @record{
f_type: uint64,
f_bsize: uint64,
f_blocks: uint64,
f_bfree: uint64,
f_bavail: uint64,
f_files: uint64,
f_ffree: uint64,
f_spare: [4]uint64
}
global uv_dirent_type_t: type <cimport,nodecl,using> = @enum(cint){
UV_DIRENT_UNKNOWN = 0,
UV_DIRENT_FILE = 1,
UV_DIRENT_DIR = 2,
UV_DIRENT_LINK = 3,
UV_DIRENT_FIFO = 4,
UV_DIRENT_SOCKET = 5,
UV_DIRENT_CHAR = 6,
UV_DIRENT_BLOCK = 7
}
uv_dirent_s = @record{
name: cstring,
type: uv_dirent_type_t
}
global function uv_setup_args(argc: cint, argv: *cstring): *cstring <cimport,nodecl> end
global function uv_get_process_title(buffer: cstring, size: csize): cint <cimport,nodecl> end
global function uv_set_process_title(title: cstring): cint <cimport,nodecl> end
global function uv_resident_set_memory(rss: *csize): cint <cimport,nodecl> end
global function uv_uptime(uptime: *float64): cint <cimport,nodecl> end
global function uv_get_osfhandle(fd: cint): uv_os_fd_t <cimport,nodecl> end
global function uv_open_osfhandle(os_fd: uv_os_fd_t): cint <cimport,nodecl> end
global uv_timeval_t: type <cimport,nodecl> = @record{
tv_sec: clong,
tv_usec: clong
}
global uv_timeval64_t: type <cimport,nodecl> = @record{
tv_sec: int64,
tv_usec: int32
}
global uv_rusage_t: type <cimport,nodecl> = @record{
ru_utime: uv_timeval_t,
ru_stime: uv_timeval_t,
ru_maxrss: uint64,
ru_ixrss: uint64,
ru_idrss: uint64,
ru_isrss: uint64,
ru_minflt: uint64,
ru_majflt: uint64,
ru_nswap: uint64,
ru_inblock: uint64,
ru_oublock: uint64,
ru_msgsnd: uint64,
ru_msgrcv: uint64,
ru_nsignals: uint64,
ru_nvcsw: uint64,
ru_nivcsw: uint64
}
global function uv_getrusage(rusage: *uv_rusage_t): cint <cimport,nodecl> end
global function uv_os_homedir(buffer: cstring, size: *csize): cint <cimport,nodecl> end
global function uv_os_tmpdir(buffer: cstring, size: *csize): cint <cimport,nodecl> end
global function uv_os_get_passwd(pwd: *uv_passwd_t): cint <cimport,nodecl> end
global function uv_os_free_passwd(pwd: *uv_passwd_t): void <cimport,nodecl> end
global function uv_os_getpid(): uv_pid_t <cimport,nodecl> end
global function uv_os_getppid(): uv_pid_t <cimport,nodecl> end
global function uv_os_getpriority(pid: uv_pid_t, priority: *cint): cint <cimport,nodecl> end
global function uv_os_setpriority(pid: uv_pid_t, priority: cint): cint <cimport,nodecl> end
global function uv_available_parallelism(): cuint <cimport,nodecl> end
global function uv_cpu_info(cpu_infos: **uv_cpu_info_t, count: *cint): cint <cimport,nodecl> end
global function uv_free_cpu_info(cpu_infos: *uv_cpu_info_t, count: cint): void <cimport,nodecl> end
global function uv_interface_addresses(addresses: **uv_interface_address_t, count: *cint): cint <cimport,nodecl> end
global function uv_free_interface_addresses(addresses: *uv_interface_address_t, count: cint): void <cimport,nodecl> end
uv_env_item_s = @record{
name: cstring,
value: cstring
}
global function uv_os_environ(envitems: **uv_env_item_t, count: *cint): cint <cimport,nodecl> end
global function uv_os_free_environ(envitems: *uv_env_item_t, count: cint): void <cimport,nodecl> end
global function uv_os_getenv(name: cstring, buffer: cstring, size: *csize): cint <cimport,nodecl> end
global function uv_os_setenv(name: cstring, value: cstring): cint <cimport,nodecl> end
global function uv_os_unsetenv(name: cstring): cint <cimport,nodecl> end
global function uv_os_gethostname(buffer: cstring, size: *csize): cint <cimport,nodecl> end
global function uv_os_uname(buffer: *uv_utsname_t): cint <cimport,nodecl> end
global function uv_metrics_idle_time(loop: *uv_loop_t): uint64 <cimport,nodecl> end
global uv_fs_type: type <cimport,nodecl,using> = @enum(cint){
UV_FS_UNKNOWN = -1,
UV_FS_CUSTOM = 0,
UV_FS_OPEN = 1,
UV_FS_CLOSE = 2,
UV_FS_READ = 3,
UV_FS_WRITE = 4,
UV_FS_SENDFILE = 5,
UV_FS_STAT = 6,
UV_FS_LSTAT = 7,
UV_FS_FSTAT = 8,
UV_FS_FTRUNCATE = 9,
UV_FS_UTIME = 10,
UV_FS_FUTIME = 11,
UV_FS_ACCESS = 12,
UV_FS_CHMOD = 13,
UV_FS_FCHMOD = 14,
UV_FS_FSYNC = 15,
UV_FS_FDATASYNC = 16,
UV_FS_UNLINK = 17,
UV_FS_RMDIR = 18,
UV_FS_MKDIR = 19,