-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
bestline.c
4092 lines (3925 loc) · 156 KB
/
bestline.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
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
│ vi: set et ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi │
╞══════════════════════════════════════════════════════════════════════════════╡
│ │
│ Bestline ── Library for interactive pseudoteletypewriter command │
│ sessions using ANSI Standard X3.64 control sequences │
│ │
│ OVERVIEW │
│ │
│ Bestline is a fork of linenoise (a popular readline alternative) │
│ that fixes its bugs and adds the missing features while reducing │
│ binary footprint (surprisingly) by removing bloated dependencies │
│ which means you can finally have a permissively-licensed command │
│ prompt w/ a 30kb footprint that's nearly as good as gnu readline │
│ │
│ EXAMPLE │
│ │
│ main() { │
│ char *line; │
│ while ((line = bestlineWithHistory("IN> ", "foo"))) { │
│ fputs("OUT> ", stdout); │
│ fputs(line, stdout); │
│ fputs("\n", stdout); │
│ free(line); │
│ } │
│ } │
│ │
│ CHANGES │
│ │
│ - Remove bell │
│ - Add kill ring │
│ - Fix flickering │
│ - Add UTF-8 editing │
│ - Add CTRL-R search │
│ - Support unlimited lines │
│ - Add parentheses awareness │
│ - React to terminal resizing │
│ - Don't generate .data section │
│ - Support terminal flow control │
│ - Make history loading 10x faster │
│ - Make multiline mode the only mode │
│ - Accommodate O_NONBLOCK file descriptors │
│ - Restore raw mode on process foregrounding │
│ - Make source code compatible with C++ compilers │
│ - Fix corruption issues by using generalized parsing │
│ - Implement nearly all GNU readline editing shortcuts │
│ - Remove heavyweight dependencies like printf/sprintf │
│ - Remove ISIG→^C→EAGAIN hack and use ephemeral handlers │
│ - Support running on Windows in MinTTY or CMD.EXE on Win10+ │
│ - Support diacratics, русский, Ελληνικά, 漢字, 仮名, 한글 │
│ │
│ SHORTCUTS │
│ │
│ CTRL-E END │
│ CTRL-A START │
│ CTRL-B BACK │
│ CTRL-F FORWARD │
│ CTRL-L CLEAR │
│ CTRL-H BACKSPACE │
│ CTRL-D DELETE │
│ CTRL-Y YANK │
│ CTRL-D EOF (IF EMPTY) │
│ CTRL-N NEXT HISTORY │
│ CTRL-P PREVIOUS HISTORY │
│ CTRL-R SEARCH HISTORY │
│ CTRL-G CANCEL SEARCH │
│ CTRL-J INSERT NEWLINE │
│ ALT-< BEGINNING OF HISTORY │
│ ALT-> END OF HISTORY │
│ ALT-F FORWARD WORD │
│ ALT-B BACKWARD WORD │
│ CTRL-ALT-F FORWARD EXPR │
│ CTRL-ALT-B BACKWARD EXPR │
│ ALT-RIGHT FORWARD EXPR │
│ ALT-LEFT BACKWARD EXPR │
│ ALT-SHIFT-B BARF EXPR │
│ ALT-SHIFT-S SLURP EXPR │
│ ALT-SHIFT-R RAISE EXPR │
│ CTRL-K KILL LINE FORWARDS │
│ CTRL-U KILL LINE BACKWARDS │
│ ALT-H KILL WORD BACKWARDS │
│ CTRL-W KILL WORD BACKWARDS │
│ CTRL-ALT-H KILL WORD BACKWARDS │
│ ALT-D KILL WORD FORWARDS │
│ ALT-Y ROTATE KILL RING AND YANK AGAIN │
│ ALT-\ SQUEEZE ADJACENT WHITESPACE │
│ CTRL-T TRANSPOSE │
│ ALT-T TRANSPOSE WORD │
│ ALT-U UPPERCASE WORD │
│ ALT-L LOWERCASE WORD │
│ ALT-C CAPITALIZE WORD │
│ CTRL-C CTRL-C INTERRUPT PROCESS │
│ CTRL-Z SUSPEND PROCESS │
│ CTRL-\ QUIT PROCESS │
│ CTRL-S PAUSE OUTPUT │
│ CTRL-Q UNPAUSE OUTPUT (IF PAUSED) │
│ CTRL-Q ESCAPED INSERT │
│ CTRL-SPACE SET MARK │
│ CTRL-X CTRL-X GOTO MARK │
│ PROTIP REMAP CAPS LOCK TO CTRL │
│ │
╞══════════════════════════════════════════════════════════════════════════════╡
│ │
│ Copyright 2018-2021 Justine Tunney <[email protected]> │
│ Copyright 2010-2016 Salvatore Sanfilippo <[email protected]> │
│ Copyright 2010-2013 Pieter Noordhuis <[email protected]> │
│ │
│ All rights reserved. │
│ │
│ Redistribution and use in source and binary forms, with or without │
│ modification, are permitted provided that the following conditions are │
│ met: │
│ │
│ * Redistributions of source code must retain the above copyright │
│ notice, this list of conditions and the following disclaimer. │
│ │
│ * Redistributions in binary form must reproduce the above copyright │
│ notice, this list of conditions and the following disclaimer in the │
│ documentation and/or other materials provided with the distribution. │
│ │
│ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS │
│ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT │
│ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR │
│ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT │
│ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, │
│ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT │
│ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, │
│ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY │
│ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT │
│ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE │
│ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. │
│ │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "bestline.h"
#define _POSIX_C_SOURCE 1 /* so GCC builds in ANSI mode */
#define _XOPEN_SOURCE 700 /* so GCC builds in ANSI mode */
#define _DARWIN_C_SOURCE 1 /* so SIGWINCH / IUTF8 on XNU */
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <poll.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
#ifndef SIGWINCH
#define SIGWINCH 28 /* GNU/Systemd + XNU + FreeBSD + NetBSD + OpenBSD */
#endif
#ifndef IUTF8
#define IUTF8 0
#endif
__asm__(".ident\t\"\\n\\n\
Bestline (BSD-2)\\n\
Copyright 2018-2020 Justine Tunney <[email protected]>\\n\
Copyright 2010-2016 Salvatore Sanfilippo <[email protected]>\\n\
Copyright 2010-2013 Pieter Noordhuis <[email protected]>\"");
#ifndef BESTLINE_MAX_RING
#define BESTLINE_MAX_RING 8
#endif
#ifndef BESTLINE_MAX_HISTORY
#define BESTLINE_MAX_HISTORY 1024
#endif
#define BESTLINE_HISTORY_PREV +1
#define BESTLINE_HISTORY_NEXT -1
#define Ctrl(C) ((C) ^ 0100)
#define Min(X, Y) ((Y) > (X) ? (X) : (Y))
#define Max(X, Y) ((Y) < (X) ? (X) : (Y))
#define Case(X, Y) \
case X: \
Y; \
break
#define Read16le(X) ((255 & (X)[0]) << 000 | (255 & (X)[1]) << 010)
#define Read32le(X) \
((unsigned)(255 & (X)[0]) << 000 | (unsigned)(255 & (X)[1]) << 010 | \
(unsigned)(255 & (X)[2]) << 020 | (unsigned)(255 & (X)[3]) << 030)
struct abuf {
char *b;
unsigned len;
unsigned cap;
};
struct rune {
unsigned c;
unsigned n;
};
struct bestlineRing {
unsigned i;
char *p[BESTLINE_MAX_RING];
};
/* The bestlineState structure represents the state during line editing.
* We pass this state to functions implementing specific editing
* functionalities. */
struct bestlineState {
int ifd; /* terminal stdin file descriptor */
int ofd; /* terminal stdout file descriptor */
struct winsize ws; /* rows and columns in terminal */
char *buf; /* edited line buffer */
const char *prompt; /* prompt to display */
int hindex; /* history index */
int rows; /* rows being used */
int oldpos; /* previous refresh cursor position */
unsigned buflen; /* edited line buffer size */
unsigned pos; /* current buffer index */
unsigned len; /* current edited line length */
unsigned mark; /* saved cursor position */
unsigned yi, yj; /* boundaries of last yank */
char seq[2][16]; /* keystroke history for yanking code */
char final; /* set to true on last update */
char dirty; /* if an update was squashed */
struct abuf full; /* used for multiline mode */
};
static const char *const kUnsupported[] = {"dumb", "cons25", "emacs"};
static int gotint;
static int gotcont;
static int gotwinch;
static signed char rawmode;
static char maskmode;
static char emacsmode;
static char llamamode;
static char balancemode;
static char ispaused;
static char iscapital;
static unsigned historylen;
static struct bestlineRing ring;
static struct sigaction orig_cont;
static struct sigaction orig_winch;
static struct termios orig_termios;
static char *history[BESTLINE_MAX_HISTORY];
static bestlineXlatCallback *xlatCallback;
static bestlineHintsCallback *hintsCallback;
static bestlineFreeHintsCallback *freeHintsCallback;
static bestlineCompletionCallback *completionCallback;
static void bestlineAtExit(void);
static void bestlineRefreshLine(struct bestlineState *);
static void bestlineOnInt(int sig) {
gotint = sig;
}
static void bestlineOnCont(int sig) {
gotcont = sig;
}
static void bestlineOnWinch(int sig) {
gotwinch = sig;
}
static char IsControl(unsigned c) {
return c <= 0x1F || (0x7F <= c && c <= 0x9F);
}
/**
* Returns monospace character width.
*
* This will be zero for control characters, combining marks, etc.
* Chinese, Korean, Japanese, Emoji, etc. will have a width of 2, and
* all other characters will be 1.
*
* This implementation is consistent with wcwidth() on Linux, except
* that this won't return -1 for various character ranges.
*/
int bestlineCharacterWidth(int c) {
if ((0x000 <= c && c <= 0x01F) || (0x07F <= c && c <= 0x09F) ||
(0x300 <= c && c <= 0x36f) || (0x483 <= c && c <= 0x489) ||
(0x591 <= c && c <= 0x5bd) || (0x5bf <= c && c <= 0x5bf) ||
(0x5c1 <= c && c <= 0x5c2) || (0x5c4 <= c && c <= 0x5c5) ||
(0x5c7 <= c && c <= 0x5c7) || (0x610 <= c && c <= 0x61a) ||
(0x61c <= c && c <= 0x61c) || (0x64b <= c && c <= 0x65f) ||
(0x670 <= c && c <= 0x670) || (0x6d6 <= c && c <= 0x6dc) ||
(0x6df <= c && c <= 0x6e4) || (0x6e7 <= c && c <= 0x6e8) ||
(0x6ea <= c && c <= 0x6ed) || (0x711 <= c && c <= 0x711) ||
(0x730 <= c && c <= 0x74a) || (0x7a6 <= c && c <= 0x7b0) ||
(0x7eb <= c && c <= 0x7f3) || (0x7fd <= c && c <= 0x7fd) ||
(0x816 <= c && c <= 0x819) || (0x81b <= c && c <= 0x823) ||
(0x825 <= c && c <= 0x827) || (0x829 <= c && c <= 0x82d) ||
(0x859 <= c && c <= 0x85b) || (0x898 <= c && c <= 0x89f) ||
(0x8ca <= c && c <= 0x8e1) || (0x8e3 <= c && c <= 0x902) ||
(0x93a <= c && c <= 0x93a) || (0x93c <= c && c <= 0x93c) ||
(0x941 <= c && c <= 0x948) || (0x94d <= c && c <= 0x94d) ||
(0x951 <= c && c <= 0x957) || (0x962 <= c && c <= 0x963) ||
(0x981 <= c && c <= 0x981) || (0x9bc <= c && c <= 0x9bc) ||
(0x9c1 <= c && c <= 0x9c4) || (0x9cd <= c && c <= 0x9cd) ||
(0x9e2 <= c && c <= 0x9e3) || (0x9fe <= c && c <= 0x9fe) ||
(0xa01 <= c && c <= 0xa02) || (0xa3c <= c && c <= 0xa3c) ||
(0xa41 <= c && c <= 0xa42) || (0xa47 <= c && c <= 0xa48) ||
(0xa4b <= c && c <= 0xa4d) || (0xa51 <= c && c <= 0xa51) ||
(0xa70 <= c && c <= 0xa71) || (0xa75 <= c && c <= 0xa75) ||
(0xa81 <= c && c <= 0xa82) || (0xabc <= c && c <= 0xabc) ||
(0xac1 <= c && c <= 0xac5) || (0xac7 <= c && c <= 0xac8) ||
(0xacd <= c && c <= 0xacd) || (0xae2 <= c && c <= 0xae3) ||
(0xafa <= c && c <= 0xaff) || (0xb01 <= c && c <= 0xb01) ||
(0xb3c <= c && c <= 0xb3c) || (0xb3f <= c && c <= 0xb3f) ||
(0xb41 <= c && c <= 0xb44) || (0xb4d <= c && c <= 0xb4d) ||
(0xb55 <= c && c <= 0xb56) || (0xb62 <= c && c <= 0xb63) ||
(0xb82 <= c && c <= 0xb82) || (0xbc0 <= c && c <= 0xbc0) ||
(0xbcd <= c && c <= 0xbcd) || (0xc00 <= c && c <= 0xc00) ||
(0xc04 <= c && c <= 0xc04) || (0xc3c <= c && c <= 0xc3c) ||
(0xc3e <= c && c <= 0xc40) || (0xc46 <= c && c <= 0xc48) ||
(0xc4a <= c && c <= 0xc4d) || (0xc55 <= c && c <= 0xc56) ||
(0xc62 <= c && c <= 0xc63) || (0xc81 <= c && c <= 0xc81) ||
(0xcbc <= c && c <= 0xcbc) || (0xcbf <= c && c <= 0xcbf) ||
(0xcc6 <= c && c <= 0xcc6) || (0xccc <= c && c <= 0xccd) ||
(0xce2 <= c && c <= 0xce3) || (0xd00 <= c && c <= 0xd01) ||
(0xd3b <= c && c <= 0xd3c) || (0xd41 <= c && c <= 0xd44) ||
(0xd4d <= c && c <= 0xd4d) || (0xd62 <= c && c <= 0xd63) ||
(0xd81 <= c && c <= 0xd81) || (0xdca <= c && c <= 0xdca) ||
(0xdd2 <= c && c <= 0xdd4) || (0xdd6 <= c && c <= 0xdd6) ||
(0xe31 <= c && c <= 0xe31) || (0xe34 <= c && c <= 0xe3a) ||
(0xe47 <= c && c <= 0xe4e) || (0xeb1 <= c && c <= 0xeb1) ||
(0xeb4 <= c && c <= 0xebc) || (0xec8 <= c && c <= 0xece) ||
(0xf18 <= c && c <= 0xf19) || (0xf35 <= c && c <= 0xf35) ||
(0xf37 <= c && c <= 0xf37) || (0xf39 <= c && c <= 0xf39) ||
(0xf71 <= c && c <= 0xf7e) || (0xf80 <= c && c <= 0xf84) ||
(0xf86 <= c && c <= 0xf87) || (0xf8d <= c && c <= 0xf97) ||
(0xf99 <= c && c <= 0xfbc) || (0xfc6 <= c && c <= 0xfc6) ||
(0x102d <= c && c <= 0x1030) || (0x1032 <= c && c <= 0x1037) ||
(0x1039 <= c && c <= 0x103a) || (0x103d <= c && c <= 0x103e) ||
(0x1058 <= c && c <= 0x1059) || (0x105e <= c && c <= 0x1060) ||
(0x1071 <= c && c <= 0x1074) || (0x1082 <= c && c <= 0x1082) ||
(0x1085 <= c && c <= 0x1086) || (0x108d <= c && c <= 0x108d) ||
(0x109d <= c && c <= 0x109d) || (0x1160 <= c && c <= 0x11ff) ||
(0x135d <= c && c <= 0x135f) || (0x1712 <= c && c <= 0x1714) ||
(0x1732 <= c && c <= 0x1733) || (0x1752 <= c && c <= 0x1753) ||
(0x1772 <= c && c <= 0x1773) || (0x17b4 <= c && c <= 0x17b5) ||
(0x17b7 <= c && c <= 0x17bd) || (0x17c6 <= c && c <= 0x17c6) ||
(0x17c9 <= c && c <= 0x17d3) || (0x17dd <= c && c <= 0x17dd) ||
(0x180b <= c && c <= 0x180f) || (0x1885 <= c && c <= 0x1886) ||
(0x18a9 <= c && c <= 0x18a9) || (0x1920 <= c && c <= 0x1922) ||
(0x1927 <= c && c <= 0x1928) || (0x1932 <= c && c <= 0x1932) ||
(0x1939 <= c && c <= 0x193b) || (0x1a17 <= c && c <= 0x1a18) ||
(0x1a1b <= c && c <= 0x1a1b) || (0x1a56 <= c && c <= 0x1a56) ||
(0x1a58 <= c && c <= 0x1a5e) || (0x1a60 <= c && c <= 0x1a60) ||
(0x1a62 <= c && c <= 0x1a62) || (0x1a65 <= c && c <= 0x1a6c) ||
(0x1a73 <= c && c <= 0x1a7c) || (0x1a7f <= c && c <= 0x1a7f) ||
(0x1ab0 <= c && c <= 0x1ace) || (0x1b00 <= c && c <= 0x1b03) ||
(0x1b34 <= c && c <= 0x1b34) || (0x1b36 <= c && c <= 0x1b3a) ||
(0x1b3c <= c && c <= 0x1b3c) || (0x1b42 <= c && c <= 0x1b42) ||
(0x1b6b <= c && c <= 0x1b73) || (0x1b80 <= c && c <= 0x1b81) ||
(0x1ba2 <= c && c <= 0x1ba5) || (0x1ba8 <= c && c <= 0x1ba9) ||
(0x1bab <= c && c <= 0x1bad) || (0x1be6 <= c && c <= 0x1be6) ||
(0x1be8 <= c && c <= 0x1be9) || (0x1bed <= c && c <= 0x1bed) ||
(0x1bef <= c && c <= 0x1bf1) || (0x1c2c <= c && c <= 0x1c33) ||
(0x1c36 <= c && c <= 0x1c37) || (0x1cd0 <= c && c <= 0x1cd2) ||
(0x1cd4 <= c && c <= 0x1ce0) || (0x1ce2 <= c && c <= 0x1ce8) ||
(0x1ced <= c && c <= 0x1ced) || (0x1cf4 <= c && c <= 0x1cf4) ||
(0x1cf8 <= c && c <= 0x1cf9) || (0x1dc0 <= c && c <= 0x1dff) ||
(0x200b <= c && c <= 0x200f) || (0x202a <= c && c <= 0x202e) ||
(0x2060 <= c && c <= 0x2064) || (0x2066 <= c && c <= 0x206f) ||
(0x20d0 <= c && c <= 0x20f0) || (0x2cef <= c && c <= 0x2cf1) ||
(0x2d7f <= c && c <= 0x2d7f) || (0x2de0 <= c && c <= 0x2dff) ||
(0x302a <= c && c <= 0x302d) || (0x3099 <= c && c <= 0x309a) ||
(0xa66f <= c && c <= 0xa672) || (0xa674 <= c && c <= 0xa67d) ||
(0xa69e <= c && c <= 0xa69f) || (0xa6f0 <= c && c <= 0xa6f1) ||
(0xa802 <= c && c <= 0xa802) || (0xa806 <= c && c <= 0xa806) ||
(0xa80b <= c && c <= 0xa80b) || (0xa825 <= c && c <= 0xa826) ||
(0xa82c <= c && c <= 0xa82c) || (0xa8c4 <= c && c <= 0xa8c5) ||
(0xa8e0 <= c && c <= 0xa8f1) || (0xa8ff <= c && c <= 0xa8ff) ||
(0xa926 <= c && c <= 0xa92d) || (0xa947 <= c && c <= 0xa951) ||
(0xa980 <= c && c <= 0xa982) || (0xa9b3 <= c && c <= 0xa9b3) ||
(0xa9b6 <= c && c <= 0xa9b9) || (0xa9bc <= c && c <= 0xa9bd) ||
(0xa9e5 <= c && c <= 0xa9e5) || (0xaa29 <= c && c <= 0xaa2e) ||
(0xaa31 <= c && c <= 0xaa32) || (0xaa35 <= c && c <= 0xaa36) ||
(0xaa43 <= c && c <= 0xaa43) || (0xaa4c <= c && c <= 0xaa4c) ||
(0xaa7c <= c && c <= 0xaa7c) || (0xaab0 <= c && c <= 0xaab0) ||
(0xaab2 <= c && c <= 0xaab4) || (0xaab7 <= c && c <= 0xaab8) ||
(0xaabe <= c && c <= 0xaabf) || (0xaac1 <= c && c <= 0xaac1) ||
(0xaaec <= c && c <= 0xaaed) || (0xaaf6 <= c && c <= 0xaaf6) ||
(0xabe5 <= c && c <= 0xabe5) || (0xabe8 <= c && c <= 0xabe8) ||
(0xabed <= c && c <= 0xabed) || (0xd7b0 <= c && c <= 0xd7c6) ||
(0xd7cb <= c && c <= 0xd7fb) || (0xfb1e <= c && c <= 0xfb1e) ||
(0xfe00 <= c && c <= 0xfe0f) || (0xfe20 <= c && c <= 0xfe2f) ||
(0xfeff <= c && c <= 0xfeff) || (0xfff9 <= c && c <= 0xfffb) ||
(0x101fd <= c && c <= 0x101fd) || (0x102e0 <= c && c <= 0x102e0) ||
(0x10376 <= c && c <= 0x1037a) || (0x10a01 <= c && c <= 0x10a03) ||
(0x10a05 <= c && c <= 0x10a06) || (0x10a0c <= c && c <= 0x10a0f) ||
(0x10a38 <= c && c <= 0x10a3a) || (0x10a3f <= c && c <= 0x10a3f) ||
(0x10ae5 <= c && c <= 0x10ae6) || (0x10d24 <= c && c <= 0x10d27) ||
(0x10eab <= c && c <= 0x10eac) || (0x10efd <= c && c <= 0x10eff) ||
(0x10f46 <= c && c <= 0x10f50) || (0x10f82 <= c && c <= 0x10f85) ||
(0x11001 <= c && c <= 0x11001) || (0x11038 <= c && c <= 0x11046) ||
(0x11070 <= c && c <= 0x11070) || (0x11073 <= c && c <= 0x11074) ||
(0x1107f <= c && c <= 0x11081) || (0x110b3 <= c && c <= 0x110b6) ||
(0x110b9 <= c && c <= 0x110ba) || (0x110c2 <= c && c <= 0x110c2) ||
(0x11100 <= c && c <= 0x11102) || (0x11127 <= c && c <= 0x1112b) ||
(0x1112d <= c && c <= 0x11134) || (0x11173 <= c && c <= 0x11173) ||
(0x11180 <= c && c <= 0x11181) || (0x111b6 <= c && c <= 0x111be) ||
(0x111c9 <= c && c <= 0x111cc) || (0x111cf <= c && c <= 0x111cf) ||
(0x1122f <= c && c <= 0x11231) || (0x11234 <= c && c <= 0x11234) ||
(0x11236 <= c && c <= 0x11237) || (0x1123e <= c && c <= 0x1123e) ||
(0x11241 <= c && c <= 0x11241) || (0x112df <= c && c <= 0x112df) ||
(0x112e3 <= c && c <= 0x112ea) || (0x11300 <= c && c <= 0x11301) ||
(0x1133b <= c && c <= 0x1133c) || (0x11340 <= c && c <= 0x11340) ||
(0x11366 <= c && c <= 0x1136c) || (0x11370 <= c && c <= 0x11374) ||
(0x11438 <= c && c <= 0x1143f) || (0x11442 <= c && c <= 0x11444) ||
(0x11446 <= c && c <= 0x11446) || (0x1145e <= c && c <= 0x1145e) ||
(0x114b3 <= c && c <= 0x114b8) || (0x114ba <= c && c <= 0x114ba) ||
(0x114bf <= c && c <= 0x114c0) || (0x114c2 <= c && c <= 0x114c3) ||
(0x115b2 <= c && c <= 0x115b5) || (0x115bc <= c && c <= 0x115bd) ||
(0x115bf <= c && c <= 0x115c0) || (0x115dc <= c && c <= 0x115dd) ||
(0x11633 <= c && c <= 0x1163a) || (0x1163d <= c && c <= 0x1163d) ||
(0x1163f <= c && c <= 0x11640) || (0x116ab <= c && c <= 0x116ab) ||
(0x116ad <= c && c <= 0x116ad) || (0x116b0 <= c && c <= 0x116b5) ||
(0x116b7 <= c && c <= 0x116b7) || (0x1171d <= c && c <= 0x1171f) ||
(0x11722 <= c && c <= 0x11725) || (0x11727 <= c && c <= 0x1172b) ||
(0x1182f <= c && c <= 0x11837) || (0x11839 <= c && c <= 0x1183a) ||
(0x1193b <= c && c <= 0x1193c) || (0x1193e <= c && c <= 0x1193e) ||
(0x11943 <= c && c <= 0x11943) || (0x119d4 <= c && c <= 0x119d7) ||
(0x119da <= c && c <= 0x119db) || (0x119e0 <= c && c <= 0x119e0) ||
(0x11a01 <= c && c <= 0x11a0a) || (0x11a33 <= c && c <= 0x11a38) ||
(0x11a3b <= c && c <= 0x11a3e) || (0x11a47 <= c && c <= 0x11a47) ||
(0x11a51 <= c && c <= 0x11a56) || (0x11a59 <= c && c <= 0x11a5b) ||
(0x11a8a <= c && c <= 0x11a96) || (0x11a98 <= c && c <= 0x11a99) ||
(0x11c30 <= c && c <= 0x11c36) || (0x11c38 <= c && c <= 0x11c3d) ||
(0x11c3f <= c && c <= 0x11c3f) || (0x11c92 <= c && c <= 0x11ca7) ||
(0x11caa <= c && c <= 0x11cb0) || (0x11cb2 <= c && c <= 0x11cb3) ||
(0x11cb5 <= c && c <= 0x11cb6) || (0x11d31 <= c && c <= 0x11d36) ||
(0x11d3a <= c && c <= 0x11d3a) || (0x11d3c <= c && c <= 0x11d3d) ||
(0x11d3f <= c && c <= 0x11d45) || (0x11d47 <= c && c <= 0x11d47) ||
(0x11d90 <= c && c <= 0x11d91) || (0x11d95 <= c && c <= 0x11d95) ||
(0x11d97 <= c && c <= 0x11d97) || (0x11ef3 <= c && c <= 0x11ef4) ||
(0x11f00 <= c && c <= 0x11f01) || (0x11f36 <= c && c <= 0x11f3a) ||
(0x11f40 <= c && c <= 0x11f40) || (0x11f42 <= c && c <= 0x11f42) ||
(0x13430 <= c && c <= 0x13440) || (0x13447 <= c && c <= 0x13455) ||
(0x16af0 <= c && c <= 0x16af4) || (0x16b30 <= c && c <= 0x16b36) ||
(0x16f4f <= c && c <= 0x16f4f) || (0x16f8f <= c && c <= 0x16f92) ||
(0x16fe4 <= c && c <= 0x16fe4) || (0x1bc9d <= c && c <= 0x1bc9e) ||
(0x1bca0 <= c && c <= 0x1bca3) || (0x1cf00 <= c && c <= 0x1cf2d) ||
(0x1cf30 <= c && c <= 0x1cf46) || (0x1d167 <= c && c <= 0x1d169) ||
(0x1d173 <= c && c <= 0x1d182) || (0x1d185 <= c && c <= 0x1d18b) ||
(0x1d1aa <= c && c <= 0x1d1ad) || (0x1d242 <= c && c <= 0x1d244) ||
(0x1da00 <= c && c <= 0x1da36) || (0x1da3b <= c && c <= 0x1da6c) ||
(0x1da75 <= c && c <= 0x1da75) || (0x1da84 <= c && c <= 0x1da84) ||
(0x1da9b <= c && c <= 0x1da9f) || (0x1daa1 <= c && c <= 0x1daaf) ||
(0x1e000 <= c && c <= 0x1e006) || (0x1e008 <= c && c <= 0x1e018) ||
(0x1e01b <= c && c <= 0x1e021) || (0x1e023 <= c && c <= 0x1e024) ||
(0x1e026 <= c && c <= 0x1e02a) || (0x1e08f <= c && c <= 0x1e08f) ||
(0x1e130 <= c && c <= 0x1e136) || (0x1e2ae <= c && c <= 0x1e2ae) ||
(0x1e2ec <= c && c <= 0x1e2ef) || (0x1e4ec <= c && c <= 0x1e4ef) ||
(0x1e8d0 <= c && c <= 0x1e8d6) || (0x1e944 <= c && c <= 0x1e94a) ||
(0xe0001 <= c && c <= 0xe0001) || (0xe0020 <= c && c <= 0xe007f) ||
(0xe0100 <= c && c <= 0xe01ef))
return 0;
if ((0x1100 <= c && c <= 0x115f) || (0x231a <= c && c <= 0x231b) ||
(0x2329 <= c && c <= 0x232a) || (0x23e9 <= c && c <= 0x23ec) ||
(0x23f0 <= c && c <= 0x23f0) || (0x23f3 <= c && c <= 0x23f3) ||
(0x25fd <= c && c <= 0x25fe) || (0x2614 <= c && c <= 0x2615) ||
(0x2648 <= c && c <= 0x2653) || (0x267f <= c && c <= 0x267f) ||
(0x2693 <= c && c <= 0x2693) || (0x26a1 <= c && c <= 0x26a1) ||
(0x26aa <= c && c <= 0x26ab) || (0x26bd <= c && c <= 0x26be) ||
(0x26c4 <= c && c <= 0x26c5) || (0x26ce <= c && c <= 0x26ce) ||
(0x26d4 <= c && c <= 0x26d4) || (0x26ea <= c && c <= 0x26ea) ||
(0x26f2 <= c && c <= 0x26f3) || (0x26f5 <= c && c <= 0x26f5) ||
(0x26fa <= c && c <= 0x26fa) || (0x26fd <= c && c <= 0x26fd) ||
(0x2705 <= c && c <= 0x2705) || (0x270a <= c && c <= 0x270b) ||
(0x2728 <= c && c <= 0x2728) || (0x274c <= c && c <= 0x274c) ||
(0x274e <= c && c <= 0x274e) || (0x2753 <= c && c <= 0x2755) ||
(0x2757 <= c && c <= 0x2757) || (0x2795 <= c && c <= 0x2797) ||
(0x27b0 <= c && c <= 0x27b0) || (0x27bf <= c && c <= 0x27bf) ||
(0x2b1b <= c && c <= 0x2b1c) || (0x2b50 <= c && c <= 0x2b50) ||
(0x2b55 <= c && c <= 0x2b55) || (0x2e80 <= c && c <= 0x2e99) ||
(0x2e9b <= c && c <= 0x2ef3) || (0x2f00 <= c && c <= 0x2fd5) ||
(0x2ff0 <= c && c <= 0x3029) || (0x302e <= c && c <= 0x303e) ||
(0x3041 <= c && c <= 0x3096) || (0x309b <= c && c <= 0x30ff) ||
(0x3105 <= c && c <= 0x312f) || (0x3131 <= c && c <= 0x318e) ||
(0x3190 <= c && c <= 0x31e3) || (0x31ef <= c && c <= 0x321e) ||
(0x3220 <= c && c <= 0xa48c) || (0xa490 <= c && c <= 0xa4c6) ||
(0xa960 <= c && c <= 0xa97c) || (0xac00 <= c && c <= 0xd7a3) ||
(0xf900 <= c && c <= 0xfa6d) || (0xfa70 <= c && c <= 0xfad9) ||
(0xfe10 <= c && c <= 0xfe19) || (0xfe30 <= c && c <= 0xfe52) ||
(0xfe54 <= c && c <= 0xfe66) || (0xfe68 <= c && c <= 0xfe6b) ||
(0xff01 <= c && c <= 0xff60) || (0xffe0 <= c && c <= 0xffe6) ||
(0x16fe0 <= c && c <= 0x16fe3) || (0x16ff0 <= c && c <= 0x16ff1) ||
(0x17000 <= c && c <= 0x187f7) || (0x18800 <= c && c <= 0x18cd5) ||
(0x18d00 <= c && c <= 0x18d08) || (0x1aff0 <= c && c <= 0x1aff3) ||
(0x1aff5 <= c && c <= 0x1affb) || (0x1affd <= c && c <= 0x1affe) ||
(0x1b000 <= c && c <= 0x1b122) || (0x1b132 <= c && c <= 0x1b132) ||
(0x1b150 <= c && c <= 0x1b152) || (0x1b155 <= c && c <= 0x1b155) ||
(0x1b164 <= c && c <= 0x1b167) || (0x1b170 <= c && c <= 0x1b2fb) ||
(0x1f004 <= c && c <= 0x1f004) || (0x1f0cf <= c && c <= 0x1f0cf) ||
(0x1f18e <= c && c <= 0x1f18e) || (0x1f191 <= c && c <= 0x1f19a) ||
(0x1f200 <= c && c <= 0x1f202) || (0x1f210 <= c && c <= 0x1f23b) ||
(0x1f240 <= c && c <= 0x1f248) || (0x1f250 <= c && c <= 0x1f251) ||
(0x1f260 <= c && c <= 0x1f265) || (0x1f300 <= c && c <= 0x1f320) ||
(0x1f32d <= c && c <= 0x1f335) || (0x1f337 <= c && c <= 0x1f37c) ||
(0x1f37e <= c && c <= 0x1f393) || (0x1f3a0 <= c && c <= 0x1f3ca) ||
(0x1f3cf <= c && c <= 0x1f3d3) || (0x1f3e0 <= c && c <= 0x1f3f0) ||
(0x1f3f4 <= c && c <= 0x1f3f4) || (0x1f3f8 <= c && c <= 0x1f43e) ||
(0x1f440 <= c && c <= 0x1f440) || (0x1f442 <= c && c <= 0x1f4fc) ||
(0x1f4ff <= c && c <= 0x1f53d) || (0x1f54b <= c && c <= 0x1f54e) ||
(0x1f550 <= c && c <= 0x1f567) || (0x1f57a <= c && c <= 0x1f57a) ||
(0x1f595 <= c && c <= 0x1f596) || (0x1f5a4 <= c && c <= 0x1f5a4) ||
(0x1f5fb <= c && c <= 0x1f64f) || (0x1f680 <= c && c <= 0x1f6c5) ||
(0x1f6cc <= c && c <= 0x1f6cc) || (0x1f6d0 <= c && c <= 0x1f6d2) ||
(0x1f6d5 <= c && c <= 0x1f6d7) || (0x1f6dc <= c && c <= 0x1f6df) ||
(0x1f6eb <= c && c <= 0x1f6ec) || (0x1f6f4 <= c && c <= 0x1f6fc) ||
(0x1f7e0 <= c && c <= 0x1f7eb) || (0x1f7f0 <= c && c <= 0x1f7f0) ||
(0x1f90c <= c && c <= 0x1f93a) || (0x1f93c <= c && c <= 0x1f945) ||
(0x1f947 <= c && c <= 0x1f9ff) || (0x1fa70 <= c && c <= 0x1fa7c) ||
(0x1fa80 <= c && c <= 0x1fa88) || (0x1fa90 <= c && c <= 0x1fabd) ||
(0x1fabf <= c && c <= 0x1fac5) || (0x1face <= c && c <= 0x1fadb) ||
(0x1fae0 <= c && c <= 0x1fae8) || (0x1faf0 <= c && c <= 0x1faf8) ||
(0x20000 <= c && c <= 0x2a6df) || (0x2a700 <= c && c <= 0x2b739) ||
(0x2b740 <= c && c <= 0x2b81d) || (0x2b820 <= c && c <= 0x2cea1) ||
(0x2ceb0 <= c && c <= 0x2ebe0) || (0x2ebf0 <= c && c <= 0x2ee5d) ||
(0x2f800 <= c && c <= 0x2fa1d) || (0x30000 <= c && c <= 0x3134a) ||
(0x31350 <= c && c <= 0x323af))
return 2;
return 1;
}
/**
* Returns nonzero if 𝑐 isn't alphanumeric.
*
* Line reading interfaces generally define this operation as UNICODE
* characters that aren't in the letter category (Lu, Ll, Lt, Lm, Lo)
* and aren't in the number categorie (Nd, Nl, No). We also add a few
* other things like blocks and emoji (So).
*/
char bestlineIsSeparator(unsigned c) {
int m, l, r, n;
if (c < 0200) {
return !(('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
}
if (c <= 0xffff) {
static const unsigned short kGlyphs[][2] = {
{0x00aa, 0x00aa}, /* 1x English */
{0x00b2, 0x00b3}, /* 2x English Arabic */
{0x00b5, 0x00b5}, /* 1x Greek */
{0x00b9, 0x00ba}, /* 2x English Arabic */
{0x00bc, 0x00be}, /* 3x Vulgar English Arabic */
{0x00c0, 0x00d6}, /* 23x Watin */
{0x00d8, 0x00f6}, /* 31x Watin */
{0x0100, 0x02c1}, /* 450x Watin-AB,IPA,Spacemod */
{0x02c6, 0x02d1}, /* 12x Spacemod */
{0x02e0, 0x02e4}, /* 5x Spacemod */
{0x02ec, 0x02ec}, /* 1x Spacemod */
{0x02ee, 0x02ee}, /* 1x Spacemod */
{0x0370, 0x0374}, /* 5x Greek */
{0x0376, 0x0377}, /* 2x Greek */
{0x037a, 0x037d}, /* 4x Greek */
{0x037f, 0x037f}, /* 1x Greek */
{0x0386, 0x0386}, /* 1x Greek */
{0x0388, 0x038a}, /* 3x Greek */
{0x038c, 0x038c}, /* 1x Greek */
{0x038e, 0x03a1}, /* 20x Greek */
{0x03a3, 0x03f5}, /* 83x Greek */
{0x03f7, 0x0481}, /* 139x Greek */
{0x048a, 0x052f}, /* 166x Cyrillic */
{0x0531, 0x0556}, /* 38x Armenian */
{0x0560, 0x0588}, /* 41x Armenian */
{0x05d0, 0x05ea}, /* 27x Hebrew */
{0x0620, 0x064a}, /* 43x Arabic */
{0x0660, 0x0669}, /* 10x Arabic */
{0x0671, 0x06d3}, /* 99x Arabic */
{0x06ee, 0x06fc}, /* 15x Arabic */
{0x0712, 0x072f}, /* 30x Syriac */
{0x074d, 0x07a5}, /* 89x Syriac,Arabic2,Thaana */
{0x07c0, 0x07ea}, /* 43x NKo */
{0x0800, 0x0815}, /* 22x Samaritan */
{0x0840, 0x0858}, /* 25x Mandaic */
{0x0904, 0x0939}, /* 54x Devanagari */
{0x0993, 0x09a8}, /* 22x Bengali */
{0x09e6, 0x09f1}, /* 12x Bengali */
{0x0a13, 0x0a28}, /* 22x Gurmukhi */
{0x0a66, 0x0a6f}, /* 10x Gurmukhi */
{0x0a93, 0x0aa8}, /* 22x Gujarati */
{0x0b13, 0x0b28}, /* 22x Oriya */
{0x0c92, 0x0ca8}, /* 23x Kannada */
{0x0caa, 0x0cb3}, /* 10x Kannada */
{0x0ce6, 0x0cef}, /* 10x Kannada */
{0x0d12, 0x0d3a}, /* 41x Malayalam */
{0x0d85, 0x0d96}, /* 18x Sinhala */
{0x0d9a, 0x0db1}, /* 24x Sinhala */
{0x0de6, 0x0def}, /* 10x Sinhala */
{0x0e01, 0x0e30}, /* 48x Thai */
{0x0e8c, 0x0ea3}, /* 24x Lao */
{0x0f20, 0x0f33}, /* 20x Tibetan */
{0x0f49, 0x0f6c}, /* 36x Tibetan */
{0x109e, 0x10c5}, /* 40x Myanmar,Georgian */
{0x10d0, 0x10fa}, /* 43x Georgian */
{0x10fc, 0x1248}, /* 333x Georgian,Hangul,Ethiopic */
{0x13a0, 0x13f5}, /* 86x Cherokee */
{0x1401, 0x166d}, /* 621x Aboriginal */
{0x16a0, 0x16ea}, /* 75x Runic */
{0x1700, 0x170c}, /* 13x Tagalog */
{0x1780, 0x17b3}, /* 52x Khmer */
{0x1820, 0x1878}, /* 89x Mongolian */
{0x1a00, 0x1a16}, /* 23x Buginese */
{0x1a20, 0x1a54}, /* 53x Tai Tham */
{0x1a80, 0x1a89}, /* 10x Tai Tham */
{0x1a90, 0x1a99}, /* 10x Tai Tham */
{0x1b05, 0x1b33}, /* 47x Balinese */
{0x1b50, 0x1b59}, /* 10x Balinese */
{0x1b83, 0x1ba0}, /* 30x Sundanese */
{0x1bae, 0x1be5}, /* 56x Sundanese */
{0x1c90, 0x1cba}, /* 43x Georgian2 */
{0x1cbd, 0x1cbf}, /* 3x Georgian2 */
{0x1e00, 0x1f15}, /* 278x Watin-C,Greek2 */
{0x2070, 0x2071}, /* 2x Supersub */
{0x2074, 0x2079}, /* 6x Supersub */
{0x207f, 0x2089}, /* 11x Supersub */
{0x2090, 0x209c}, /* 13x Supersub */
{0x2100, 0x2117}, /* 24x Letterlike */
{0x2119, 0x213f}, /* 39x Letterlike */
{0x2145, 0x214a}, /* 6x Letterlike */
{0x214c, 0x218b}, /* 64x Letterlike,Numbery */
{0x21af, 0x21cd}, /* 31x Arrows */
{0x21d5, 0x21f3}, /* 31x Arrows */
{0x230c, 0x231f}, /* 20x Technical */
{0x232b, 0x237b}, /* 81x Technical */
{0x237d, 0x239a}, /* 30x Technical */
{0x23b4, 0x23db}, /* 40x Technical */
{0x23e2, 0x2426}, /* 69x Technical,ControlPictures */
{0x2460, 0x25b6}, /* 343x Enclosed,Boxes,Blocks,Shapes */
{0x25c2, 0x25f7}, /* 54x Shapes */
{0x2600, 0x266e}, /* 111x Symbols */
{0x2670, 0x2767}, /* 248x Symbols,Dingbats */
{0x2776, 0x27bf}, /* 74x Dingbats */
{0x2800, 0x28ff}, /* 256x Braille */
{0x2c00, 0x2c2e}, /* 47x Glagolitic */
{0x2c30, 0x2c5e}, /* 47x Glagolitic */
{0x2c60, 0x2ce4}, /* 133x Watin-D */
{0x2d00, 0x2d25}, /* 38x Georgian2 */
{0x2d30, 0x2d67}, /* 56x Tifinagh */
{0x2d80, 0x2d96}, /* 23x Ethiopic2 */
{0x2e2f, 0x2e2f}, /* 1x Punctuation2 */
{0x3005, 0x3007}, /* 3x CJK Symbols & Punctuation */
{0x3021, 0x3029}, /* 9x CJK Symbols & Punctuation */
{0x3031, 0x3035}, /* 5x CJK Symbols & Punctuation */
{0x3038, 0x303c}, /* 5x CJK Symbols & Punctuation */
{0x3041, 0x3096}, /* 86x Hiragana */
{0x30a1, 0x30fa}, /* 90x Katakana */
{0x3105, 0x312f}, /* 43x Bopomofo */
{0x3131, 0x318e}, /* 94x Hangul Compatibility Jamo */
{0x31a0, 0x31ba}, /* 27x Bopomofo Extended */
{0x31f0, 0x31ff}, /* 16x Katakana Phonetic Extensions */
{0x3220, 0x3229}, /* 10x Enclosed CJK Letters & Months */
{0x3248, 0x324f}, /* 8x Enclosed CJK Letters & Months */
{0x3251, 0x325f}, /* 15x Enclosed CJK Letters & Months */
{0x3280, 0x3289}, /* 10x Enclosed CJK Letters & Months */
{0x32b1, 0x32bf}, /* 15x Enclosed CJK Letters & Months */
{0x3400, 0x4db5}, /* 6582x CJK Unified Ideographs Extension A */
{0x4dc0, 0x9fef}, /* 21040x Yijing Hexagram, CJK Unified Ideographs */
{0xa000, 0xa48c}, /* 1165x Yi Syllables */
{0xa4d0, 0xa4fd}, /* 46x Lisu */
{0xa500, 0xa60c}, /* 269x Vai */
{0xa610, 0xa62b}, /* 28x Vai */
{0xa6a0, 0xa6ef}, /* 80x Bamum */
{0xa80c, 0xa822}, /* 23x Syloti Nagri */
{0xa840, 0xa873}, /* 52x Phags-pa */
{0xa882, 0xa8b3}, /* 50x Saurashtra */
{0xa8d0, 0xa8d9}, /* 10x Saurashtra */
{0xa900, 0xa925}, /* 38x Kayah Li */
{0xa930, 0xa946}, /* 23x Rejang */
{0xa960, 0xa97c}, /* 29x Hangul Jamo Extended-A */
{0xa984, 0xa9b2}, /* 47x Javanese */
{0xa9cf, 0xa9d9}, /* 11x Javanese */
{0xaa00, 0xaa28}, /* 41x Cham */
{0xaa50, 0xaa59}, /* 10x Cham */
{0xabf0, 0xabf9}, /* 10x Meetei Mayek */
{0xac00, 0xd7a3}, /* 11172x Hangul Syllables */
{0xf900, 0xfa6d}, /* 366x CJK Compatibility Ideographs */
{0xfa70, 0xfad9}, /* 106x CJK Compatibility Ideographs */
{0xfb1f, 0xfb28}, /* 10x Alphabetic Presentation Forms */
{0xfb2a, 0xfb36}, /* 13x Alphabetic Presentation Forms */
{0xfb46, 0xfbb1}, /* 108x Alphabetic Presentation Forms */
{0xfbd3, 0xfd3d}, /* 363x Arabic Presentation Forms-A */
{0xfe76, 0xfefc}, /* 135x Arabic Presentation Forms-B */
{0xff10, 0xff19}, /* 10x Dubs */
{0xff21, 0xff3a}, /* 26x Dubs */
{0xff41, 0xff5a}, /* 26x Dubs */
{0xff66, 0xffbe}, /* 89x Dubs */
{0xffc2, 0xffc7}, /* 6x Dubs */
{0xffca, 0xffcf}, /* 6x Dubs */
{0xffd2, 0xffd7}, /* 6x Dubs */
{0xffda, 0xffdc}, /* 3x Dubs */
};
l = 0;
r = n = sizeof(kGlyphs) / sizeof(kGlyphs[0]);
while (l < r) {
unsigned m = (l & r) + ((l ^ r) >> 1);
if (c < kGlyphs[m][0]) {
r = m;
} else if (c > kGlyphs[m][1]) {
l = m + 1;
} else {
return 0;
}
}
return 1;
} else {
static const unsigned kAstralGlyphs[][2] = {
{0x10107, 0x10133}, /* 45x Aegean */
{0x10140, 0x10178}, /* 57x Ancient Greek Numbers */
{0x1018a, 0x1018b}, /* 2x Ancient Greek Numbers */
{0x10280, 0x1029c}, /* 29x Lycian */
{0x102a0, 0x102d0}, /* 49x Carian */
{0x102e1, 0x102fb}, /* 27x Coptic Epact Numbers */
{0x10300, 0x10323}, /* 36x Old Italic */
{0x1032d, 0x1034a}, /* 30x Old Italic, Gothic */
{0x10350, 0x10375}, /* 38x Old Permic */
{0x10380, 0x1039d}, /* 30x Ugaritic */
{0x103a0, 0x103c3}, /* 36x Old Persian */
{0x103c8, 0x103cf}, /* 8x Old Persian */
{0x103d1, 0x103d5}, /* 5x Old Persian */
{0x10400, 0x1049d}, /* 158x Deseret, Shavian, Osmanya */
{0x104b0, 0x104d3}, /* 36x Osage */
{0x104d8, 0x104fb}, /* 36x Osage */
{0x10500, 0x10527}, /* 40x Elbasan */
{0x10530, 0x10563}, /* 52x Caucasian Albanian */
{0x10600, 0x10736}, /* 311x Linear A */
{0x10800, 0x10805}, /* 6x Cypriot Syllabary */
{0x1080a, 0x10835}, /* 44x Cypriot Syllabary */
{0x10837, 0x10838}, /* 2x Cypriot Syllabary */
{0x1083f, 0x1089e}, /* 86x Cypriot,ImperialAramaic,Palmyrene,Nabataean */
{0x108e0, 0x108f2}, /* 19x Hatran */
{0x108f4, 0x108f5}, /* 2x Hatran */
{0x108fb, 0x1091b}, /* 33x Hatran */
{0x10920, 0x10939}, /* 26x Lydian */
{0x10980, 0x109b7}, /* 56x Meroitic Hieroglyphs */
{0x109bc, 0x109cf}, /* 20x Meroitic Cursive */
{0x109d2, 0x10a00}, /* 47x Meroitic Cursive */
{0x10a10, 0x10a13}, /* 4x Kharoshthi */
{0x10a15, 0x10a17}, /* 3x Kharoshthi */
{0x10a19, 0x10a35}, /* 29x Kharoshthi */
{0x10a40, 0x10a48}, /* 9x Kharoshthi */
{0x10a60, 0x10a7e}, /* 31x Old South Arabian */
{0x10a80, 0x10a9f}, /* 32x Old North Arabian */
{0x10ac0, 0x10ac7}, /* 8x Manichaean */
{0x10ac9, 0x10ae4}, /* 28x Manichaean */
{0x10aeb, 0x10aef}, /* 5x Manichaean */
{0x10b00, 0x10b35}, /* 54x Avestan */
{0x10b40, 0x10b55}, /* 22x Inscriptional Parthian */
{0x10b58, 0x10b72}, /* 27x Inscriptional Parthian and Pahlavi */
{0x10b78, 0x10b91}, /* 26x Inscriptional Pahlavi, Psalter Pahlavi */
{0x10c00, 0x10c48}, /* 73x Old Turkic */
{0x10c80, 0x10cb2}, /* 51x Old Hungarian */
{0x10cc0, 0x10cf2}, /* 51x Old Hungarian */
{0x10cfa, 0x10d23}, /* 42x Old Hungarian, Hanifi Rohingya */
{0x10d30, 0x10d39}, /* 10x Hanifi Rohingya */
{0x10e60, 0x10e7e}, /* 31x Rumi Numeral Symbols */
{0x10f00, 0x10f27}, /* 40x Old Sogdian */
{0x10f30, 0x10f45}, /* 22x Sogdian */
{0x10f51, 0x10f54}, /* 4x Sogdian */
{0x10fe0, 0x10ff6}, /* 23x Elymaic */
{0x11003, 0x11037}, /* 53x Brahmi */
{0x11052, 0x1106f}, /* 30x Brahmi */
{0x11083, 0x110af}, /* 45x Kaithi */
{0x110d0, 0x110e8}, /* 25x Sora Sompeng */
{0x110f0, 0x110f9}, /* 10x Sora Sompeng */
{0x11103, 0x11126}, /* 36x Chakma */
{0x11136, 0x1113f}, /* 10x Chakma */
{0x11144, 0x11144}, /* 1x Chakma */
{0x11150, 0x11172}, /* 35x Mahajani */
{0x11176, 0x11176}, /* 1x Mahajani */
{0x11183, 0x111b2}, /* 48x Sharada */
{0x111c1, 0x111c4}, /* 4x Sharada */
{0x111d0, 0x111da}, /* 11x Sharada */
{0x111dc, 0x111dc}, /* 1x Sharada */
{0x111e1, 0x111f4}, /* 20x Sinhala Archaic Numbers */
{0x11200, 0x11211}, /* 18x Khojki */
{0x11213, 0x1122b}, /* 25x Khojki */
{0x11280, 0x11286}, /* 7x Multani */
{0x11288, 0x11288}, /* 1x Multani */
{0x1128a, 0x1128d}, /* 4x Multani */
{0x1128f, 0x1129d}, /* 15x Multani */
{0x1129f, 0x112a8}, /* 10x Multani */
{0x112b0, 0x112de}, /* 47x Khudawadi */
{0x112f0, 0x112f9}, /* 10x Khudawadi */
{0x11305, 0x1130c}, /* 8x Grantha */
{0x1130f, 0x11310}, /* 2x Grantha */
{0x11313, 0x11328}, /* 22x Grantha */
{0x1132a, 0x11330}, /* 7x Grantha */
{0x11332, 0x11333}, /* 2x Grantha */
{0x11335, 0x11339}, /* 5x Grantha */
{0x1133d, 0x1133d}, /* 1x Grantha */
{0x11350, 0x11350}, /* 1x Grantha */
{0x1135d, 0x11361}, /* 5x Grantha */
{0x11400, 0x11434}, /* 53x Newa */
{0x11447, 0x1144a}, /* 4x Newa */
{0x11450, 0x11459}, /* 10x Newa */
{0x1145f, 0x1145f}, /* 1x Newa */
{0x11480, 0x114af}, /* 48x Tirhuta */
{0x114c4, 0x114c5}, /* 2x Tirhuta */
{0x114c7, 0x114c7}, /* 1x Tirhuta */
{0x114d0, 0x114d9}, /* 10x Tirhuta */
{0x11580, 0x115ae}, /* 47x Siddham */
{0x115d8, 0x115db}, /* 4x Siddham */
{0x11600, 0x1162f}, /* 48x Modi */
{0x11644, 0x11644}, /* 1x Modi */
{0x11650, 0x11659}, /* 10x Modi */
{0x11680, 0x116aa}, /* 43x Takri */
{0x116b8, 0x116b8}, /* 1x Takri */
{0x116c0, 0x116c9}, /* 10x Takri */
{0x11700, 0x1171a}, /* 27x Ahom */
{0x11730, 0x1173b}, /* 12x Ahom */
{0x11800, 0x1182b}, /* 44x Dogra */
{0x118a0, 0x118f2}, /* 83x Warang Citi */
{0x118ff, 0x118ff}, /* 1x Warang Citi */
{0x119a0, 0x119a7}, /* 8x Nandinagari */
{0x119aa, 0x119d0}, /* 39x Nandinagari */
{0x119e1, 0x119e1}, /* 1x Nandinagari */
{0x119e3, 0x119e3}, /* 1x Nandinagari */
{0x11a00, 0x11a00}, /* 1x Zanabazar Square */
{0x11a0b, 0x11a32}, /* 40x Zanabazar Square */
{0x11a3a, 0x11a3a}, /* 1x Zanabazar Square */
{0x11a50, 0x11a50}, /* 1x Soyombo */
{0x11a5c, 0x11a89}, /* 46x Soyombo */
{0x11a9d, 0x11a9d}, /* 1x Soyombo */
{0x11ac0, 0x11af8}, /* 57x Pau Cin Hau */
{0x11c00, 0x11c08}, /* 9x Bhaiksuki */
{0x11c0a, 0x11c2e}, /* 37x Bhaiksuki */
{0x11c40, 0x11c40}, /* 1x Bhaiksuki */
{0x11c50, 0x11c6c}, /* 29x Bhaiksuki */
{0x11c72, 0x11c8f}, /* 30x Marchen */
{0x11d00, 0x11d06}, /* 7x Masaram Gondi */
{0x11d08, 0x11d09}, /* 2x Masaram Gondi */
{0x11d0b, 0x11d30}, /* 38x Masaram Gondi */
{0x11d46, 0x11d46}, /* 1x Masaram Gondi */
{0x11d50, 0x11d59}, /* 10x Masaram Gondi */
{0x11d60, 0x11d65}, /* 6x Gunjala Gondi */
{0x11d67, 0x11d68}, /* 2x Gunjala Gondi */
{0x11d6a, 0x11d89}, /* 32x Gunjala Gondi */
{0x11d98, 0x11d98}, /* 1x Gunjala Gondi */
{0x11da0, 0x11da9}, /* 10x Gunjala Gondi */
{0x11ee0, 0x11ef2}, /* 19x Makasar */
{0x11fc0, 0x11fd4}, /* 21x Tamil Supplement */
{0x12000, 0x12399}, /* 922x Cuneiform */
{0x12400, 0x1246e}, /* 111x Cuneiform Numbers & Punctuation */
{0x12480, 0x12543}, /* 196x Early Dynastic Cuneiform */
{0x13000, 0x1342e}, /* 1071x Egyptian Hieroglyphs */
{0x14400, 0x14646}, /* 583x Anatolian Hieroglyphs */
{0x16800, 0x16a38}, /* 569x Bamum Supplement */
{0x16a40, 0x16a5e}, /* 31x Mro */
{0x16a60, 0x16a69}, /* 10x Mro */
{0x16ad0, 0x16aed}, /* 30x Bassa Vah */
{0x16b00, 0x16b2f}, /* 48x Pahawh Hmong */
{0x16b40, 0x16b43}, /* 4x Pahawh Hmong */
{0x16b50, 0x16b59}, /* 10x Pahawh Hmong */
{0x16b5b, 0x16b61}, /* 7x Pahawh Hmong */
{0x16b63, 0x16b77}, /* 21x Pahawh Hmong */
{0x16b7d, 0x16b8f}, /* 19x Pahawh Hmong */
{0x16e40, 0x16e96}, /* 87x Medefaidrin */
{0x16f00, 0x16f4a}, /* 75x Miao */
{0x16f50, 0x16f50}, /* 1x Miao */
{0x16f93, 0x16f9f}, /* 13x Miao */
{0x16fe0, 0x16fe1}, /* 2x Ideographic Symbols & Punctuation */
{0x16fe3, 0x16fe3}, /* 1x Ideographic Symbols & Punctuation */
{0x17000, 0x187f7}, /* 6136x Tangut */
{0x18800, 0x18af2}, /* 755x Tangut Components */
{0x1b000, 0x1b11e}, /* 287x Kana Supplement */
{0x1b150, 0x1b152}, /* 3x Small Kana Extension */
{0x1b164, 0x1b167}, /* 4x Small Kana Extension */
{0x1b170, 0x1b2fb}, /* 396x Nushu */
{0x1bc00, 0x1bc6a}, /* 107x Duployan */
{0x1bc70, 0x1bc7c}, /* 13x Duployan */
{0x1bc80, 0x1bc88}, /* 9x Duployan */
{0x1bc90, 0x1bc99}, /* 10x Duployan */
{0x1d2e0, 0x1d2f3}, /* 20x Mayan Numerals */
{0x1d360, 0x1d378}, /* 25x Counting Rod Numerals */
{0x1d400, 0x1d454}, /* 85x 𝐀..𝑔 Math */
{0x1d456, 0x1d49c}, /* 71x 𝑖..𝒜 Math */
{0x1d49e, 0x1d49f}, /* 2x 𝒞..𝒟 Math */
{0x1d4a2, 0x1d4a2}, /* 1x 𝒢..𝒢 Math */
{0x1d4a5, 0x1d4a6}, /* 2x 𝒥..𝒦 Math */
{0x1d4a9, 0x1d4ac}, /* 4x 𝒩..𝒬 Math */
{0x1d4ae, 0x1d4b9}, /* 12x 𝒮..𝒹 Math */
{0x1d4bb, 0x1d4bb}, /* 1x 𝒻..𝒻 Math */
{0x1d4bd, 0x1d4c3}, /* 7x 𝒽..𝓃 Math */
{0x1d4c5, 0x1d505}, /* 65x 𝓅..𝔅 Math */
{0x1d507, 0x1d50a}, /* 4x 𝔇..𝔊 Math */
{0x1d50d, 0x1d514}, /* 8x 𝔍..𝔔 Math */
{0x1d516, 0x1d51c}, /* 7x 𝔖..𝔜 Math */
{0x1d51e, 0x1d539}, /* 28x 𝔞..𝔹 Math */
{0x1d53b, 0x1d53e}, /* 4x 𝔻..𝔾 Math */
{0x1d540, 0x1d544}, /* 5x 𝕀..𝕄 Math */
{0x1d546, 0x1d546}, /* 1x 𝕆..𝕆 Math */
{0x1d54a, 0x1d550}, /* 7x 𝕊..𝕐 Math */
{0x1d552, 0x1d6a5}, /* 340x 𝕒..𝚥 Math */
{0x1d6a8, 0x1d6c0}, /* 25x 𝚨..𝛀 Math */
{0x1d6c2, 0x1d6da}, /* 25x 𝛂..𝛚 Math */
{0x1d6dc, 0x1d6fa}, /* 31x 𝛜..𝛺 Math */
{0x1d6fc, 0x1d714}, /* 25x 𝛼..𝜔 Math */
{0x1d716, 0x1d734}, /* 31x 𝜖..𝜴 Math */
{0x1d736, 0x1d74e}, /* 25x 𝜶..𝝎 Math */
{0x1d750, 0x1d76e}, /* 31x 𝝐..𝝮 Math */
{0x1d770, 0x1d788}, /* 25x 𝝰..𝞈 Math */
{0x1d78a, 0x1d7a8}, /* 31x 𝞊..𝞨 Math */
{0x1d7aa, 0x1d7c2}, /* 25x 𝞪..𝟂 Math */
{0x1d7c4, 0x1d7cb}, /* 8x 𝟄..𝟋 Math */
{0x1d7ce, 0x1d9ff}, /* 562x Math, Sutton SignWriting */
{0x1f100, 0x1f10c}, /* 13x Enclosed Alphanumeric Supplement */
{0x20000, 0x2a6d6}, /* 42711x CJK Unified Ideographs Extension B */
{0x2a700, 0x2b734}, /* 4149x CJK Unified Ideographs Extension C */
{0x2b740, 0x2b81d}, /* 222x CJK Unified Ideographs Extension D */
{0x2b820, 0x2cea1}, /* 5762x CJK Unified Ideographs Extension E */
{0x2ceb0, 0x2ebe0}, /* 7473x CJK Unified Ideographs Extension F */
{0x2f800, 0x2fa1d}, /* 542x CJK Compatibility Ideographs Supplement */
};
l = 0;
r = n = sizeof(kAstralGlyphs) / sizeof(kAstralGlyphs[0]);
while (l < r) {
unsigned m = (l & r) + ((l ^ r) >> 1);
if (c < kAstralGlyphs[m][0]) {
r = m;
} else if (c > kAstralGlyphs[m][1]) {
l = m + 1;
} else {
return 0;
}
}
return 1;
}
}
unsigned bestlineLowercase(unsigned c) {
int m, l, r, n;
if (c < 0200) {
if ('A' <= c && c <= 'Z') {
return c + 32;
} else {
return c;
}
} else if (c <= 0xffff) {
if ((0x0100 <= c && c <= 0x0176) || /* 60x Ā..ā → ā..ŵ Watin-A */
(0x01de <= c && c <= 0x01ee) || /* 9x Ǟ..Ǯ → ǟ..ǯ Watin-B */
(0x01f8 <= c && c <= 0x021e) || /* 20x Ǹ..Ȟ → ǹ..ȟ Watin-B */
(0x0222 <= c && c <= 0x0232) || /* 9x Ȣ..Ȳ → ȣ..ȳ Watin-B */
(0x1e00 <= c && c <= 0x1eff)) { /*256x Ḁ..Ỿ → ḁ..ỿ Watin-C */
if (c == 0x0130)
return c - 199;
if (c == 0x1e9e)
return c;
return c + (~c & 1);
} else if (0x01cf <= c && c <= 0x01db) {
return c + (c & 1); /* 7x Ǐ..Ǜ → ǐ..ǜ Watin-B */
} else if (0x13a0 <= c && c <= 0x13ef) {
return c + 38864; /* 80x Ꭰ ..Ꮿ → ꭰ ..ꮿ Cherokee */
} else {
static const struct {
unsigned short a;
unsigned short b;
short d;
} kLower[] = {
{0x00c0, 0x00d6, +32}, /* 23x À ..Ö → à ..ö Watin */
{0x00d8, 0x00de, +32}, /* 7x Ø ..Þ → ø ..þ Watin */
{0x0178, 0x0178, -121}, /* 1x Ÿ ..Ÿ → ÿ ..ÿ Watin-A */
{0x0179, 0x0179, +1}, /* 1x Ź ..Ź → ź ..ź Watin-A */
{0x017b, 0x017b, +1}, /* 1x Ż ..Ż → ż ..ż Watin-A */
{0x017d, 0x017d, +1}, /* 1x Ž ..Ž → ž ..ž Watin-A */
{0x0181, 0x0181, +210}, /* 1x Ɓ ..Ɓ → ɓ ..ɓ Watin-B */
{0x0182, 0x0182, +1}, /* 1x Ƃ ..Ƃ → ƃ ..ƃ Watin-B */
{0x0184, 0x0184, +1}, /* 1x Ƅ ..Ƅ → ƅ ..ƅ Watin-B */
{0x0186, 0x0186, +206}, /* 1x Ɔ ..Ɔ → ɔ ..ɔ Watin-B */
{0x0187, 0x0187, +1}, /* 1x Ƈ ..Ƈ → ƈ ..ƈ Watin-B */
{0x0189, 0x018a, +205}, /* 2x Ɖ ..Ɗ → ɖ ..ɗ Watin-B */
{0x018b, 0x018b, +1}, /* 1x Ƌ ..Ƌ → ƌ ..ƌ Watin-B */
{0x018e, 0x018e, +79}, /* 1x Ǝ ..Ǝ → ǝ ..ǝ Watin-B */
{0x018f, 0x018f, +202}, /* 1x Ə ..Ə → ə ..ə Watin-B */
{0x0190, 0x0190, +203}, /* 1x Ɛ ..Ɛ → ɛ ..ɛ Watin-B */
{0x0191, 0x0191, +1}, /* 1x Ƒ ..Ƒ → ƒ ..ƒ Watin-B */
{0x0193, 0x0193, +205}, /* 1x Ɠ ..Ɠ → ɠ ..ɠ Watin-B */
{0x0194, 0x0194, +207}, /* 1x Ɣ ..Ɣ → ɣ ..ɣ Watin-B */
{0x0196, 0x0196, +211}, /* 1x Ɩ ..Ɩ → ɩ ..ɩ Watin-B */
{0x0197, 0x0197, +209}, /* 1x Ɨ ..Ɨ → ɨ ..ɨ Watin-B */
{0x0198, 0x0198, +1}, /* 1x Ƙ ..Ƙ → ƙ ..ƙ Watin-B */
{0x019c, 0x019c, +211}, /* 1x Ɯ ..Ɯ → ɯ ..ɯ Watin-B */
{0x019d, 0x019d, +213}, /* 1x Ɲ ..Ɲ → ɲ ..ɲ Watin-B */
{0x019f, 0x019f, +214}, /* 1x Ɵ ..Ɵ → ɵ ..ɵ Watin-B */
{0x01a0, 0x01a0, +1}, /* 1x Ơ ..Ơ → ơ ..ơ Watin-B */
{0x01a2, 0x01a2, +1}, /* 1x Ƣ ..Ƣ → ƣ ..ƣ Watin-B */
{0x01a4, 0x01a4, +1}, /* 1x Ƥ ..Ƥ → ƥ ..ƥ Watin-B */
{0x01a6, 0x01a6, +218}, /* 1x Ʀ ..Ʀ → ʀ ..ʀ Watin-B */
{0x01a7, 0x01a7, +1}, /* 1x Ƨ ..Ƨ → ƨ ..ƨ Watin-B */
{0x01a9, 0x01a9, +218}, /* 1x Ʃ ..Ʃ → ʃ ..ʃ Watin-B */
{0x01ac, 0x01ac, +1}, /* 1x Ƭ ..Ƭ → ƭ ..ƭ Watin-B */
{0x01ae, 0x01ae, +218}, /* 1x Ʈ ..Ʈ → ʈ ..ʈ Watin-B */
{0x01af, 0x01af, +1}, /* 1x Ư ..Ư → ư ..ư Watin-B */