GCC Code Coverage Report
Directory: ../src/ Exec Total Coverage
File: /home/node-core-coverage/node-core-coverage/workdir/node/src/node_constants.cc Lines: 296 298 99.3 %
Date: 2016-07-12 Branches: 0 0 0.0 %

Line Exec Source
1
#include "node_constants.h"
2
#include "env.h"
3
#include "env-inl.h"
4
5
#include "uv.h"
6
#include "zlib.h"
7
8
#include <errno.h>
9
#if !defined(_MSC_VER)
10
#include <unistd.h>
11
#endif
12
#include <fcntl.h>
13
#include <signal.h>
14
#include <sys/types.h>
15
#include <sys/stat.h>
16
#include <limits>
17
18
#if HAVE_OPENSSL
19
# include <openssl/ec.h>
20
# include <openssl/ssl.h>
21
# ifndef OPENSSL_NO_ENGINE
22
#  include <openssl/engine.h>
23
# endif  // !OPENSSL_NO_ENGINE
24
#endif
25
26
namespace node {
27
28
using v8::Local;
29
using v8::Object;
30
31
#if HAVE_OPENSSL
32
const char* default_cipher_list = DEFAULT_CIPHER_LIST_CORE;
33
#endif
34
35
1554
void DefineErrnoConstants(Local<Object> target) {
36
#ifdef E2BIG
37
6216
  NODE_DEFINE_CONSTANT(target, E2BIG);
38
#endif
39
40
#ifdef EACCES
41
6216
  NODE_DEFINE_CONSTANT(target, EACCES);
42
#endif
43
44
#ifdef EADDRINUSE
45
6216
  NODE_DEFINE_CONSTANT(target, EADDRINUSE);
46
#endif
47
48
#ifdef EADDRNOTAVAIL
49
6216
  NODE_DEFINE_CONSTANT(target, EADDRNOTAVAIL);
50
#endif
51
52
#ifdef EAFNOSUPPORT
53
6216
  NODE_DEFINE_CONSTANT(target, EAFNOSUPPORT);
54
#endif
55
56
#ifdef EAGAIN
57
6216
  NODE_DEFINE_CONSTANT(target, EAGAIN);
58
#endif
59
60
#ifdef EALREADY
61
6216
  NODE_DEFINE_CONSTANT(target, EALREADY);
62
#endif
63
64
#ifdef EBADF
65
6216
  NODE_DEFINE_CONSTANT(target, EBADF);
66
#endif
67
68
#ifdef EBADMSG
69
6216
  NODE_DEFINE_CONSTANT(target, EBADMSG);
70
#endif
71
72
#ifdef EBUSY
73
6216
  NODE_DEFINE_CONSTANT(target, EBUSY);
74
#endif
75
76
#ifdef ECANCELED
77
6216
  NODE_DEFINE_CONSTANT(target, ECANCELED);
78
#endif
79
80
#ifdef ECHILD
81
6216
  NODE_DEFINE_CONSTANT(target, ECHILD);
82
#endif
83
84
#ifdef ECONNABORTED
85
6216
  NODE_DEFINE_CONSTANT(target, ECONNABORTED);
86
#endif
87
88
#ifdef ECONNREFUSED
89
6216
  NODE_DEFINE_CONSTANT(target, ECONNREFUSED);
90
#endif
91
92
#ifdef ECONNRESET
93
6216
  NODE_DEFINE_CONSTANT(target, ECONNRESET);
94
#endif
95
96
#ifdef EDEADLK
97
6216
  NODE_DEFINE_CONSTANT(target, EDEADLK);
98
#endif
99
100
#ifdef EDESTADDRREQ
101
6216
  NODE_DEFINE_CONSTANT(target, EDESTADDRREQ);
102
#endif
103
104
#ifdef EDOM
105
6216
  NODE_DEFINE_CONSTANT(target, EDOM);
106
#endif
107
108
#ifdef EDQUOT
109
6216
  NODE_DEFINE_CONSTANT(target, EDQUOT);
110
#endif
111
112
#ifdef EEXIST
113
6216
  NODE_DEFINE_CONSTANT(target, EEXIST);
114
#endif
115
116
#ifdef EFAULT
117
6216
  NODE_DEFINE_CONSTANT(target, EFAULT);
118
#endif
119
120
#ifdef EFBIG
121
6216
  NODE_DEFINE_CONSTANT(target, EFBIG);
122
#endif
123
124
#ifdef EHOSTUNREACH
125
6216
  NODE_DEFINE_CONSTANT(target, EHOSTUNREACH);
126
#endif
127
128
#ifdef EIDRM
129
6216
  NODE_DEFINE_CONSTANT(target, EIDRM);
130
#endif
131
132
#ifdef EILSEQ
133
6216
  NODE_DEFINE_CONSTANT(target, EILSEQ);
134
#endif
135
136
#ifdef EINPROGRESS
137
6216
  NODE_DEFINE_CONSTANT(target, EINPROGRESS);
138
#endif
139
140
#ifdef EINTR
141
6216
  NODE_DEFINE_CONSTANT(target, EINTR);
142
#endif
143
144
#ifdef EINVAL
145
6216
  NODE_DEFINE_CONSTANT(target, EINVAL);
146
#endif
147
148
#ifdef EIO
149
6216
  NODE_DEFINE_CONSTANT(target, EIO);
150
#endif
151
152
#ifdef EISCONN
153
6216
  NODE_DEFINE_CONSTANT(target, EISCONN);
154
#endif
155
156
#ifdef EISDIR
157
6216
  NODE_DEFINE_CONSTANT(target, EISDIR);
158
#endif
159
160
#ifdef ELOOP
161
6216
  NODE_DEFINE_CONSTANT(target, ELOOP);
162
#endif
163
164
#ifdef EMFILE
165
6216
  NODE_DEFINE_CONSTANT(target, EMFILE);
166
#endif
167
168
#ifdef EMLINK
169
6216
  NODE_DEFINE_CONSTANT(target, EMLINK);
170
#endif
171
172
#ifdef EMSGSIZE
173
6216
  NODE_DEFINE_CONSTANT(target, EMSGSIZE);
174
#endif
175
176
#ifdef EMULTIHOP
177
6216
  NODE_DEFINE_CONSTANT(target, EMULTIHOP);
178
#endif
179
180
#ifdef ENAMETOOLONG
181
6216
  NODE_DEFINE_CONSTANT(target, ENAMETOOLONG);
182
#endif
183
184
#ifdef ENETDOWN
185
6216
  NODE_DEFINE_CONSTANT(target, ENETDOWN);
186
#endif
187
188
#ifdef ENETRESET
189
6216
  NODE_DEFINE_CONSTANT(target, ENETRESET);
190
#endif
191
192
#ifdef ENETUNREACH
193
6216
  NODE_DEFINE_CONSTANT(target, ENETUNREACH);
194
#endif
195
196
#ifdef ENFILE
197
6216
  NODE_DEFINE_CONSTANT(target, ENFILE);
198
#endif
199
200
#ifdef ENOBUFS
201
6216
  NODE_DEFINE_CONSTANT(target, ENOBUFS);
202
#endif
203
204
#ifdef ENODATA
205
6216
  NODE_DEFINE_CONSTANT(target, ENODATA);
206
#endif
207
208
#ifdef ENODEV
209
6216
  NODE_DEFINE_CONSTANT(target, ENODEV);
210
#endif
211
212
#ifdef ENOENT
213
6216
  NODE_DEFINE_CONSTANT(target, ENOENT);
214
#endif
215
216
#ifdef ENOEXEC
217
6216
  NODE_DEFINE_CONSTANT(target, ENOEXEC);
218
#endif
219
220
#ifdef ENOLCK
221
6216
  NODE_DEFINE_CONSTANT(target, ENOLCK);
222
#endif
223
224
#ifdef ENOLINK
225
6216
  NODE_DEFINE_CONSTANT(target, ENOLINK);
226
#endif
227
228
#ifdef ENOMEM
229
6216
  NODE_DEFINE_CONSTANT(target, ENOMEM);
230
#endif
231
232
#ifdef ENOMSG
233
6216
  NODE_DEFINE_CONSTANT(target, ENOMSG);
234
#endif
235
236
#ifdef ENOPROTOOPT
237
6216
  NODE_DEFINE_CONSTANT(target, ENOPROTOOPT);
238
#endif
239
240
#ifdef ENOSPC
241
6216
  NODE_DEFINE_CONSTANT(target, ENOSPC);
242
#endif
243
244
#ifdef ENOSR
245
6216
  NODE_DEFINE_CONSTANT(target, ENOSR);
246
#endif
247
248
#ifdef ENOSTR
249
6216
  NODE_DEFINE_CONSTANT(target, ENOSTR);
250
#endif
251
252
#ifdef ENOSYS
253
6216
  NODE_DEFINE_CONSTANT(target, ENOSYS);
254
#endif
255
256
#ifdef ENOTCONN
257
6216
  NODE_DEFINE_CONSTANT(target, ENOTCONN);
258
#endif
259
260
#ifdef ENOTDIR
261
6216
  NODE_DEFINE_CONSTANT(target, ENOTDIR);
262
#endif
263
264
#ifdef ENOTEMPTY
265
6216
  NODE_DEFINE_CONSTANT(target, ENOTEMPTY);
266
#endif
267
268
#ifdef ENOTSOCK
269
6216
  NODE_DEFINE_CONSTANT(target, ENOTSOCK);
270
#endif
271
272
#ifdef ENOTSUP
273
6216
  NODE_DEFINE_CONSTANT(target, ENOTSUP);
274
#endif
275
276
#ifdef ENOTTY
277
6216
  NODE_DEFINE_CONSTANT(target, ENOTTY);
278
#endif
279
280
#ifdef ENXIO
281
6216
  NODE_DEFINE_CONSTANT(target, ENXIO);
282
#endif
283
284
#ifdef EOPNOTSUPP
285
6216
  NODE_DEFINE_CONSTANT(target, EOPNOTSUPP);
286
#endif
287
288
#ifdef EOVERFLOW
289
6216
  NODE_DEFINE_CONSTANT(target, EOVERFLOW);
290
#endif
291
292
#ifdef EPERM
293
6216
  NODE_DEFINE_CONSTANT(target, EPERM);
294
#endif
295
296
#ifdef EPIPE
297
6216
  NODE_DEFINE_CONSTANT(target, EPIPE);
298
#endif
299
300
#ifdef EPROTO
301
6216
  NODE_DEFINE_CONSTANT(target, EPROTO);
302
#endif
303
304
#ifdef EPROTONOSUPPORT
305
6216
  NODE_DEFINE_CONSTANT(target, EPROTONOSUPPORT);
306
#endif
307
308
#ifdef EPROTOTYPE
309
6216
  NODE_DEFINE_CONSTANT(target, EPROTOTYPE);
310
#endif
311
312
#ifdef ERANGE
313
6216
  NODE_DEFINE_CONSTANT(target, ERANGE);
314
#endif
315
316
#ifdef EROFS
317
6216
  NODE_DEFINE_CONSTANT(target, EROFS);
318
#endif
319
320
#ifdef ESPIPE
321
6216
  NODE_DEFINE_CONSTANT(target, ESPIPE);
322
#endif
323
324
#ifdef ESRCH
325
6216
  NODE_DEFINE_CONSTANT(target, ESRCH);
326
#endif
327
328
#ifdef ESTALE
329
6216
  NODE_DEFINE_CONSTANT(target, ESTALE);
330
#endif
331
332
#ifdef ETIME
333
6216
  NODE_DEFINE_CONSTANT(target, ETIME);
334
#endif
335
336
#ifdef ETIMEDOUT
337
6216
  NODE_DEFINE_CONSTANT(target, ETIMEDOUT);
338
#endif
339
340
#ifdef ETXTBSY
341
6216
  NODE_DEFINE_CONSTANT(target, ETXTBSY);
342
#endif
343
344
#ifdef EWOULDBLOCK
345
6216
  NODE_DEFINE_CONSTANT(target, EWOULDBLOCK);
346
#endif
347
348
#ifdef EXDEV
349
6216
  NODE_DEFINE_CONSTANT(target, EXDEV);
350
#endif
351
1554
}
352
353
void DefineWindowsErrorConstants(Local<Object> target) {
354
#ifdef WSAEINTR
355
  NODE_DEFINE_CONSTANT(target, WSAEINTR);
356
#endif
357
358
#ifdef WSAEBADF
359
  NODE_DEFINE_CONSTANT(target, WSAEBADF);
360
#endif
361
362
#ifdef WSAEACCES
363
  NODE_DEFINE_CONSTANT(target, WSAEACCES);
364
#endif
365
366
#ifdef WSAEFAULT
367
  NODE_DEFINE_CONSTANT(target, WSAEFAULT);
368
#endif
369
370
#ifdef WSAEINVAL
371
  NODE_DEFINE_CONSTANT(target, WSAEINVAL);
372
#endif
373
374
#ifdef WSAEMFILE
375
  NODE_DEFINE_CONSTANT(target, WSAEMFILE);
376
#endif
377
378
#ifdef WSAEWOULDBLOCK
379
  NODE_DEFINE_CONSTANT(target, WSAEWOULDBLOCK);
380
#endif
381
382
#ifdef WSAEINPROGRESS
383
  NODE_DEFINE_CONSTANT(target, WSAEINPROGRESS);
384
#endif
385
386
#ifdef WSAEALREADY
387
  NODE_DEFINE_CONSTANT(target, WSAEALREADY);
388
#endif
389
390
#ifdef WSAENOTSOCK
391
  NODE_DEFINE_CONSTANT(target, WSAENOTSOCK);
392
#endif
393
394
#ifdef WSAEDESTADDRREQ
395
  NODE_DEFINE_CONSTANT(target, WSAEDESTADDRREQ);
396
#endif
397
398
#ifdef WSAEMSGSIZE
399
  NODE_DEFINE_CONSTANT(target, WSAEMSGSIZE);
400
#endif
401
402
#ifdef WSAEPROTOTYPE
403
  NODE_DEFINE_CONSTANT(target, WSAEPROTOTYPE);
404
#endif
405
406
#ifdef WSAENOPROTOOPT
407
  NODE_DEFINE_CONSTANT(target, WSAENOPROTOOPT);
408
#endif
409
410
#ifdef WSAEPROTONOSUPPORT
411
  NODE_DEFINE_CONSTANT(target, WSAEPROTONOSUPPORT);
412
#endif
413
414
#ifdef WSAESOCKTNOSUPPORT
415
  NODE_DEFINE_CONSTANT(target, WSAESOCKTNOSUPPORT);
416
#endif
417
418
#ifdef WSAEOPNOTSUPP
419
  NODE_DEFINE_CONSTANT(target, WSAEOPNOTSUPP);
420
#endif
421
422
#ifdef WSAEPFNOSUPPORT
423
  NODE_DEFINE_CONSTANT(target, WSAEPFNOSUPPORT);
424
#endif
425
426
#ifdef WSAEAFNOSUPPORT
427
  NODE_DEFINE_CONSTANT(target, WSAEAFNOSUPPORT);
428
#endif
429
430
#ifdef WSAEADDRINUSE
431
  NODE_DEFINE_CONSTANT(target, WSAEADDRINUSE);
432
#endif
433
434
#ifdef WSAEADDRNOTAVAIL
435
  NODE_DEFINE_CONSTANT(target, WSAEADDRNOTAVAIL);
436
#endif
437
438
#ifdef WSAENETDOWN
439
  NODE_DEFINE_CONSTANT(target, WSAENETDOWN);
440
#endif
441
442
#ifdef WSAENETUNREACH
443
  NODE_DEFINE_CONSTANT(target, WSAENETUNREACH);
444
#endif
445
446
#ifdef WSAENETRESET
447
  NODE_DEFINE_CONSTANT(target, WSAENETRESET);
448
#endif
449
450
#ifdef WSAECONNABORTED
451
  NODE_DEFINE_CONSTANT(target, WSAECONNABORTED);
452
#endif
453
454
#ifdef WSAECONNRESET
455
  NODE_DEFINE_CONSTANT(target, WSAECONNRESET);
456
#endif
457
458
#ifdef WSAENOBUFS
459
  NODE_DEFINE_CONSTANT(target, WSAENOBUFS);
460
#endif
461
462
#ifdef WSAEISCONN
463
  NODE_DEFINE_CONSTANT(target, WSAEISCONN);
464
#endif
465
466
#ifdef WSAENOTCONN
467
  NODE_DEFINE_CONSTANT(target, WSAENOTCONN);
468
#endif
469
470
#ifdef WSAESHUTDOWN
471
  NODE_DEFINE_CONSTANT(target, WSAESHUTDOWN);
472
#endif
473
474
#ifdef WSAETOOMANYREFS
475
  NODE_DEFINE_CONSTANT(target, WSAETOOMANYREFS);
476
#endif
477
478
#ifdef WSAETIMEDOUT
479
  NODE_DEFINE_CONSTANT(target, WSAETIMEDOUT);
480
#endif
481
482
#ifdef WSAECONNREFUSED
483
  NODE_DEFINE_CONSTANT(target, WSAECONNREFUSED);
484
#endif
485
486
#ifdef WSAELOOP
487
  NODE_DEFINE_CONSTANT(target, WSAELOOP);
488
#endif
489
490
#ifdef WSAENAMETOOLONG
491
  NODE_DEFINE_CONSTANT(target, WSAENAMETOOLONG);
492
#endif
493
494
#ifdef WSAEHOSTDOWN
495
  NODE_DEFINE_CONSTANT(target, WSAEHOSTDOWN);
496
#endif
497
498
#ifdef WSAEHOSTUNREACH
499
  NODE_DEFINE_CONSTANT(target, WSAEHOSTUNREACH);
500
#endif
501
502
#ifdef WSAENOTEMPTY
503
  NODE_DEFINE_CONSTANT(target, WSAENOTEMPTY);
504
#endif
505
506
#ifdef WSAEPROCLIM
507
  NODE_DEFINE_CONSTANT(target, WSAEPROCLIM);
508
#endif
509
510
#ifdef WSAEUSERS
511
  NODE_DEFINE_CONSTANT(target, WSAEUSERS);
512
#endif
513
514
#ifdef WSAEDQUOT
515
  NODE_DEFINE_CONSTANT(target, WSAEDQUOT);
516
#endif
517
518
#ifdef WSAESTALE
519
  NODE_DEFINE_CONSTANT(target, WSAESTALE);
520
#endif
521
522
#ifdef WSAEREMOTE
523
  NODE_DEFINE_CONSTANT(target, WSAEREMOTE);
524
#endif
525
526
#ifdef WSASYSNOTREADY
527
  NODE_DEFINE_CONSTANT(target, WSASYSNOTREADY);
528
#endif
529
530
#ifdef WSAVERNOTSUPPORTED
531
  NODE_DEFINE_CONSTANT(target, WSAVERNOTSUPPORTED);
532
#endif
533
534
#ifdef WSANOTINITIALISED
535
  NODE_DEFINE_CONSTANT(target, WSANOTINITIALISED);
536
#endif
537
538
#ifdef WSAEDISCON
539
  NODE_DEFINE_CONSTANT(target, WSAEDISCON);
540
#endif
541
542
#ifdef WSAENOMORE
543
  NODE_DEFINE_CONSTANT(target, WSAENOMORE);
544
#endif
545
546
#ifdef WSAECANCELLED
547
  NODE_DEFINE_CONSTANT(target, WSAECANCELLED);
548
#endif
549
550
#ifdef WSAEINVALIDPROCTABLE
551
  NODE_DEFINE_CONSTANT(target, WSAEINVALIDPROCTABLE);
552
#endif
553
554
#ifdef WSAEINVALIDPROVIDER
555
  NODE_DEFINE_CONSTANT(target, WSAEINVALIDPROVIDER);
556
#endif
557
558
#ifdef WSAEPROVIDERFAILEDINIT
559
  NODE_DEFINE_CONSTANT(target, WSAEPROVIDERFAILEDINIT);
560
#endif
561
562
#ifdef WSASYSCALLFAILURE
563
  NODE_DEFINE_CONSTANT(target, WSASYSCALLFAILURE);
564
#endif
565
566
#ifdef WSASERVICE_NOT_FOUND
567
  NODE_DEFINE_CONSTANT(target, WSASERVICE_NOT_FOUND);
568
#endif
569
570
#ifdef WSATYPE_NOT_FOUND
571
  NODE_DEFINE_CONSTANT(target, WSATYPE_NOT_FOUND);
572
#endif
573
574
#ifdef WSA_E_NO_MORE
575
  NODE_DEFINE_CONSTANT(target, WSA_E_NO_MORE);
576
#endif
577
578
#ifdef WSA_E_CANCELLED
579
  NODE_DEFINE_CONSTANT(target, WSA_E_CANCELLED);
580
#endif
581
582
#ifdef WSAEREFUSED
583
  NODE_DEFINE_CONSTANT(target, WSAEREFUSED);
584
#endif
585
}
586
587
1554
void DefineSignalConstants(Local<Object> target) {
588
#ifdef SIGHUP
589
6216
  NODE_DEFINE_CONSTANT(target, SIGHUP);
590
#endif
591
592
#ifdef SIGINT
593
6216
  NODE_DEFINE_CONSTANT(target, SIGINT);
594
#endif
595
596
#ifdef SIGQUIT
597
6216
  NODE_DEFINE_CONSTANT(target, SIGQUIT);
598
#endif
599
600
#ifdef SIGILL
601
6216
  NODE_DEFINE_CONSTANT(target, SIGILL);
602
#endif
603
604
#ifdef SIGTRAP
605
6216
  NODE_DEFINE_CONSTANT(target, SIGTRAP);
606
#endif
607
608
#ifdef SIGABRT
609
6216
  NODE_DEFINE_CONSTANT(target, SIGABRT);
610
#endif
611
612
#ifdef SIGIOT
613
6216
  NODE_DEFINE_CONSTANT(target, SIGIOT);
614
#endif
615
616
#ifdef SIGBUS
617
6216
  NODE_DEFINE_CONSTANT(target, SIGBUS);
618
#endif
619
620
#ifdef SIGFPE
621
6216
  NODE_DEFINE_CONSTANT(target, SIGFPE);
622
#endif
623
624
#ifdef SIGKILL
625
6216
  NODE_DEFINE_CONSTANT(target, SIGKILL);
626
#endif
627
628
#ifdef SIGUSR1
629
6216
  NODE_DEFINE_CONSTANT(target, SIGUSR1);
630
#endif
631
632
#ifdef SIGSEGV
633
6216
  NODE_DEFINE_CONSTANT(target, SIGSEGV);
634
#endif
635
636
#ifdef SIGUSR2
637
6216
  NODE_DEFINE_CONSTANT(target, SIGUSR2);
638
#endif
639
640
#ifdef SIGPIPE
641
6216
  NODE_DEFINE_CONSTANT(target, SIGPIPE);
642
#endif
643
644
#ifdef SIGALRM
645
6216
  NODE_DEFINE_CONSTANT(target, SIGALRM);
646
#endif
647
648
6216
  NODE_DEFINE_CONSTANT(target, SIGTERM);
649
650
#ifdef SIGCHLD
651
6216
  NODE_DEFINE_CONSTANT(target, SIGCHLD);
652
#endif
653
654
#ifdef SIGSTKFLT
655
6216
  NODE_DEFINE_CONSTANT(target, SIGSTKFLT);
656
#endif
657
658
659
#ifdef SIGCONT
660
6216
  NODE_DEFINE_CONSTANT(target, SIGCONT);
661
#endif
662
663
#ifdef SIGSTOP
664
6216
  NODE_DEFINE_CONSTANT(target, SIGSTOP);
665
#endif
666
667
#ifdef SIGTSTP
668
6216
  NODE_DEFINE_CONSTANT(target, SIGTSTP);
669
#endif
670
671
#ifdef SIGBREAK
672
  NODE_DEFINE_CONSTANT(target, SIGBREAK);
673
#endif
674
675
#ifdef SIGTTIN
676
6216
  NODE_DEFINE_CONSTANT(target, SIGTTIN);
677
#endif
678
679
#ifdef SIGTTOU
680
6216
  NODE_DEFINE_CONSTANT(target, SIGTTOU);
681
#endif
682
683
#ifdef SIGURG
684
6216
  NODE_DEFINE_CONSTANT(target, SIGURG);
685
#endif
686
687
#ifdef SIGXCPU
688
6216
  NODE_DEFINE_CONSTANT(target, SIGXCPU);
689
#endif
690
691
#ifdef SIGXFSZ
692
6216
  NODE_DEFINE_CONSTANT(target, SIGXFSZ);
693
#endif
694
695
#ifdef SIGVTALRM
696
6216
  NODE_DEFINE_CONSTANT(target, SIGVTALRM);
697
#endif
698
699
#ifdef SIGPROF
700
6216
  NODE_DEFINE_CONSTANT(target, SIGPROF);
701
#endif
702
703
#ifdef SIGWINCH
704
6216
  NODE_DEFINE_CONSTANT(target, SIGWINCH);
705
#endif
706
707
#ifdef SIGIO
708
6216
  NODE_DEFINE_CONSTANT(target, SIGIO);
709
#endif
710
711
#ifdef SIGPOLL
712
6216
  NODE_DEFINE_CONSTANT(target, SIGPOLL);
713
#endif
714
715
#ifdef SIGLOST
716
  NODE_DEFINE_CONSTANT(target, SIGLOST);
717
#endif
718
719
#ifdef SIGPWR
720
6216
  NODE_DEFINE_CONSTANT(target, SIGPWR);
721
#endif
722
723
#ifdef SIGINFO
724
  NODE_DEFINE_CONSTANT(target, SIGINFO);
725
#endif
726
727
#ifdef SIGSYS
728
6216
  NODE_DEFINE_CONSTANT(target, SIGSYS);
729
#endif
730
731
#ifdef SIGUNUSED
732
6216
  NODE_DEFINE_CONSTANT(target, SIGUNUSED);
733
#endif
734
1554
}
735
736
1554
void DefineOpenSSLConstants(Local<Object> target) {
737
#ifdef SSL_OP_ALL
738
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_ALL);
739
#endif
740
741
#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
742
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION);
743
#endif
744
745
#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
746
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_CIPHER_SERVER_PREFERENCE);
747
#endif
748
749
#ifdef SSL_OP_CISCO_ANYCONNECT
750
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_CISCO_ANYCONNECT);
751
#endif
752
753
#ifdef SSL_OP_COOKIE_EXCHANGE
754
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_COOKIE_EXCHANGE);
755
#endif
756
757
#ifdef SSL_OP_CRYPTOPRO_TLSEXT_BUG
758
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_CRYPTOPRO_TLSEXT_BUG);
759
#endif
760
761
#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
762
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
763
#endif
764
765
#ifdef SSL_OP_EPHEMERAL_RSA
766
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_EPHEMERAL_RSA);
767
#endif
768
769
#ifdef SSL_OP_LEGACY_SERVER_CONNECT
770
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_LEGACY_SERVER_CONNECT);
771
#endif
772
773
#ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
774
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER);
775
#endif
776
777
#ifdef SSL_OP_MICROSOFT_SESS_ID_BUG
778
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_MICROSOFT_SESS_ID_BUG);
779
#endif
780
781
#ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING
782
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_MSIE_SSLV2_RSA_PADDING);
783
#endif
784
785
#ifdef SSL_OP_NETSCAPE_CA_DN_BUG
786
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_CA_DN_BUG);
787
#endif
788
789
#ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG
790
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_CHALLENGE_BUG);
791
#endif
792
793
#ifdef SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
794
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
795
#endif
796
797
#ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
798
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG);
799
#endif
800
801
#ifdef SSL_OP_NO_COMPRESSION
802
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_COMPRESSION);
803
#endif
804
805
#ifdef SSL_OP_NO_QUERY_MTU
806
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_QUERY_MTU);
807
#endif
808
809
#ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
810
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
811
#endif
812
813
#ifdef SSL_OP_NO_SSLv2
814
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SSLv2);
815
#endif
816
817
#ifdef SSL_OP_NO_SSLv3
818
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SSLv3);
819
#endif
820
821
#ifdef SSL_OP_NO_TICKET
822
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TICKET);
823
#endif
824
825
#ifdef SSL_OP_NO_TLSv1
826
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1);
827
#endif
828
829
#ifdef SSL_OP_NO_TLSv1_1
830
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_1);
831
#endif
832
833
#ifdef SSL_OP_NO_TLSv1_2
834
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_2);
835
#endif
836
837
#ifdef SSL_OP_PKCS1_CHECK_1
838
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_1);
839
#endif
840
841
#ifdef SSL_OP_PKCS1_CHECK_2
842
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_2);
843
#endif
844
845
#ifdef SSL_OP_SINGLE_DH_USE
846
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_DH_USE);
847
#endif
848
849
#ifdef SSL_OP_SINGLE_ECDH_USE
850
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_ECDH_USE);
851
#endif
852
853
#ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG
854
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_SSLEAY_080_CLIENT_DH_BUG);
855
#endif
856
857
#ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
858
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG);
859
#endif
860
861
#ifdef SSL_OP_TLS_BLOCK_PADDING_BUG
862
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_BLOCK_PADDING_BUG);
863
#endif
864
865
#ifdef SSL_OP_TLS_D5_BUG
866
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_D5_BUG);
867
#endif
868
869
#ifdef SSL_OP_TLS_ROLLBACK_BUG
870
6216
    NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_ROLLBACK_BUG);
871
#endif
872
873
# ifndef OPENSSL_NO_ENGINE
874
875
# ifdef ENGINE_METHOD_RSA
876
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RSA);
877
# endif
878
879
# ifdef ENGINE_METHOD_DSA
880
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DSA);
881
# endif
882
883
# ifdef ENGINE_METHOD_DH
884
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DH);
885
# endif
886
887
# ifdef ENGINE_METHOD_RAND
888
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RAND);
889
# endif
890
891
# ifdef ENGINE_METHOD_ECDH
892
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_ECDH);
893
# endif
894
895
# ifdef ENGINE_METHOD_ECDSA
896
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_ECDSA);
897
# endif
898
899
# ifdef ENGINE_METHOD_CIPHERS
900
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_CIPHERS);
901
# endif
902
903
# ifdef ENGINE_METHOD_DIGESTS
904
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DIGESTS);
905
# endif
906
907
# ifdef ENGINE_METHOD_STORE
908
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_STORE);
909
# endif
910
911
# ifdef ENGINE_METHOD_PKEY_METHS
912
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_PKEY_METHS);
913
# endif
914
915
# ifdef ENGINE_METHOD_PKEY_ASN1_METHS
916
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_PKEY_ASN1_METHS);
917
# endif
918
919
# ifdef ENGINE_METHOD_ALL
920
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_ALL);
921
# endif
922
923
# ifdef ENGINE_METHOD_NONE
924
6216
    NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_NONE);
925
# endif
926
927
# endif  // !OPENSSL_NO_ENGINE
928
929
#ifdef DH_CHECK_P_NOT_SAFE_PRIME
930
6216
    NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_SAFE_PRIME);
931
#endif
932
933
#ifdef DH_CHECK_P_NOT_PRIME
934
6216
    NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_PRIME);
935
#endif
936
937
#ifdef DH_UNABLE_TO_CHECK_GENERATOR
938
6216
    NODE_DEFINE_CONSTANT(target, DH_UNABLE_TO_CHECK_GENERATOR);
939
#endif
940
941
#ifdef DH_NOT_SUITABLE_GENERATOR
942
6216
    NODE_DEFINE_CONSTANT(target, DH_NOT_SUITABLE_GENERATOR);
943
#endif
944
945
#ifdef OPENSSL_NPN_NEGOTIATED
946
#define NPN_ENABLED 1
947
6216
    NODE_DEFINE_CONSTANT(target, NPN_ENABLED);
948
#endif
949
950
#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
951
#define ALPN_ENABLED 1
952
6216
    NODE_DEFINE_CONSTANT(target, ALPN_ENABLED);
953
#endif
954
955
#ifdef RSA_PKCS1_PADDING
956
6216
    NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PADDING);
957
#endif
958
959
#ifdef RSA_SSLV23_PADDING
960
6216
    NODE_DEFINE_CONSTANT(target, RSA_SSLV23_PADDING);
961
#endif
962
963
#ifdef RSA_NO_PADDING
964
6216
    NODE_DEFINE_CONSTANT(target, RSA_NO_PADDING);
965
#endif
966
967
#ifdef RSA_PKCS1_OAEP_PADDING
968
6216
    NODE_DEFINE_CONSTANT(target, RSA_PKCS1_OAEP_PADDING);
969
#endif
970
971
#ifdef RSA_X931_PADDING
972
6216
    NODE_DEFINE_CONSTANT(target, RSA_X931_PADDING);
973
#endif
974
975
#ifdef RSA_PKCS1_PSS_PADDING
976
6216
    NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PSS_PADDING);
977
#endif
978
979
#if HAVE_OPENSSL
980
  // NOTE: These are not defines
981
6216
  NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_COMPRESSED);
982
983
6216
  NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_UNCOMPRESSED);
984
985
6216
  NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_HYBRID);
986
#endif
987
1554
}
988
989
1554
void DefineSystemConstants(Local<Object> target) {
990
  // file access modes
991
6216
  NODE_DEFINE_CONSTANT(target, O_RDONLY);
992
6216
  NODE_DEFINE_CONSTANT(target, O_WRONLY);
993
6216
  NODE_DEFINE_CONSTANT(target, O_RDWR);
994
995
6216
  NODE_DEFINE_CONSTANT(target, S_IFMT);
996
6216
  NODE_DEFINE_CONSTANT(target, S_IFREG);
997
6216
  NODE_DEFINE_CONSTANT(target, S_IFDIR);
998
6216
  NODE_DEFINE_CONSTANT(target, S_IFCHR);
999
#ifdef S_IFBLK
1000
6216
  NODE_DEFINE_CONSTANT(target, S_IFBLK);
1001
#endif
1002
1003
#ifdef S_IFIFO
1004
6216
  NODE_DEFINE_CONSTANT(target, S_IFIFO);
1005
#endif
1006
1007
#ifdef S_IFLNK
1008
6216
  NODE_DEFINE_CONSTANT(target, S_IFLNK);
1009
#endif
1010
1011
#ifdef S_IFSOCK
1012
6216
  NODE_DEFINE_CONSTANT(target, S_IFSOCK);
1013
#endif
1014
1015
#ifdef O_CREAT
1016
6216
  NODE_DEFINE_CONSTANT(target, O_CREAT);
1017
#endif
1018
1019
#ifdef O_EXCL
1020
6216
  NODE_DEFINE_CONSTANT(target, O_EXCL);
1021
#endif
1022
1023
#ifdef O_NOCTTY
1024
6216
  NODE_DEFINE_CONSTANT(target, O_NOCTTY);
1025
#endif
1026
1027
#ifdef O_TRUNC
1028
6216
  NODE_DEFINE_CONSTANT(target, O_TRUNC);
1029
#endif
1030
1031
#ifdef O_APPEND
1032
6216
  NODE_DEFINE_CONSTANT(target, O_APPEND);
1033
#endif
1034
1035
#ifdef O_DIRECTORY
1036
6216
  NODE_DEFINE_CONSTANT(target, O_DIRECTORY);
1037
#endif
1038
1039
#ifdef O_EXCL
1040
6216
  NODE_DEFINE_CONSTANT(target, O_EXCL);
1041
#endif
1042
1043
#ifdef O_NOATIME
1044
6216
  NODE_DEFINE_CONSTANT(target, O_NOATIME);
1045
#endif
1046
1047
#ifdef O_NOFOLLOW
1048
6216
  NODE_DEFINE_CONSTANT(target, O_NOFOLLOW);
1049
#endif
1050
1051
#ifdef O_SYNC
1052
6216
  NODE_DEFINE_CONSTANT(target, O_SYNC);
1053
#endif
1054
1055
#ifdef O_SYMLINK
1056
  NODE_DEFINE_CONSTANT(target, O_SYMLINK);
1057
#endif
1058
1059
#ifdef O_DIRECT
1060
6216
  NODE_DEFINE_CONSTANT(target, O_DIRECT);
1061
#endif
1062
1063
#ifdef O_NONBLOCK
1064
6216
  NODE_DEFINE_CONSTANT(target, O_NONBLOCK);
1065
#endif
1066
1067
#ifdef S_IRWXU
1068
6216
  NODE_DEFINE_CONSTANT(target, S_IRWXU);
1069
#endif
1070
1071
#ifdef S_IRUSR
1072
6216
  NODE_DEFINE_CONSTANT(target, S_IRUSR);
1073
#endif
1074
1075
#ifdef S_IWUSR
1076
6216
  NODE_DEFINE_CONSTANT(target, S_IWUSR);
1077
#endif
1078
1079
#ifdef S_IXUSR
1080
6216
  NODE_DEFINE_CONSTANT(target, S_IXUSR);
1081
#endif
1082
1083
#ifdef S_IRWXG
1084
6216
  NODE_DEFINE_CONSTANT(target, S_IRWXG);
1085
#endif
1086
1087
#ifdef S_IRGRP
1088
6216
  NODE_DEFINE_CONSTANT(target, S_IRGRP);
1089
#endif
1090
1091
#ifdef S_IWGRP
1092
6216
  NODE_DEFINE_CONSTANT(target, S_IWGRP);
1093
#endif
1094
1095
#ifdef S_IXGRP
1096
6216
  NODE_DEFINE_CONSTANT(target, S_IXGRP);
1097
#endif
1098
1099
#ifdef S_IRWXO
1100
6216
  NODE_DEFINE_CONSTANT(target, S_IRWXO);
1101
#endif
1102
1103
#ifdef S_IROTH
1104
6216
  NODE_DEFINE_CONSTANT(target, S_IROTH);
1105
#endif
1106
1107
#ifdef S_IWOTH
1108
6216
  NODE_DEFINE_CONSTANT(target, S_IWOTH);
1109
#endif
1110
1111
#ifdef S_IXOTH
1112
6216
  NODE_DEFINE_CONSTANT(target, S_IXOTH);
1113
#endif
1114
1115
#ifdef F_OK
1116
6216
  NODE_DEFINE_CONSTANT(target, F_OK);
1117
#endif
1118
1119
#ifdef R_OK
1120
6216
  NODE_DEFINE_CONSTANT(target, R_OK);
1121
#endif
1122
1123
#ifdef W_OK
1124
6216
  NODE_DEFINE_CONSTANT(target, W_OK);
1125
#endif
1126
1127
#ifdef X_OK
1128
6216
  NODE_DEFINE_CONSTANT(target, X_OK);
1129
#endif
1130
1554
}
1131
1132
1554
void DefineUVConstants(Local<Object> target) {
1133
6216
  NODE_DEFINE_CONSTANT(target, UV_UDP_REUSEADDR);
1134
1554
}
1135
1136
1554
void DefineCryptoConstants(Local<Object> target) {
1137
#if HAVE_OPENSSL
1138
6216
  NODE_DEFINE_STRING_CONSTANT(target,
1139
                              "defaultCoreCipherList",
1140
                              DEFAULT_CIPHER_LIST_CORE);
1141
6216
  NODE_DEFINE_STRING_CONSTANT(target,
1142
                              "defaultCipherList",
1143
                              default_cipher_list);
1144
#endif
1145
1554
}
1146
1147
1554
void DefineZlibConstants(Local<Object> target) {
1148
6216
  NODE_DEFINE_CONSTANT(target, Z_NO_FLUSH);
1149
6216
  NODE_DEFINE_CONSTANT(target, Z_PARTIAL_FLUSH);
1150
6216
  NODE_DEFINE_CONSTANT(target, Z_SYNC_FLUSH);
1151
6216
  NODE_DEFINE_CONSTANT(target, Z_FULL_FLUSH);
1152
6216
  NODE_DEFINE_CONSTANT(target, Z_FINISH);
1153
6216
  NODE_DEFINE_CONSTANT(target, Z_BLOCK);
1154
1155
  // return/error codes
1156
6216
  NODE_DEFINE_CONSTANT(target, Z_OK);
1157
6216
  NODE_DEFINE_CONSTANT(target, Z_STREAM_END);
1158
6216
  NODE_DEFINE_CONSTANT(target, Z_NEED_DICT);
1159
6216
  NODE_DEFINE_CONSTANT(target, Z_ERRNO);
1160
6216
  NODE_DEFINE_CONSTANT(target, Z_STREAM_ERROR);
1161
6216
  NODE_DEFINE_CONSTANT(target, Z_DATA_ERROR);
1162
6216
  NODE_DEFINE_CONSTANT(target, Z_MEM_ERROR);
1163
6216
  NODE_DEFINE_CONSTANT(target, Z_BUF_ERROR);
1164
6216
  NODE_DEFINE_CONSTANT(target, Z_VERSION_ERROR);
1165
1166
6216
  NODE_DEFINE_CONSTANT(target, Z_NO_COMPRESSION);
1167
6216
  NODE_DEFINE_CONSTANT(target, Z_BEST_SPEED);
1168
6216
  NODE_DEFINE_CONSTANT(target, Z_BEST_COMPRESSION);
1169
6216
  NODE_DEFINE_CONSTANT(target, Z_DEFAULT_COMPRESSION);
1170
6216
  NODE_DEFINE_CONSTANT(target, Z_FILTERED);
1171
6216
  NODE_DEFINE_CONSTANT(target, Z_HUFFMAN_ONLY);
1172
6216
  NODE_DEFINE_CONSTANT(target, Z_RLE);
1173
6216
  NODE_DEFINE_CONSTANT(target, Z_FIXED);
1174
6216
  NODE_DEFINE_CONSTANT(target, Z_DEFAULT_STRATEGY);
1175
6216
  NODE_DEFINE_CONSTANT(target, ZLIB_VERNUM);
1176
1177
  enum node_zlib_mode {
1178
    NONE,
1179
    DEFLATE,
1180
    INFLATE,
1181
    GZIP,
1182
    GUNZIP,
1183
    DEFLATERAW,
1184
    INFLATERAW,
1185
    UNZIP
1186
  };
1187
1188
6216
  NODE_DEFINE_CONSTANT(target, DEFLATE);
1189
6216
  NODE_DEFINE_CONSTANT(target, INFLATE);
1190
6216
  NODE_DEFINE_CONSTANT(target, GZIP);
1191
6216
  NODE_DEFINE_CONSTANT(target, GUNZIP);
1192
6216
  NODE_DEFINE_CONSTANT(target, DEFLATERAW);
1193
6216
  NODE_DEFINE_CONSTANT(target, INFLATERAW);
1194
6216
  NODE_DEFINE_CONSTANT(target, UNZIP);
1195
1196
#define Z_MIN_WINDOWBITS 8
1197
#define Z_MAX_WINDOWBITS 15
1198
#define Z_DEFAULT_WINDOWBITS 15
1199
// Fewer than 64 bytes per chunk is not recommended.
1200
// Technically it could work with as few as 8, but even 64 bytes
1201
// is low.  Usually a MB or more is best.
1202
#define Z_MIN_CHUNK 64
1203
#define Z_MAX_CHUNK std::numeric_limits<double>::infinity()
1204
#define Z_DEFAULT_CHUNK (16 * 1024)
1205
#define Z_MIN_MEMLEVEL 1
1206
#define Z_MAX_MEMLEVEL 9
1207
#define Z_DEFAULT_MEMLEVEL 8
1208
#define Z_MIN_LEVEL -1
1209
#define Z_MAX_LEVEL 9
1210
#define Z_DEFAULT_LEVEL Z_DEFAULT_COMPRESSION
1211
1212
6216
  NODE_DEFINE_CONSTANT(target, Z_MIN_WINDOWBITS);
1213
6216
  NODE_DEFINE_CONSTANT(target, Z_MAX_WINDOWBITS);
1214
6216
  NODE_DEFINE_CONSTANT(target, Z_DEFAULT_WINDOWBITS);
1215
6216
  NODE_DEFINE_CONSTANT(target, Z_MIN_CHUNK);
1216
6216
  NODE_DEFINE_CONSTANT(target, Z_MAX_CHUNK);
1217
6216
  NODE_DEFINE_CONSTANT(target, Z_DEFAULT_CHUNK);
1218
6216
  NODE_DEFINE_CONSTANT(target, Z_MIN_MEMLEVEL);
1219
6216
  NODE_DEFINE_CONSTANT(target, Z_MAX_MEMLEVEL);
1220
6216
  NODE_DEFINE_CONSTANT(target, Z_DEFAULT_MEMLEVEL);
1221
6216
  NODE_DEFINE_CONSTANT(target, Z_MIN_LEVEL);
1222
6216
  NODE_DEFINE_CONSTANT(target, Z_MAX_LEVEL);
1223
6216
  NODE_DEFINE_CONSTANT(target, Z_DEFAULT_LEVEL);
1224
1554
}
1225
1226
1554
void DefineConstants(v8::Isolate* isolate, Local<Object> target) {
1227
1554
  Local<Object> os_constants = Object::New(isolate);
1228
1554
  Local<Object> err_constants = Object::New(isolate);
1229
1554
  Local<Object> sig_constants = Object::New(isolate);
1230
1554
  Local<Object> fs_constants = Object::New(isolate);
1231
1554
  Local<Object> crypto_constants = Object::New(isolate);
1232
1554
  Local<Object> zlib_constants = Object::New(isolate);
1233
1234
1554
  DefineErrnoConstants(err_constants);
1235
  DefineWindowsErrorConstants(err_constants);
1236
1554
  DefineSignalConstants(sig_constants);
1237
1554
  DefineUVConstants(os_constants);
1238
1554
  DefineSystemConstants(fs_constants);
1239
1554
  DefineOpenSSLConstants(crypto_constants);
1240
1554
  DefineCryptoConstants(crypto_constants);
1241
1554
  DefineZlibConstants(zlib_constants);
1242
1243
3108
  os_constants->Set(OneByteString(isolate, "errno"), err_constants);
1244
3108
  os_constants->Set(OneByteString(isolate, "signals"), sig_constants);
1245
3108
  target->Set(OneByteString(isolate, "os"), os_constants);
1246
3108
  target->Set(OneByteString(isolate, "fs"), fs_constants);
1247
3108
  target->Set(OneByteString(isolate, "crypto"), crypto_constants);
1248
3108
  target->Set(OneByteString(isolate, "zlib"), zlib_constants);
1249
1554
}
1250
1251
}  // namespace node