/* generated by MKunctrl.awk */ #include #include #undef unctrl NCURSES_EXPORT(NCURSES_CONST char *) safe_unctrl(SCREEN *sp, chtype ch) { static const short unctrl_table[] = { 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 289, 292, 295, 298, 301, 304, 307, 310, 313, 316, 319, 322, 325, 328, 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, 385, 389, 393, 397, 401, 405, 409, 413, 417, 421, 425, 429, 433, 437, 441, 445, 449, 453, 457, 461, 465, 469, 473, 477, 481, 485, 489, 493, 497, 501, 505, 509, 513, 517, 521, 525, 529, 533, 537, 541, 545, 549, 553, 557, 561, 565, 569, 573, 577, 581, 585, 589, 593, 597, 601, 605, 609, 613, 617, 621, 625, 629, 633, 637, 641, 645, 649, 653, 657, 661, 665, 669, 673, 677, 681, 685, 689, 693, 697, 701, 705, 709, 713, 717, 721, 725, 729, 733, 737, 741, 745, 749, 753, 757, 761, 765,}; #if NCURSES_EXT_FUNCS static const short unctrl_c1[] = { 768, 770, 772, 774, 776, 778, 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, 800, 802, 804, 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, 846, 848, 850, 852, 854, 856, 858, 860, 862, 864, 866, 868, 870, 872, 874, 876, 878, 880, 882, 884, 886, 888, 890, 892, 894, 896, 898, 900, 902, 904, 906, 908, 910, 912, 914, 916, 918, 920, 922, 924, 926, 928, 930, 932, 934, 936, 938, 940, 942, 944, 946, 948, 950, 952, 954, 956, 958, 960, 962, 964, 966, 968, 970, 972, 974, 976, 978, 980, 982, 984, 986, 988, 990, 992, 994, 996, 998,1000,1002,1004,1006, 1008,1010,1012,1014,1016,1018,1020,1022,}; #endif /* NCURSES_EXT_FUNCS */ static const char unctrl_blob[] = "^\100\0^\101\0^\102\0^\103\0^\104\0^\105\0^\106\0^\107\0" "^\110\0^\111\0^\112\0^\113\0^\114\0^\115\0^\116\0^\117\0" "^\120\0^\121\0^\122\0^\123\0^\124\0^\125\0^\126\0^\127\0" "^\130\0^\131\0^\132\0^\133\0^\134\0^\135\0^\136\0^\137\0" "\040\0\041\0\042\0\043\0\044\0\045\0\046\0\047\0" "\050\0\051\0\052\0\053\0\054\0\055\0\056\0\057\0" "\060\0\061\0\062\0\063\0\064\0\065\0\066\0\067\0" "\070\0\071\0\072\0\073\0\074\0\075\0\076\0\077\0" "\100\0\101\0\102\0\103\0\104\0\105\0\106\0\107\0" "\110\0\111\0\112\0\113\0\114\0\115\0\116\0\117\0" "\120\0\121\0\122\0\123\0\124\0\125\0\126\0\127\0" "\130\0\131\0\132\0\133\0\134\0\135\0\136\0\137\0" "\140\0\141\0\142\0\143\0\144\0\145\0\146\0\147\0" "\150\0\151\0\152\0\153\0\154\0\155\0\156\0\157\0" "\160\0\161\0\162\0\163\0\164\0\165\0\166\0\167\0" "\170\0\171\0\172\0\173\0\174\0\175\0\176\0^?\0" "~\100\0~\101\0~\102\0~\103\0~\104\0~\105\0~\106\0~\107\0" "~\110\0~\111\0~\112\0~\113\0~\114\0~\115\0~\116\0~\117\0" "~\120\0~\121\0~\122\0~\123\0~\124\0~\125\0~\126\0~\127\0" "~\130\0~\131\0~\132\0~\133\0~\134\0~\135\0~\136\0~\137\0" "M-\040\0M-\041\0M-\042\0M-\043\0M-\044\0M-\045\0M-\046\0M-\047\0" "M-\050\0M-\051\0M-\052\0M-\053\0M-\054\0M-\055\0M-\056\0M-\057\0" "M-\060\0M-\061\0M-\062\0M-\063\0M-\064\0M-\065\0M-\066\0M-\067\0" "M-\070\0M-\071\0M-\072\0M-\073\0M-\074\0M-\075\0M-\076\0M-\077\0" "M-\100\0M-\101\0M-\102\0M-\103\0M-\104\0M-\105\0M-\106\0M-\107\0" "M-\110\0M-\111\0M-\112\0M-\113\0M-\114\0M-\115\0M-\116\0M-\117\0" "M-\120\0M-\121\0M-\122\0M-\123\0M-\124\0M-\125\0M-\126\0M-\127\0" "M-\130\0M-\131\0M-\132\0M-\133\0M-\134\0M-\135\0M-\136\0M-\137\0" "M-\140\0M-\141\0M-\142\0M-\143\0M-\144\0M-\145\0M-\146\0M-\147\0" "M-\150\0M-\151\0M-\152\0M-\153\0M-\154\0M-\155\0M-\156\0M-\157\0" "M-\160\0M-\161\0M-\162\0M-\163\0M-\164\0M-\165\0M-\166\0M-\167\0" "M-\170\0M-\171\0M-\172\0M-\173\0M-\174\0M-\175\0M-\176\0~?\0" /* printable values in 128-255 range */ "\200\0\201\0\202\0\203\0\204\0\205\0\206\0\207\0" "\210\0\211\0\212\0\213\0\214\0\215\0\216\0\217\0" "\220\0\221\0\222\0\223\0\224\0\225\0\226\0\227\0" "\230\0\231\0\232\0\233\0\234\0\235\0\236\0\237\0" "\240\0\241\0\242\0\243\0\244\0\245\0\246\0\247\0" "\250\0\251\0\252\0\253\0\254\0\255\0\256\0\257\0" "\260\0\261\0\262\0\263\0\264\0\265\0\266\0\267\0" "\270\0\271\0\272\0\273\0\274\0\275\0\276\0\277\0" "\300\0\301\0\302\0\303\0\304\0\305\0\306\0\307\0" "\310\0\311\0\312\0\313\0\314\0\315\0\316\0\317\0" "\320\0\321\0\322\0\323\0\324\0\325\0\326\0\327\0" "\330\0\331\0\332\0\333\0\334\0\335\0\336\0\337\0" "\340\0\341\0\342\0\343\0\344\0\345\0\346\0\347\0" "\350\0\351\0\352\0\353\0\354\0\355\0\356\0\357\0" "\360\0\361\0\362\0\363\0\364\0\365\0\366\0\367\0" "\370\0\371\0\372\0\373\0\374\0\375\0\376\0\377\0" ; int check = (int) ChCharOf(ch); const char *result; (void) sp; if (check >= 0 && check < (int)SIZEOF(unctrl_table)) { #if NCURSES_EXT_FUNCS if ((sp != 0) && (sp->_legacy_coding > 1) && (check >= 128) && (check < 160)) result = unctrl_blob + unctrl_c1[check - 128]; else if ((check >= 160) && (check < 256) && ((sp != 0) && ((sp->_legacy_coding > 0) || (sp->_legacy_coding == 0 && isprint(check))))) result = unctrl_blob + unctrl_c1[check - 128]; else #endif /* NCURSES_EXT_FUNCS */ result = unctrl_blob + unctrl_table[check]; } else { result = 0; } return (NCURSES_CONST char *)result; } NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype ch) { return safe_unctrl(CURRENT_SCREEN, ch); }