-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjx9_const.c
1423 lines (1423 loc) · 35.3 KB
/
jx9_const.c
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
/*
* Symisc JX9: A Highly Efficient Embeddable Scripting Engine Based on JSON.
* Copyright (C) 2012-2013, Symisc Systems http://jx9.symisc.net/
* Version 1.7.2
* For information on licensing, redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES
* please contact Symisc Systems via:
* or visit:
* http://jx9.symisc.net/
*/
/* $SymiscID: const.c v1.7 Win7 2012-12-13 00:01 stable <[email protected]> $ */
#ifndef JX9_AMALGAMATION
#include "jx9Int.h"
#endif
/* This file implement built-in constants for the JX9 engine. */
/*
* JX9_VERSION
* __JX9__
* Expand the current version of the JX9 engine.
*/
static void JX9_VER_Const(jx9_value *pVal, void *pUnused)
{
SXUNUSED(pUnused);
jx9_value_string(pVal, jx9_lib_signature(), -1/*Compute length automatically*/);
}
#ifdef __WINNT__
#include <Windows.h>
#elif defined(__UNIXES__)
#include <sys/utsname.h>
#endif
/*
* JX9_OS
* __OS__
* Expand the name of the host Operating System.
*/
static void JX9_OS_Const(jx9_value *pVal, void *pUnused)
{
#if defined(__WINNT__)
jx9_value_string(pVal, "WinNT", (int)sizeof("WinNT")-1);
#elif defined(__UNIXES__)
struct utsname sInfo;
if( uname(&sInfo) != 0 ){
jx9_value_string(pVal, "Unix", (int)sizeof("Unix")-1);
}else{
jx9_value_string(pVal, sInfo.sysname, -1);
}
#else
jx9_value_string(pVal,"Host OS", (int)sizeof("Host OS")-1);
#endif
SXUNUSED(pUnused);
}
/*
* JX9_EOL
* Expand the correct 'End Of Line' symbol for this platform.
*/
static void JX9_EOL_Const(jx9_value *pVal, void *pUnused)
{
SXUNUSED(pUnused);
#ifdef __WINNT__
jx9_value_string(pVal, "\r\n", (int)sizeof("\r\n")-1);
#else
jx9_value_string(pVal, "\n", (int)sizeof(char));
#endif
}
/*
* JX9_INT_MAX
* Expand the largest integer supported.
* Note that JX9 deals with 64-bit integer for all platforms.
*/
static void JX9_INTMAX_Const(jx9_value *pVal, void *pUnused)
{
SXUNUSED(pUnused);
jx9_value_int64(pVal, SXI64_HIGH);
}
/*
* JX9_INT_SIZE
* Expand the size in bytes of a 64-bit integer.
*/
static void JX9_INTSIZE_Const(jx9_value *pVal, void *pUnused)
{
SXUNUSED(pUnused);
jx9_value_int64(pVal, sizeof(sxi64));
}
/*
* DIRECTORY_SEPARATOR.
* Expand the directory separator character.
*/
static void JX9_DIRSEP_Const(jx9_value *pVal, void *pUnused)
{
SXUNUSED(pUnused);
#ifdef __WINNT__
jx9_value_string(pVal, "\\", (int)sizeof(char));
#else
jx9_value_string(pVal, "/", (int)sizeof(char));
#endif
}
/*
* PATH_SEPARATOR.
* Expand the path separator character.
*/
static void JX9_PATHSEP_Const(jx9_value *pVal, void *pUnused)
{
SXUNUSED(pUnused);
#ifdef __WINNT__
jx9_value_string(pVal, ";", (int)sizeof(char));
#else
jx9_value_string(pVal, ":", (int)sizeof(char));
#endif
}
#ifndef __WINNT__
#include <time.h>
#endif
/*
* __TIME__
* Expand the current time (GMT).
*/
static void JX9_TIME_Const(jx9_value *pVal, void *pUnused)
{
Sytm sTm;
#ifdef __WINNT__
SYSTEMTIME sOS;
GetSystemTime(&sOS);
SYSTEMTIME_TO_SYTM(&sOS, &sTm);
#else
struct tm *pTm;
time_t t;
time(&t);
pTm = gmtime(&t);
STRUCT_TM_TO_SYTM(pTm, &sTm);
#endif
SXUNUSED(pUnused); /* cc warning */
/* Expand */
jx9_value_string_format(pVal, "%02d:%02d:%02d", sTm.tm_hour, sTm.tm_min, sTm.tm_sec);
}
/*
* __DATE__
* Expand the current date in the ISO-8601 format.
*/
static void JX9_DATE_Const(jx9_value *pVal, void *pUnused)
{
Sytm sTm;
#ifdef __WINNT__
SYSTEMTIME sOS;
GetSystemTime(&sOS);
SYSTEMTIME_TO_SYTM(&sOS, &sTm);
#else
struct tm *pTm;
time_t t;
time(&t);
pTm = gmtime(&t);
STRUCT_TM_TO_SYTM(pTm, &sTm);
#endif
SXUNUSED(pUnused); /* cc warning */
/* Expand */
jx9_value_string_format(pVal, "%04d-%02d-%02d", sTm.tm_year, sTm.tm_mon+1, sTm.tm_mday);
}
/*
* __FILE__
* Path of the processed script.
*/
static void JX9_FILE_Const(jx9_value *pVal, void *pUserData)
{
jx9_vm *pVm = (jx9_vm *)pUserData;
SyString *pFile;
/* Peek the top entry */
pFile = (SyString *)SySetPeek(&pVm->aFiles);
if( pFile == 0 ){
/* Expand the magic word: ":MEMORY:" */
jx9_value_string(pVal, ":MEMORY:", (int)sizeof(":MEMORY:")-1);
}else{
jx9_value_string(pVal, pFile->zString, pFile->nByte);
}
}
/*
* __DIR__
* Directory holding the processed script.
*/
static void JX9_DIR_Const(jx9_value *pVal, void *pUserData)
{
jx9_vm *pVm = (jx9_vm *)pUserData;
SyString *pFile;
/* Peek the top entry */
pFile = (SyString *)SySetPeek(&pVm->aFiles);
if( pFile == 0 ){
/* Expand the magic word: ":MEMORY:" */
jx9_value_string(pVal, ":MEMORY:", (int)sizeof(":MEMORY:")-1);
}else{
if( pFile->nByte > 0 ){
const char *zDir;
int nLen;
zDir = jx9ExtractDirName(pFile->zString, (int)pFile->nByte, &nLen);
jx9_value_string(pVal, zDir, nLen);
}else{
/* Expand '.' as the current directory*/
jx9_value_string(pVal, ".", (int)sizeof(char));
}
}
}
/*
* E_ERROR
* Expands 1
*/
static void JX9_E_ERROR_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 1);
SXUNUSED(pUserData);
}
/*
* E_WARNING
* Expands 2
*/
static void JX9_E_WARNING_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 2);
SXUNUSED(pUserData);
}
/*
* E_PARSE
* Expands 4
*/
static void JX9_E_PARSE_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 4);
SXUNUSED(pUserData);
}
/*
* E_NOTICE
* Expands 8
*/
static void JX9_E_NOTICE_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 8);
SXUNUSED(pUserData);
}
/*
* CASE_LOWER
* Expands 0.
*/
static void JX9_CASE_LOWER_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 0);
SXUNUSED(pUserData);
}
/*
* CASE_UPPER
* Expands 1.
*/
static void JX9_CASE_UPPER_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 1);
SXUNUSED(pUserData);
}
/*
* STR_PAD_LEFT
* Expands 0.
*/
static void JX9_STR_PAD_LEFT_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 0);
SXUNUSED(pUserData);
}
/*
* STR_PAD_RIGHT
* Expands 1.
*/
static void JX9_STR_PAD_RIGHT_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 1);
SXUNUSED(pUserData);
}
/*
* STR_PAD_BOTH
* Expands 2.
*/
static void JX9_STR_PAD_BOTH_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 2);
SXUNUSED(pUserData);
}
/*
* COUNT_NORMAL
* Expands 0
*/
static void JX9_COUNT_NORMAL_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 0);
SXUNUSED(pUserData);
}
/*
* COUNT_RECURSIVE
* Expands 1.
*/
static void JX9_COUNT_RECURSIVE_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 1);
SXUNUSED(pUserData);
}
/*
* SORT_ASC
* Expands 1.
*/
static void JX9_SORT_ASC_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 1);
SXUNUSED(pUserData);
}
/*
* SORT_DESC
* Expands 2.
*/
static void JX9_SORT_DESC_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 2);
SXUNUSED(pUserData);
}
/*
* SORT_REGULAR
* Expands 3.
*/
static void JX9_SORT_REG_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 3);
SXUNUSED(pUserData);
}
/*
* SORT_NUMERIC
* Expands 4.
*/
static void JX9_SORT_NUMERIC_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 4);
SXUNUSED(pUserData);
}
/*
* SORT_STRING
* Expands 5.
*/
static void JX9_SORT_STRING_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 5);
SXUNUSED(pUserData);
}
/*
* JX9_ROUND_HALF_UP
* Expands 1.
*/
static void JX9_JX9_ROUND_HALF_UP_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 1);
SXUNUSED(pUserData);
}
/*
* SJX9_ROUND_HALF_DOWN
* Expands 2.
*/
static void JX9_JX9_ROUND_HALF_DOWN_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 2);
SXUNUSED(pUserData);
}
/*
* JX9_ROUND_HALF_EVEN
* Expands 3.
*/
static void JX9_JX9_ROUND_HALF_EVEN_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 3);
SXUNUSED(pUserData);
}
/*
* JX9_ROUND_HALF_ODD
* Expands 4.
*/
static void JX9_JX9_ROUND_HALF_ODD_Const(jx9_value *pVal, void *pUserData)
{
jx9_value_int(pVal, 4);
SXUNUSED(pUserData);
}
#ifdef JX9_ENABLE_MATH_FUNC
/*
* PI
* Expand the value of pi.
*/
static void JX9_M_PI_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, JX9_PI);
}
/*
* M_E
* Expand 2.7182818284590452354
*/
static void JX9_M_E_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 2.7182818284590452354);
}
/*
* M_LOG2E
* Expand 2.7182818284590452354
*/
static void JX9_M_LOG2E_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.4426950408889634074);
}
/*
* M_LOG10E
* Expand 0.4342944819032518276
*/
static void JX9_M_LOG10E_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.4342944819032518276);
}
/*
* M_LN2
* Expand 0.69314718055994530942
*/
static void JX9_M_LN2_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.69314718055994530942);
}
/*
* M_LN10
* Expand 2.30258509299404568402
*/
static void JX9_M_LN10_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 2.30258509299404568402);
}
/*
* M_PI_2
* Expand 1.57079632679489661923
*/
static void JX9_M_PI_2_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.57079632679489661923);
}
/*
* M_PI_4
* Expand 0.78539816339744830962
*/
static void JX9_M_PI_4_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.78539816339744830962);
}
/*
* M_1_PI
* Expand 0.31830988618379067154
*/
static void JX9_M_1_PI_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.31830988618379067154);
}
/*
* M_2_PI
* Expand 0.63661977236758134308
*/
static void JX9_M_2_PI_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.63661977236758134308);
}
/*
* M_SQRTPI
* Expand 1.77245385090551602729
*/
static void JX9_M_SQRTPI_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.77245385090551602729);
}
/*
* M_2_SQRTPI
* Expand 1.12837916709551257390
*/
static void JX9_M_2_SQRTPI_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.12837916709551257390);
}
/*
* M_SQRT2
* Expand 1.41421356237309504880
*/
static void JX9_M_SQRT2_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.41421356237309504880);
}
/*
* M_SQRT3
* Expand 1.73205080756887729352
*/
static void JX9_M_SQRT3_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.73205080756887729352);
}
/*
* M_SQRT1_2
* Expand 0.70710678118654752440
*/
static void JX9_M_SQRT1_2_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.70710678118654752440);
}
/*
* M_LNPI
* Expand 1.14472988584940017414
*/
static void JX9_M_LNPI_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 1.14472988584940017414);
}
/*
* M_EULER
* Expand 0.57721566490153286061
*/
static void JX9_M_EULER_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_double(pVal, 0.57721566490153286061);
}
#endif /* JX9_DISABLE_BUILTIN_MATH */
/*
* DATE_ATOM
* Expand Atom (example: 2005-08-15T15:52:01+00:00)
*/
static void JX9_DATE_ATOM_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "Y-m-d\\TH:i:sP", -1/*Compute length automatically*/);
}
/*
* DATE_COOKIE
* HTTP Cookies (example: Monday, 15-Aug-05 15:52:01 UTC)
*/
static void JX9_DATE_COOKIE_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "l, d-M-y H:i:s T", -1/*Compute length automatically*/);
}
/*
* DATE_ISO8601
* ISO-8601 (example: 2005-08-15T15:52:01+0000)
*/
static void JX9_DATE_ISO8601_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "Y-m-d\\TH:i:sO", -1/*Compute length automatically*/);
}
/*
* DATE_RFC822
* RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000)
*/
static void JX9_DATE_RFC822_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "D, d M y H:i:s O", -1/*Compute length automatically*/);
}
/*
* DATE_RFC850
* RFC 850 (example: Monday, 15-Aug-05 15:52:01 UTC)
*/
static void JX9_DATE_RFC850_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "l, d-M-y H:i:s T", -1/*Compute length automatically*/);
}
/*
* DATE_RFC1036
* RFC 1123 (example: Mon, 15 Aug 2005 15:52:01 +0000)
*/
static void JX9_DATE_RFC1036_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "D, d M y H:i:s O", -1/*Compute length automatically*/);
}
/*
* DATE_RFC1123
* RFC 1123 (example: Mon, 15 Aug 2005 15:52:01 +0000)
*/
static void JX9_DATE_RFC1123_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "D, d M Y H:i:s O", -1/*Compute length automatically*/);
}
/*
* DATE_RFC2822
* RFC 2822 (Mon, 15 Aug 2005 15:52:01 +0000)
*/
static void JX9_DATE_RFC2822_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "D, d M Y H:i:s O", -1/*Compute length automatically*/);
}
/*
* DATE_RSS
* RSS (Mon, 15 Aug 2005 15:52:01 +0000)
*/
static void JX9_DATE_RSS_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "D, d M Y H:i:s O", -1/*Compute length automatically*/);
}
/*
* DATE_W3C
* World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)
*/
static void JX9_DATE_W3C_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_string(pVal, "Y-m-d\\TH:i:sP", -1/*Compute length automatically*/);
}
/*
* ENT_COMPAT
* Expand 0x01 (Must be a power of two)
*/
static void JX9_ENT_COMPAT_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x01);
}
/*
* ENT_QUOTES
* Expand 0x02 (Must be a power of two)
*/
static void JX9_ENT_QUOTES_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x02);
}
/*
* ENT_NOQUOTES
* Expand 0x04 (Must be a power of two)
*/
static void JX9_ENT_NOQUOTES_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x04);
}
/*
* ENT_IGNORE
* Expand 0x08 (Must be a power of two)
*/
static void JX9_ENT_IGNORE_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x08);
}
/*
* ENT_SUBSTITUTE
* Expand 0x10 (Must be a power of two)
*/
static void JX9_ENT_SUBSTITUTE_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x10);
}
/*
* ENT_DISALLOWED
* Expand 0x20 (Must be a power of two)
*/
static void JX9_ENT_DISALLOWED_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x20);
}
/*
* ENT_HTML401
* Expand 0x40 (Must be a power of two)
*/
static void JX9_ENT_HTML401_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x40);
}
/*
* ENT_XML1
* Expand 0x80 (Must be a power of two)
*/
static void JX9_ENT_XML1_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x80);
}
/*
* ENT_XHTML
* Expand 0x100 (Must be a power of two)
*/
static void JX9_ENT_XHTML_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x100);
}
/*
* ENT_HTML5
* Expand 0x200 (Must be a power of two)
*/
static void JX9_ENT_HTML5_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x200);
}
/*
* ISO-8859-1
* ISO_8859_1
* Expand 1
*/
static void JX9_ISO88591_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* UTF-8
* UTF8
* Expand 2
*/
static void JX9_UTF8_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* HTML_ENTITIES
* Expand 1
*/
static void JX9_HTML_ENTITIES_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* HTML_SPECIALCHARS
* Expand 2
*/
static void JX9_HTML_SPECIALCHARS_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 2);
}
/*
* JX9_URL_SCHEME.
* Expand 1
*/
static void JX9_JX9_URL_SCHEME_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* JX9_URL_HOST.
* Expand 2
*/
static void JX9_JX9_URL_HOST_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 2);
}
/*
* JX9_URL_PORT.
* Expand 3
*/
static void JX9_JX9_URL_PORT_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 3);
}
/*
* JX9_URL_USER.
* Expand 4
*/
static void JX9_JX9_URL_USER_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 4);
}
/*
* JX9_URL_PASS.
* Expand 5
*/
static void JX9_JX9_URL_PASS_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 5);
}
/*
* JX9_URL_PATH.
* Expand 6
*/
static void JX9_JX9_URL_PATH_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 6);
}
/*
* JX9_URL_QUERY.
* Expand 7
*/
static void JX9_JX9_URL_QUERY_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 7);
}
/*
* JX9_URL_FRAGMENT.
* Expand 8
*/
static void JX9_JX9_URL_FRAGMENT_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 8);
}
/*
* JX9_QUERY_RFC1738
* Expand 1
*/
static void JX9_JX9_QUERY_RFC1738_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* JX9_QUERY_RFC3986
* Expand 1
*/
static void JX9_JX9_QUERY_RFC3986_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 2);
}
/*
* FNM_NOESCAPE
* Expand 0x01 (Must be a power of two)
*/
static void JX9_FNM_NOESCAPE_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x01);
}
/*
* FNM_PATHNAME
* Expand 0x02 (Must be a power of two)
*/
static void JX9_FNM_PATHNAME_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x02);
}
/*
* FNM_PERIOD
* Expand 0x04 (Must be a power of two)
*/
static void JX9_FNM_PERIOD_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x04);
}
/*
* FNM_CASEFOLD
* Expand 0x08 (Must be a power of two)
*/
static void JX9_FNM_CASEFOLD_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0x08);
}
/*
* PATHINFO_DIRNAME
* Expand 1.
*/
static void JX9_PATHINFO_DIRNAME_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* PATHINFO_BASENAME
* Expand 2.
*/
static void JX9_PATHINFO_BASENAME_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 2);
}
/*
* PATHINFO_EXTENSION
* Expand 3.
*/
static void JX9_PATHINFO_EXTENSION_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 3);
}
/*
* PATHINFO_FILENAME
* Expand 4.
*/
static void JX9_PATHINFO_FILENAME_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 4);
}
/*
* ASSERT_ACTIVE.
* Expand the value of JX9_ASSERT_ACTIVE defined in jx9Int.h
*/
static void JX9_ASSERT_ACTIVE_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, JX9_ASSERT_DISABLE);
}
/*
* ASSERT_WARNING.
* Expand the value of JX9_ASSERT_WARNING defined in jx9Int.h
*/
static void JX9_ASSERT_WARNING_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, JX9_ASSERT_WARNING);
}
/*
* ASSERT_BAIL.
* Expand the value of JX9_ASSERT_BAIL defined in jx9Int.h
*/
static void JX9_ASSERT_BAIL_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, JX9_ASSERT_BAIL);
}
/*
* ASSERT_QUIET_EVAL.
* Expand the value of JX9_ASSERT_QUIET_EVAL defined in jx9Int.h
*/
static void JX9_ASSERT_QUIET_EVAL_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, JX9_ASSERT_QUIET_EVAL);
}
/*
* ASSERT_CALLBACK.
* Expand the value of JX9_ASSERT_CALLBACK defined in jx9Int.h
*/
static void JX9_ASSERT_CALLBACK_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, JX9_ASSERT_CALLBACK);
}
/*
* SEEK_SET.
* Expand 0
*/
static void JX9_SEEK_SET_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 0);
}
/*
* SEEK_CUR.
* Expand 1
*/
static void JX9_SEEK_CUR_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* SEEK_END.
* Expand 2
*/
static void JX9_SEEK_END_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 2);
}
/*
* LOCK_SH.
* Expand 2
*/
static void JX9_LOCK_SH_Const(jx9_value *pVal, void *pUserData)
{
SXUNUSED(pUserData); /* cc warning */
jx9_value_int(pVal, 1);
}
/*
* LOCK_NB.
* Expand 5
*/