diff --git a/src/ncurses/ncurses/CMakeLists.txt b/src/ncurses/ncurses/CMakeLists.txt index 38bb2eae1..8038059b1 100644 --- a/src/ncurses/ncurses/CMakeLists.txt +++ b/src/ncurses/ncurses/CMakeLists.txt @@ -179,9 +179,12 @@ set(ncurses_sources widechar/lib_vline_set.c widechar/lib_wacs.c widechar/lib_wunctrl.c - + + lib_keyname.c + lib_gen.c names.c base/codes.c + base/unctrl.c ) SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${SUFFIX}/darling") diff --git a/src/ncurses/ncurses/base/unctrl.c b/src/ncurses/ncurses/base/unctrl.c new file mode 100644 index 000000000..563b17627 --- /dev/null +++ b/src/ncurses/ncurses/base/unctrl.c @@ -0,0 +1,163 @@ +/* generated by MKunctrl.awk */ + +#include +#include + +#if USE_WIDEC_SUPPORT +#if HAVE_WCTYPE_H +#include +#endif +#endif + +#undef unctrl + +NCURSES_EXPORT(NCURSES_CONST char *) _nc_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 = ChCharOf(ch); + const char *result; + + 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 USE_WIDEC_SUPPORT + if ((check >= 160) + && (check < 256) + && ((sp != 0) + && ((sp->_legacy_coding > 0) + || (sp->_legacy_coding == 0 + && (isprint(check) || iswprint(check)))))) + result = unctrl_blob + unctrl_c1[check - 128]; + else +#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 /* USE_WIDEC_SUPPORT */ +#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 _nc_unctrl(SP, ch); +} diff --git a/src/ncurses/ncurses/lib_gen.c b/src/ncurses/ncurses/lib_gen.c new file mode 100644 index 000000000..5fbe1d78b --- /dev/null +++ b/src/ncurses/ncurses/lib_gen.c @@ -0,0 +1,1568 @@ +/* + * DO NOT EDIT THIS FILE BY HAND! + * It is generated by /tmp/ncurses-27.roots/ncurses-27/ncurses/ncurses/base/MKlib_gen.sh generated. + * + * This is a file of trivial functions generated from macro + * definitions in curses.h to satisfy the XSI Curses requirement + * that every macro also exist as a callable function. + * + * It will never be linked unless you call one of the entry + * points with its normal macro definition disabled. In that + * case, if you have no shared libraries, it will indirectly + * pull most of the rest of the library into your link image. + */ +#define NCURSES_ATTR_T int +#include + + +#undef addch +NCURSES_EXPORT(int) addch (const chtype z) +{ + T((T_CALLED("addch(%s)"), _tracechtype2(0,z))); returnCode(waddch(stdscr,z)); +} + + +#undef addchnstr +NCURSES_EXPORT(int) addchnstr (const chtype * a1, int z) +{ + T((T_CALLED("addchnstr(%p,%d)"), a1, z)); returnCode(waddchnstr(stdscr,a1,z)); +} + + +#undef addchstr +NCURSES_EXPORT(int) addchstr (const chtype * z) +{ + T((T_CALLED("addchstr(%p)"), z)); returnCode(waddchnstr(stdscr,z,-1)); +} + + +#undef addnstr +NCURSES_EXPORT(int) addnstr (const char * a1, int z) +{ + T((T_CALLED("addnstr(%s,%d)"), _nc_visbuf2(0,a1), z)); returnCode(waddnstr(stdscr,a1,z)); +} + + +#undef addstr +NCURSES_EXPORT(int) addstr (const char * z) +{ + T((T_CALLED("addstr(%s)"), _nc_visbuf2(0,z))); returnCode(waddnstr(stdscr,z,-1)); +} + + +#undef attroff +NCURSES_EXPORT(int) attroff (int z) +{ + T((T_CALLED("attroff(%s)"), _traceattr2(0,z))); returnCode(wattr_off(stdscr, (attr_t)(z), ((void *)0))); +} + + +#undef attron +NCURSES_EXPORT(int) attron (int z) +{ + T((T_CALLED("attron(%s)"), _traceattr2(0,z))); returnCode(wattr_on(stdscr, (attr_t)(z), ((void *)0))); +} + + +#undef attrset +NCURSES_EXPORT(int) attrset (int z) +{ + T((T_CALLED("attrset(%s)"), _traceattr2(0,z))); returnAttr(((stdscr)->_attrs = (z))); +} + + +#undef attr_get +NCURSES_EXPORT(int) attr_get (attr_t * a1, short * a2, void * z) +{ + T((T_CALLED("attr_get(%p,%p,%p)"), a1, a2, z)); returnCode(((void)((a1) != (void *)0 && (*(a1) = (stdscr)->_attrs)), (void)((a2) != (void *)0 && (*(a2) = ((int)(((((stdscr)->_attrs) & ((((1U) << 8) - 1U) << ((0) + 8))) >> 8))))), (0))); +} + + +#undef attr_off +NCURSES_EXPORT(int) attr_off (attr_t a1, void * z) +{ + T((T_CALLED("attr_off(%s,%p)"), _traceattr2(0,a1), z)); returnCode(wattr_off(stdscr,a1,z)); +} + + +#undef attr_on +NCURSES_EXPORT(int) attr_on (attr_t a1, void * z) +{ + T((T_CALLED("attr_on(%s,%p)"), _traceattr2(0,a1), z)); returnCode(wattr_on(stdscr,a1,z)); +} + + +#undef attr_set +NCURSES_EXPORT(int) attr_set (attr_t a1, short a2, void * z) +{ + T((T_CALLED("attr_set(%s,%d,%p)"), _traceattr2(0,a1), a2, z)); returnCode(((stdscr)->_attrs = (((a1) & ~((((1U) << 8) - 1U) << ((0) + 8))) | ((a2) << ((0) + 8))), (0))); +} + + +#undef bkgd +NCURSES_EXPORT(int) bkgd (chtype z) +{ + T((T_CALLED("bkgd(%s)"), _tracechtype2(0,z))); returnCode(wbkgd(stdscr,z)); +} + + +#undef bkgdset +NCURSES_EXPORT(void) bkgdset (chtype z) +{ + T((T_CALLED("bkgdset(%s)"), _tracechtype2(0,z))); wbkgdset(stdscr,z); + returnVoid; +} + + +#undef border +NCURSES_EXPORT(int) border (chtype a1, chtype a2, chtype a3, chtype a4, chtype a5, chtype a6, chtype a7, chtype z) +{ + T((T_CALLED("border(%s,%s,%s,%s,%s,%s,%s,%s)"), _tracechtype2(0,a1), _tracechtype2(1,a2), _tracechtype2(2,a3), _tracechtype2(3,a4), _tracechtype2(4,a5), _tracechtype2(5,a6), _tracechtype2(6,a7), _tracechtype2(7,z))); returnCode(wborder(stdscr, a1, a2, a3, a4, a5, a6, a7, z)); +} + + +#undef box +NCURSES_EXPORT(int) box (WINDOW * a1, chtype a2, chtype z) +{ + T((T_CALLED("box(%p,%s,%s)"), a1, _tracechtype2(1,a2), _tracechtype2(2,z))); returnCode(wborder(a1, a2, a2, z, z, 0, 0, 0, 0)); +} + + +#undef chgat +NCURSES_EXPORT(int) chgat (int a1, attr_t a2, short a3, const void * z) +{ + T((T_CALLED("chgat(%d,%s,%d,%p)"), a1, _traceattr2(1,a2), a3, z)); returnCode(wchgat(stdscr,a1,a2,a3,z)); +} + + +#undef clear +NCURSES_EXPORT(int) clear (void) +{ + T((T_CALLED("clear()"))); returnCode(wclear(stdscr)); +} + + +#undef clrtobot +NCURSES_EXPORT(int) clrtobot (void) +{ + T((T_CALLED("clrtobot()"))); returnCode(wclrtobot(stdscr)); +} + + +#undef clrtoeol +NCURSES_EXPORT(int) clrtoeol (void) +{ + T((T_CALLED("clrtoeol()"))); returnCode(wclrtoeol(stdscr)); +} + + +#undef color_set +NCURSES_EXPORT(int) color_set (short a1, void * z) +{ + T((T_CALLED("color_set(%d,%p)"), a1, z)); returnCode(wcolor_set(stdscr,a1,z)); +} + + +#undef COLOR_PAIR +NCURSES_EXPORT(int) COLOR_PAIR (int z) +{ + T((T_CALLED("COLOR_PAIR(%d)"), z)); returnCode(((z) << ((0) + 8))); +} + + +#undef delch +NCURSES_EXPORT(int) delch (void) +{ + T((T_CALLED("delch()"))); returnCode(wdelch(stdscr)); +} + + +#undef deleteln +NCURSES_EXPORT(int) deleteln (void) +{ + T((T_CALLED("deleteln()"))); returnCode(winsdelln(stdscr,-1)); +} + + +#undef echochar +NCURSES_EXPORT(int) echochar (const chtype z) +{ + T((T_CALLED("echochar(%s)"), _tracechtype2(0,z))); returnCode(wechochar(stdscr,z)); +} + + +#undef erase +NCURSES_EXPORT(int) erase (void) +{ + T((T_CALLED("erase()"))); returnCode(werase(stdscr)); +} + + +#undef getbkgd +NCURSES_EXPORT(chtype) getbkgd (WINDOW * z) +{ + T((T_CALLED("getbkgd(%p)"), z)); returnChar(((z)->_bkgd)); +} + + +#undef getch +NCURSES_EXPORT(int) getch (void) +{ + T((T_CALLED("getch()"))); returnCode(wgetch(stdscr)); +} + + +#undef getnstr +NCURSES_EXPORT(int) getnstr (char * a1, int z) +{ + T((T_CALLED("getnstr(%s,%d)"), _nc_visbuf2(0,a1), z)); returnCode(wgetnstr(stdscr, a1, z)); +} + + +#undef getstr +NCURSES_EXPORT(int) getstr (char * z) +{ + T((T_CALLED("getstr(%s)"), _nc_visbuf2(0,z))); returnCode(wgetnstr(stdscr, z, -1)); +} + + +#undef hline +NCURSES_EXPORT(int) hline (chtype a1, int z) +{ + T((T_CALLED("hline(%s,%d)"), _tracechtype2(0,a1), z)); returnCode(whline(stdscr, a1, z)); +} + + +#undef inch +NCURSES_EXPORT(chtype) inch (void) +{ + T((T_CALLED("inch()"))); returnChar(winch(stdscr)); +} + + +#undef inchnstr +NCURSES_EXPORT(int) inchnstr (chtype * a1, int z) +{ + T((T_CALLED("inchnstr(%p,%d)"), a1, z)); returnCode(winchnstr(stdscr,a1,z)); +} + + +#undef inchstr +NCURSES_EXPORT(int) inchstr (chtype * z) +{ + T((T_CALLED("inchstr(%p)"), z)); returnCode(winchnstr(stdscr, z, -1)); +} + + +#undef innstr +NCURSES_EXPORT(int) innstr (char * a1, int z) +{ + return winnstr(stdscr,a1,z) ; +} + + +#undef insch +NCURSES_EXPORT(int) insch (chtype z) +{ + T((T_CALLED("insch(%s)"), _tracechtype2(0,z))); returnCode(winsch(stdscr,z)); +} + + +#undef insdelln +NCURSES_EXPORT(int) insdelln (int z) +{ + T((T_CALLED("insdelln(%d)"), z)); returnCode(winsdelln(stdscr,z)); +} + + +#undef insertln +NCURSES_EXPORT(int) insertln (void) +{ + T((T_CALLED("insertln()"))); returnCode(winsdelln(stdscr,1)); +} + + +#undef insnstr +NCURSES_EXPORT(int) insnstr (const char * a1, int z) +{ + T((T_CALLED("insnstr(%s,%d)"), _nc_visbuf2(0,a1), z)); returnCode(winsnstr(stdscr,a1,z)); +} + + +#undef insstr +NCURSES_EXPORT(int) insstr (const char * z) +{ + T((T_CALLED("insstr(%s)"), _nc_visbuf2(0,z))); returnCode(winsnstr(stdscr, z, -1)); +} + + +#undef instr +NCURSES_EXPORT(int) instr (char * z) +{ + T((T_CALLED("instr(%s)"), _nc_visbuf2(0,z))); returnCode(winnstr(stdscr, z, -1)); +} + + +#undef move +NCURSES_EXPORT(int) move (int a1, int z) +{ + T((T_CALLED("move(%d,%d)"), a1, z)); returnCode(wmove(stdscr,a1,z)); +} + + +#undef mvaddch +NCURSES_EXPORT(int) mvaddch (int a1, int a2, const chtype z) +{ + T((T_CALLED("mvaddch(%d,%d,%s)"), a1, a2, _tracechtype2(2,z))); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddch(stdscr,z))); +} + + +#undef mvaddchnstr +NCURSES_EXPORT(int) mvaddchnstr (int a1, int a2, const chtype * a3, int z) +{ + T((T_CALLED("mvaddchnstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddchnstr(stdscr,a3,z))); +} + + +#undef mvaddchstr +NCURSES_EXPORT(int) mvaddchstr (int a1, int a2, const chtype * z) +{ + T((T_CALLED("mvaddchstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddchnstr(stdscr,z,-1))); +} + + +#undef mvaddnstr +NCURSES_EXPORT(int) mvaddnstr (int a1, int a2, const char * a3, int z) +{ + T((T_CALLED("mvaddnstr(%d,%d,%s,%d)"), a1, a2, _nc_visbuf2(2,a3), z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddnstr(stdscr,a3,z))); +} + + +#undef mvaddstr +NCURSES_EXPORT(int) mvaddstr (int a1, int a2, const char * z) +{ + T((T_CALLED("mvaddstr(%d,%d,%s)"), a1, a2, _nc_visbuf2(2,z))); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddnstr(stdscr,z,-1))); +} + + +#undef mvchgat +NCURSES_EXPORT(int) mvchgat (int a1, int a2, int a3, attr_t a4, short a5, const void * z) +{ + T((T_CALLED("mvchgat(%d,%d,%d,%s,%d,%p)"), a1, a2, a3, _traceattr2(3,a4), a5, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wchgat(stdscr,a3,a4,a5,z))); +} + + +#undef mvdelch +NCURSES_EXPORT(int) mvdelch (int a1, int z) +{ + T((T_CALLED("mvdelch(%d,%d)"), a1, z)); returnCode((wmove(stdscr,a1,z) == (-1) ? (-1) : wdelch(stdscr))); +} + + +#undef mvgetch +NCURSES_EXPORT(int) mvgetch (int a1, int z) +{ + T((T_CALLED("mvgetch(%d,%d)"), a1, z)); returnCode((wmove(stdscr,a1,z) == (-1) ? (-1) : wgetch(stdscr))); +} + + +#undef mvgetnstr +NCURSES_EXPORT(int) mvgetnstr (int a1, int a2, char * a3, int z) +{ + T((T_CALLED("mvgetnstr(%d,%d,%s,%d)"), a1, a2, _nc_visbuf2(2,a3), z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wgetnstr(stdscr,a3,z))); +} + + +#undef mvgetstr +NCURSES_EXPORT(int) mvgetstr (int a1, int a2, char * z) +{ + T((T_CALLED("mvgetstr(%d,%d,%s)"), a1, a2, _nc_visbuf2(2,z))); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wgetnstr(stdscr, z, -1))); +} + + +#undef mvhline +NCURSES_EXPORT(int) mvhline (int a1, int a2, chtype a3, int z) +{ + T((T_CALLED("mvhline(%d,%d,%s,%d)"), a1, a2, _tracechtype2(2,a3), z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : whline(stdscr,a3,z))); +} + + +#undef mvinch +NCURSES_EXPORT(chtype) mvinch (int a1, int z) +{ + T((T_CALLED("mvinch(%d,%d)"), a1, z)); returnChar((wmove(stdscr,a1,z) == (-1) ? (chtype)((-1)) : winch(stdscr))); +} + + +#undef mvinchnstr +NCURSES_EXPORT(int) mvinchnstr (int a1, int a2, chtype * a3, int z) +{ + T((T_CALLED("mvinchnstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winchnstr(stdscr,a3,z))); +} + + +#undef mvinchstr +NCURSES_EXPORT(int) mvinchstr (int a1, int a2, chtype * z) +{ + T((T_CALLED("mvinchstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winchnstr(stdscr, z, -1))); +} + + +#undef mvinnstr +NCURSES_EXPORT(int) mvinnstr (int a1, int a2, char * a3, int z) +{ + return (wmove(stdscr,a1,a2) == (-1) ? (-1) : winnstr(stdscr,a3,z)) ; +} + + +#undef mvinsch +NCURSES_EXPORT(int) mvinsch (int a1, int a2, chtype z) +{ + T((T_CALLED("mvinsch(%d,%d,%s)"), a1, a2, _tracechtype2(2,z))); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winsch(stdscr,z))); +} + + +#undef mvinsnstr +NCURSES_EXPORT(int) mvinsnstr (int a1, int a2, const char * a3, int z) +{ + T((T_CALLED("mvinsnstr(%d,%d,%s,%d)"), a1, a2, _nc_visbuf2(2,a3), z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winsnstr(stdscr,a3,z))); +} + + +#undef mvinsstr +NCURSES_EXPORT(int) mvinsstr (int a1, int a2, const char * z) +{ + T((T_CALLED("mvinsstr(%d,%d,%s)"), a1, a2, _nc_visbuf2(2,z))); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winsnstr(stdscr, z, -1))); +} + + +#undef mvinstr +NCURSES_EXPORT(int) mvinstr (int a1, int a2, char * z) +{ + T((T_CALLED("mvinstr(%d,%d,%s)"), a1, a2, _nc_visbuf2(2,z))); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winnstr(stdscr, z, -1))); +} + + +#undef mvvline +NCURSES_EXPORT(int) mvvline (int a1, int a2, chtype a3, int z) +{ + T((T_CALLED("mvvline(%d,%d,%s,%d)"), a1, a2, _tracechtype2(2,a3), z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wvline(stdscr,a3,z))); +} + + +#undef mvwaddch +NCURSES_EXPORT(int) mvwaddch (WINDOW * a1, int a2, int a3, const chtype z) +{ + T((T_CALLED("mvwaddch(%p,%d,%d,%s)"), a1, a2, a3, _tracechtype2(3,z))); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddch(a1,z))); +} + + +#undef mvwaddchnstr +NCURSES_EXPORT(int) mvwaddchnstr (WINDOW * a1, int a2, int a3, const chtype * a4, int z) +{ + T((T_CALLED("mvwaddchnstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddchnstr(a1,a4,z))); +} + + +#undef mvwaddchstr +NCURSES_EXPORT(int) mvwaddchstr (WINDOW * a1, int a2, int a3, const chtype * z) +{ + T((T_CALLED("mvwaddchstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddchnstr(a1,z,-1))); +} + + +#undef mvwaddnstr +NCURSES_EXPORT(int) mvwaddnstr (WINDOW * a1, int a2, int a3, const char * a4, int z) +{ + T((T_CALLED("mvwaddnstr(%p,%d,%d,%s,%d)"), a1, a2, a3, _nc_visbuf2(3,a4), z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddnstr(a1,a4,z))); +} + + +#undef mvwaddstr +NCURSES_EXPORT(int) mvwaddstr (WINDOW * a1, int a2, int a3, const char * z) +{ + T((T_CALLED("mvwaddstr(%p,%d,%d,%s)"), a1, a2, a3, _nc_visbuf2(3,z))); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddnstr(a1,z,-1))); +} + + +#undef mvwchgat +NCURSES_EXPORT(int) mvwchgat (WINDOW * a1, int a2, int a3, int a4, attr_t a5, short a6, const void * z) +{ + T((T_CALLED("mvwchgat(%p,%d,%d,%d,%s,%d,%p)"), a1, a2, a3, a4, _traceattr2(4,a5), a6, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wchgat(a1,a4,a5,a6,z))); +} + + +#undef mvwdelch +NCURSES_EXPORT(int) mvwdelch (WINDOW * a1, int a2, int z) +{ + T((T_CALLED("mvwdelch(%p,%d,%d)"), a1, a2, z)); returnCode((wmove(a1,a2,z) == (-1) ? (-1) : wdelch(a1))); +} + + +#undef mvwgetch +NCURSES_EXPORT(int) mvwgetch (WINDOW * a1, int a2, int z) +{ + T((T_CALLED("mvwgetch(%p,%d,%d)"), a1, a2, z)); returnCode((wmove(a1,a2,z) == (-1) ? (-1) : wgetch(a1))); +} + + +#undef mvwgetnstr +NCURSES_EXPORT(int) mvwgetnstr (WINDOW * a1, int a2, int a3, char * a4, int z) +{ + T((T_CALLED("mvwgetnstr(%p,%d,%d,%s,%d)"), a1, a2, a3, _nc_visbuf2(3,a4), z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wgetnstr(a1,a4,z))); +} + + +#undef mvwgetstr +NCURSES_EXPORT(int) mvwgetstr (WINDOW * a1, int a2, int a3, char * z) +{ + T((T_CALLED("mvwgetstr(%p,%d,%d,%s)"), a1, a2, a3, _nc_visbuf2(3,z))); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wgetnstr(a1, z, -1))); +} + + +#undef mvwhline +NCURSES_EXPORT(int) mvwhline (WINDOW * a1, int a2, int a3, chtype a4, int z) +{ + T((T_CALLED("mvwhline(%p,%d,%d,%s,%d)"), a1, a2, a3, _tracechtype2(3,a4), z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : whline(a1,a4,z))); +} + + +#undef mvwinch +NCURSES_EXPORT(chtype) mvwinch (WINDOW * a1, int a2, int z) +{ + T((T_CALLED("mvwinch(%p,%d,%d)"), a1, a2, z)); returnChar((wmove(a1,a2,z) == (-1) ? (chtype)((-1)) : winch(a1))); +} + + +#undef mvwinchnstr +NCURSES_EXPORT(int) mvwinchnstr (WINDOW * a1, int a2, int a3, chtype * a4, int z) +{ + T((T_CALLED("mvwinchnstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winchnstr(a1,a4,z))); +} + + +#undef mvwinchstr +NCURSES_EXPORT(int) mvwinchstr (WINDOW * a1, int a2, int a3, chtype * z) +{ + T((T_CALLED("mvwinchstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winchnstr(a1, z, -1))); +} + + +#undef mvwinnstr +NCURSES_EXPORT(int) mvwinnstr (WINDOW * a1, int a2, int a3, char * a4, int z) +{ + return (wmove(a1,a2,a3) == (-1) ? (-1) : winnstr(a1,a4,z)) ; +} + + +#undef mvwinsch +NCURSES_EXPORT(int) mvwinsch (WINDOW * a1, int a2, int a3, chtype z) +{ + T((T_CALLED("mvwinsch(%p,%d,%d,%s)"), a1, a2, a3, _tracechtype2(3,z))); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winsch(a1,z))); +} + + +#undef mvwinsnstr +NCURSES_EXPORT(int) mvwinsnstr (WINDOW * a1, int a2, int a3, const char * a4, int z) +{ + T((T_CALLED("mvwinsnstr(%p,%d,%d,%s,%d)"), a1, a2, a3, _nc_visbuf2(3,a4), z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winsnstr(a1,a4,z))); +} + + +#undef mvwinsstr +NCURSES_EXPORT(int) mvwinsstr (WINDOW * a1, int a2, int a3, const char * z) +{ + T((T_CALLED("mvwinsstr(%p,%d,%d,%s)"), a1, a2, a3, _nc_visbuf2(3,z))); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winsnstr(a1, z, -1))); +} + + +#undef mvwinstr +NCURSES_EXPORT(int) mvwinstr (WINDOW * a1, int a2, int a3, char * z) +{ + T((T_CALLED("mvwinstr(%p,%d,%d,%s)"), a1, a2, a3, _nc_visbuf2(3,z))); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winnstr(a1, z, -1))); +} + + +#undef mvwvline +NCURSES_EXPORT(int) mvwvline (WINDOW * a1, int a2, int a3, chtype a4, int z) +{ + T((T_CALLED("mvwvline(%p,%d,%d,%s,%d)"), a1, a2, a3, _tracechtype2(3,a4), z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wvline(a1,a4,z))); +} + + +#undef PAIR_NUMBER +NCURSES_EXPORT(int) PAIR_NUMBER (int z) +{ + T((T_CALLED("PAIR_NUMBER(%d)"), z)); returnCode(((int)((((z) & ((((1U) << 8) - 1U) << ((0) + 8))) >> 8)))); +} + + +#undef redrawwin +NCURSES_EXPORT(int) redrawwin (WINDOW * z) +{ + T((T_CALLED("redrawwin(%p)"), z)); returnCode(wredrawln(z, 0, (z)->_maxy+1)); +} + + +#undef refresh +NCURSES_EXPORT(int) refresh (void) +{ + T((T_CALLED("refresh()"))); returnCode(wrefresh(stdscr)); +} + + +#undef scrl +NCURSES_EXPORT(int) scrl (int z) +{ + T((T_CALLED("scrl(%d)"), z)); returnCode(wscrl(stdscr,z)); +} + + +#undef scroll +NCURSES_EXPORT(int) scroll (WINDOW * z) +{ + T((T_CALLED("scroll(%p)"), z)); returnCode(wscrl(z,1)); +} + + +#undef setscrreg +NCURSES_EXPORT(int) setscrreg (int a1, int z) +{ + T((T_CALLED("setscrreg(%d,%d)"), a1, z)); returnCode(wsetscrreg(stdscr,a1,z)); +} + + +#if USE_WIDEC_SUPPORT +#undef slk_attr_off +NCURSES_EXPORT(int) slk_attr_off (const attr_t a1, void * z) +{ + T((T_CALLED("slk_attr_off(%s,%p)"), _traceattr2(0,a1), z)); returnCode(((z) ? (-1) : slk_attroff(a1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef slk_attr_on +NCURSES_EXPORT(int) slk_attr_on (attr_t a1, void * z) +{ + T((T_CALLED("slk_attr_on(%s,%p)"), _traceattr2(0,a1), z)); returnCode(((z) ? (-1) : slk_attron(a1))); +} +#endif + + +#undef standout +NCURSES_EXPORT(int) standout (void) +{ + T((T_CALLED("standout()"))); returnAttr((((stdscr)->_attrs = (((1U) << ((8) + 8)))))); +} + + +#undef standend +NCURSES_EXPORT(int) standend (void) +{ + T((T_CALLED("standend()"))); returnAttr((((stdscr)->_attrs = ((1U - 1U))))); +} + + +#undef timeout +NCURSES_EXPORT(void) timeout (int z) +{ + T((T_CALLED("timeout(%d)"), z)); wtimeout(stdscr,z); + returnVoid; +} + + +#undef touchline +NCURSES_EXPORT(int) touchline (WINDOW * a1, int a2, int z) +{ + T((T_CALLED("touchline(%p,%d,%d)"), a1, a2, z)); returnCode(wtouchln((a1), a2, z, 1)); +} + + +#undef touchwin +NCURSES_EXPORT(int) touchwin (WINDOW * z) +{ + T((T_CALLED("touchwin(%p)"), z)); returnCode(wtouchln((z), 0, ((z) ? ((z)->_maxy + 1) : (-1)), 1)); +} + + +#undef untouchwin +NCURSES_EXPORT(int) untouchwin (WINDOW * z) +{ + T((T_CALLED("untouchwin(%p)"), z)); returnCode(wtouchln((z), 0, ((z) ? ((z)->_maxy + 1) : (-1)), 0)); +} + + +#undef vline +NCURSES_EXPORT(int) vline (chtype a1, int z) +{ + T((T_CALLED("vline(%s,%d)"), _tracechtype2(0,a1), z)); returnCode(wvline(stdscr, a1, z)); +} + + +#undef vw_printw +NCURSES_EXPORT(int) vw_printw (WINDOW * a1, const char * a2, va_list z) +{ + T((T_CALLED("vw_printw(%p,%s,%s)"), a1, _nc_visbuf2(1,a2), "va_list")); returnCode(vwprintw(a1, a2, z)); +} + + +#undef vw_scanw +NCURSES_EXPORT(int) vw_scanw (WINDOW * a1, char * a2, va_list z) +{ + T((T_CALLED("vw_scanw(%p,%s,%s)"), a1, _nc_visbuf2(1,a2), "va_list")); returnCode(vwscanw(a1, a2, z)); +} + + +#undef waddchstr +NCURSES_EXPORT(int) waddchstr (WINDOW * a1, const chtype * z) +{ + T((T_CALLED("waddchstr(%p,%p)"), a1, z)); returnCode(waddchnstr(a1,z,-1)); +} + + +#undef waddstr +NCURSES_EXPORT(int) waddstr (WINDOW * a1, const char * z) +{ + T((T_CALLED("waddstr(%p,%s)"), a1, _nc_visbuf2(1,z))); returnCode(waddnstr(a1,z,-1)); +} + + +#undef wattron +NCURSES_EXPORT(int) wattron (WINDOW * a1, int z) +{ + T((T_CALLED("wattron(%p,%d)"), a1, z)); returnCode(wattr_on(a1, (attr_t)(z), ((void *)0))); +} + + +#undef wattroff +NCURSES_EXPORT(int) wattroff (WINDOW * a1, int z) +{ + T((T_CALLED("wattroff(%p,%d)"), a1, z)); returnCode(wattr_off(a1, (attr_t)(z), ((void *)0))); +} + + +#undef wattrset +NCURSES_EXPORT(int) wattrset (WINDOW * a1, int z) +{ + T((T_CALLED("wattrset(%p,%d)"), a1, z)); returnAttr(((a1)->_attrs = (z))); +} + + +#undef wattr_get +NCURSES_EXPORT(int) wattr_get (WINDOW * a1, attr_t * a2, short * a3, void * z) +{ + T((T_CALLED("wattr_get(%p,%p,%p,%p)"), a1, a2, a3, z)); returnCode(((void)((a2) != (void *)0 && (*(a2) = (a1)->_attrs)), (void)((a3) != (void *)0 && (*(a3) = ((int)(((((a1)->_attrs) & ((((1U) << 8) - 1U) << ((0) + 8))) >> 8))))), (0))); +} + + +#undef wattr_set +NCURSES_EXPORT(int) wattr_set (WINDOW * a1, attr_t a2, short a3, void * z) +{ + T((T_CALLED("wattr_set(%p,%s,%d,%p)"), a1, _traceattr2(1,a2), a3, z)); returnCode(((a1)->_attrs = (((a2) & ~((((1U) << 8) - 1U) << ((0) + 8))) | ((a3) << ((0) + 8))), (0))); +} + + +#undef wdeleteln +NCURSES_EXPORT(int) wdeleteln (WINDOW * z) +{ + T((T_CALLED("wdeleteln(%p)"), z)); returnCode(winsdelln(z,-1)); +} + + +#undef wgetstr +NCURSES_EXPORT(int) wgetstr (WINDOW * a1, char * z) +{ + T((T_CALLED("wgetstr(%p,%s)"), a1, _nc_visbuf2(1,z))); returnCode(wgetnstr(a1, z, -1)); +} + + +#undef winchstr +NCURSES_EXPORT(int) winchstr (WINDOW * a1, chtype * z) +{ + T((T_CALLED("winchstr(%p,%p)"), a1, z)); returnCode(winchnstr(a1, z, -1)); +} + + +#undef winsertln +NCURSES_EXPORT(int) winsertln (WINDOW * z) +{ + T((T_CALLED("winsertln(%p)"), z)); returnCode(winsdelln(z,1)); +} + + +#undef winsstr +NCURSES_EXPORT(int) winsstr (WINDOW * a1, const char * z) +{ + T((T_CALLED("winsstr(%p,%s)"), a1, _nc_visbuf2(1,z))); returnCode(winsnstr(a1, z, -1)); +} + + +#undef winstr +NCURSES_EXPORT(int) winstr (WINDOW * a1, char * z) +{ + T((T_CALLED("winstr(%p,%s)"), a1, _nc_visbuf2(1,z))); returnCode(winnstr(a1, z, -1)); +} + + +#undef wstandout +NCURSES_EXPORT(int) wstandout (WINDOW * z) +{ + T((T_CALLED("wstandout(%p)"), z)); returnAttr((((z)->_attrs = (((1U) << ((8) + 8)))))); +} + + +#undef wstandend +NCURSES_EXPORT(int) wstandend (WINDOW * z) +{ + T((T_CALLED("wstandend(%p)"), z)); returnAttr((((z)->_attrs = ((1U - 1U))))); +} + + +#undef getattrs +NCURSES_EXPORT(int) getattrs (const WINDOW * z) +{ + T((T_CALLED("getattrs(%p)"), z)); returnCode(((z) ? (z)->_attrs : (1U - 1U))); +} + + +#undef getcurx +NCURSES_EXPORT(int) getcurx (const WINDOW * z) +{ + T((T_CALLED("getcurx(%p)"), z)); returnCode(((z) ? (z)->_curx : (-1))); +} + + +#undef getcury +NCURSES_EXPORT(int) getcury (const WINDOW * z) +{ + T((T_CALLED("getcury(%p)"), z)); returnCode(((z) ? (z)->_cury : (-1))); +} + + +#undef getbegx +NCURSES_EXPORT(int) getbegx (const WINDOW * z) +{ + T((T_CALLED("getbegx(%p)"), z)); returnCode(((z) ? (z)->_begx : (-1))); +} + + +#undef getbegy +NCURSES_EXPORT(int) getbegy (const WINDOW * z) +{ + T((T_CALLED("getbegy(%p)"), z)); returnCode(((z) ? (z)->_begy : (-1))); +} + + +#undef getmaxx +NCURSES_EXPORT(int) getmaxx (const WINDOW * z) +{ + T((T_CALLED("getmaxx(%p)"), z)); returnCode(((z) ? ((z)->_maxx + 1) : (-1))); +} + + +#undef getmaxy +NCURSES_EXPORT(int) getmaxy (const WINDOW * z) +{ + T((T_CALLED("getmaxy(%p)"), z)); returnCode(((z) ? ((z)->_maxy + 1) : (-1))); +} + + +#undef getparx +NCURSES_EXPORT(int) getparx (const WINDOW * z) +{ + T((T_CALLED("getparx(%p)"), z)); returnCode(((z) ? (z)->_parx : (-1))); +} + + +#undef getpary +NCURSES_EXPORT(int) getpary (const WINDOW * z) +{ + T((T_CALLED("getpary(%p)"), z)); returnCode(((z) ? (z)->_pary : (-1))); +} + + +#undef wgetparent +NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW * z) +{ + T((T_CALLED("(%p)"), z)); returnWin(((z) ? (z)->_parent : 0)); +} + + +#undef is_cleared +NCURSES_EXPORT(NCURSES_BOOL) is_cleared (const WINDOW * z) +{ + T((T_CALLED("is_cleared(%p)"), z)); returnBool(((z)->_clear)); +} + + +#undef is_idcok +NCURSES_EXPORT(NCURSES_BOOL) is_idcok (const WINDOW * z) +{ + T((T_CALLED("is_idcok(%p)"), z)); returnBool(((z)->_idcok)); +} + + +#undef is_idlok +NCURSES_EXPORT(NCURSES_BOOL) is_idlok (const WINDOW * z) +{ + T((T_CALLED("is_idlok(%p)"), z)); returnBool(((z)->_idlok)); +} + + +#undef is_immedok +NCURSES_EXPORT(NCURSES_BOOL) is_immedok (const WINDOW * z) +{ + T((T_CALLED("is_immedok(%p)"), z)); returnBool(((z)->_immed)); +} + + +#undef is_keypad +NCURSES_EXPORT(NCURSES_BOOL) is_keypad (const WINDOW * z) +{ + T((T_CALLED("is_keypad(%p)"), z)); returnBool(((z)->_use_keypad)); +} + + +#undef is_leaveok +NCURSES_EXPORT(NCURSES_BOOL) is_leaveok (const WINDOW * z) +{ + T((T_CALLED("is_leaveok(%p)"), z)); returnBool(((z)->_leaveok)); +} + + +#undef is_nodelay +NCURSES_EXPORT(NCURSES_BOOL) is_nodelay (const WINDOW * z) +{ + T((T_CALLED("is_nodelay(%p)"), z)); returnBool(((z)->_delay == 0)); +} + + +#undef is_notimeout +NCURSES_EXPORT(NCURSES_BOOL) is_notimeout (const WINDOW * z) +{ + T((T_CALLED("is_notimeout(%p)"), z)); returnBool(((z)->_notimeout)); +} + + +#undef is_scrollok +NCURSES_EXPORT(NCURSES_BOOL) is_scrollok (const WINDOW * z) +{ + T((T_CALLED("is_scrollok(%p)"), z)); returnBool(((z)->_scroll)); +} + + +#undef is_syncok +NCURSES_EXPORT(NCURSES_BOOL) is_syncok (const WINDOW * z) +{ + T((T_CALLED("is_syncok(%p)"), z)); returnBool(((z)->_sync)); +} + + +#undef wgetscrreg +NCURSES_EXPORT(int) wgetscrreg (const WINDOW * a1, int * a2, int * z) +{ + T((T_CALLED("wgetscrreg(%p,%p,%p)"), a1, a2, z)); returnCode(((a1) ? (*(a2) = (a1)->_regtop, *(z) = (a1)->_regbottom, (0)) : (-1))); +} + + +#if USE_WIDEC_SUPPORT +#undef add_wch +NCURSES_EXPORT(int) add_wch (const cchar_t * z) +{ + T((T_CALLED("add_wch(%p)"), z)); returnCode(wadd_wch(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef add_wchnstr +NCURSES_EXPORT(int) add_wchnstr (const cchar_t * a1, int z) +{ + T((T_CALLED("add_wchnstr(%p,%d)"), a1, z)); returnCode(wadd_wchnstr(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef add_wchstr +NCURSES_EXPORT(int) add_wchstr (const cchar_t * z) +{ + T((T_CALLED("add_wchstr(%p)"), z)); returnCode(wadd_wchnstr(stdscr,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef addnwstr +NCURSES_EXPORT(int) addnwstr (const wchar_t * a1, int z) +{ + T((T_CALLED("addnwstr(%p,%d)"), a1, z)); returnCode(waddnwstr(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef addwstr +NCURSES_EXPORT(int) addwstr (const wchar_t * z) +{ + T((T_CALLED("addwstr(%p)"), z)); returnCode(waddnwstr(stdscr,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef bkgrnd +NCURSES_EXPORT(int) bkgrnd (const cchar_t * z) +{ + T((T_CALLED("bkgrnd(%p)"), z)); returnCode(wbkgrnd(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef bkgrndset +NCURSES_EXPORT(void) bkgrndset (const cchar_t * z) +{ + T((T_CALLED("bkgrndset(%p)"), z)); wbkgrndset(stdscr,z); + returnVoid; +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef border_set +NCURSES_EXPORT(int) border_set (const cchar_t * a1, const cchar_t * a2, const cchar_t * a3, const cchar_t * a4, const cchar_t * a5, const cchar_t * a6, const cchar_t * a7, const cchar_t * z) +{ + T((T_CALLED("border_set(%p,%p,%p,%p,%p,%p,%p,%p)"), a1, a2, a3, a4, a5, a6, a7, z)); returnCode(wborder_set(stdscr,a1,a2,a3,a4,a5,a6,a7,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef box_set +NCURSES_EXPORT(int) box_set (WINDOW * a1, const cchar_t * a2, const cchar_t * z) +{ + T((T_CALLED("box_set(%p,%p,%p)"), a1, a2, z)); returnCode(wborder_set(a1,a2,a2,z,z,0,0,0,0)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef echo_wchar +NCURSES_EXPORT(int) echo_wchar (const cchar_t * z) +{ + T((T_CALLED("echo_wchar(%p)"), z)); returnCode(wecho_wchar(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef get_wch +NCURSES_EXPORT(int) get_wch (wint_t * z) +{ + T((T_CALLED("get_wch(%p)"), z)); returnCode(wget_wch(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef get_wstr +NCURSES_EXPORT(int) get_wstr (wint_t * z) +{ + T((T_CALLED("get_wstr(%p)"), z)); returnCode(wgetn_wstr(stdscr,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef getbkgrnd +NCURSES_EXPORT(int) getbkgrnd (cchar_t * z) +{ + T((T_CALLED("getbkgrnd(%p)"), z)); returnCode((*z = stdscr->_bkgrnd, (0))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef getn_wstr +NCURSES_EXPORT(int) getn_wstr (wint_t * a1, int z) +{ + T((T_CALLED("getn_wstr(%p,%d)"), a1, z)); returnCode(wgetn_wstr(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef hline_set +NCURSES_EXPORT(int) hline_set (const cchar_t * a1, int z) +{ + T((T_CALLED("hline_set(%p,%d)"), a1, z)); returnCode(whline_set(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef in_wch +NCURSES_EXPORT(int) in_wch (cchar_t * z) +{ + T((T_CALLED("in_wch(%p)"), z)); returnCode(win_wch(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef in_wchnstr +NCURSES_EXPORT(int) in_wchnstr (cchar_t * a1, int z) +{ + T((T_CALLED("in_wchnstr(%p,%d)"), a1, z)); returnCode(win_wchnstr(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef in_wchstr +NCURSES_EXPORT(int) in_wchstr (cchar_t * z) +{ + T((T_CALLED("in_wchstr(%p)"), z)); returnCode(win_wchnstr(stdscr,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef innwstr +NCURSES_EXPORT(int) innwstr (wchar_t * a1, int z) +{ + return winnwstr(stdscr,a1,z) ; +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef ins_nwstr +NCURSES_EXPORT(int) ins_nwstr (const wchar_t * a1, int z) +{ + T((T_CALLED("ins_nwstr(%p,%d)"), a1, z)); returnCode(wins_nwstr(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef ins_wch +NCURSES_EXPORT(int) ins_wch (const cchar_t * z) +{ + T((T_CALLED("ins_wch(%p)"), z)); returnCode(wins_wch(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef ins_wstr +NCURSES_EXPORT(int) ins_wstr (const wchar_t * z) +{ + T((T_CALLED("ins_wstr(%p)"), z)); returnCode(wins_nwstr(stdscr,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef inwstr +NCURSES_EXPORT(int) inwstr (wchar_t * z) +{ + T((T_CALLED("inwstr(%p)"), z)); returnCode(winwstr(stdscr,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvadd_wch +NCURSES_EXPORT(int) mvadd_wch (int a1, int a2, const cchar_t * z) +{ + T((T_CALLED("mvadd_wch(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wadd_wch(stdscr,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvadd_wchnstr +NCURSES_EXPORT(int) mvadd_wchnstr (int a1, int a2, const cchar_t * a3, int z) +{ + T((T_CALLED("mvadd_wchnstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wadd_wchnstr(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvadd_wchstr +NCURSES_EXPORT(int) mvadd_wchstr (int a1, int a2, const cchar_t * z) +{ + T((T_CALLED("mvadd_wchstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wadd_wchnstr(stdscr,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvaddnwstr +NCURSES_EXPORT(int) mvaddnwstr (int a1, int a2, const wchar_t * a3, int z) +{ + T((T_CALLED("mvaddnwstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddnwstr(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvaddwstr +NCURSES_EXPORT(int) mvaddwstr (int a1, int a2, const wchar_t * z) +{ + T((T_CALLED("mvaddwstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : waddnwstr(stdscr,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvget_wch +NCURSES_EXPORT(int) mvget_wch (int a1, int a2, wint_t * z) +{ + T((T_CALLED("mvget_wch(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wget_wch(stdscr,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvget_wstr +NCURSES_EXPORT(int) mvget_wstr (int a1, int a2, wint_t * z) +{ + T((T_CALLED("mvget_wstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wgetn_wstr(stdscr,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvgetn_wstr +NCURSES_EXPORT(int) mvgetn_wstr (int a1, int a2, wint_t * a3, int z) +{ + T((T_CALLED("mvgetn_wstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wgetn_wstr(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvhline_set +NCURSES_EXPORT(int) mvhline_set (int a1, int a2, const cchar_t * a3, int z) +{ + T((T_CALLED("mvhline_set(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : whline_set(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvin_wch +NCURSES_EXPORT(int) mvin_wch (int a1, int a2, cchar_t * z) +{ + T((T_CALLED("mvin_wch(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : win_wch(stdscr,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvin_wchnstr +NCURSES_EXPORT(int) mvin_wchnstr (int a1, int a2, cchar_t * a3, int z) +{ + T((T_CALLED("mvin_wchnstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : win_wchnstr(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvin_wchstr +NCURSES_EXPORT(int) mvin_wchstr (int a1, int a2, cchar_t * z) +{ + T((T_CALLED("mvin_wchstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : win_wchnstr(stdscr,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvinnwstr +NCURSES_EXPORT(int) mvinnwstr (int a1, int a2, wchar_t * a3, int z) +{ + return (wmove(stdscr,a1,a2) == (-1) ? (-1) : winnwstr(stdscr,a3,z)) ; +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvins_nwstr +NCURSES_EXPORT(int) mvins_nwstr (int a1, int a2, const wchar_t * a3, int z) +{ + T((T_CALLED("mvins_nwstr(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wins_nwstr(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvins_wch +NCURSES_EXPORT(int) mvins_wch (int a1, int a2, const cchar_t * z) +{ + T((T_CALLED("mvins_wch(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wins_wch(stdscr,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvins_wstr +NCURSES_EXPORT(int) mvins_wstr (int a1, int a2, const wchar_t * z) +{ + T((T_CALLED("mvins_wstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wins_nwstr(stdscr,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvinwstr +NCURSES_EXPORT(int) mvinwstr (int a1, int a2, wchar_t * z) +{ + T((T_CALLED("mvinwstr(%d,%d,%p)"), a1, a2, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : winwstr(stdscr,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvvline_set +NCURSES_EXPORT(int) mvvline_set (int a1, int a2, const cchar_t * a3, int z) +{ + T((T_CALLED("mvvline_set(%d,%d,%p,%d)"), a1, a2, a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wvline_set(stdscr,a3,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwadd_wch +NCURSES_EXPORT(int) mvwadd_wch (WINDOW * a1, int a2, int a3, const cchar_t * z) +{ + T((T_CALLED("mvwadd_wch(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wadd_wch(a1,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwadd_wchnstr +NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW * a1, int a2, int a3, const cchar_t * a4, int z) +{ + T((T_CALLED("mvwadd_wchnstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wadd_wchnstr(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwadd_wchstr +NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW * a1, int a2, int a3, const cchar_t * z) +{ + T((T_CALLED("mvwadd_wchstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wadd_wchnstr(a1,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwaddnwstr +NCURSES_EXPORT(int) mvwaddnwstr (WINDOW * a1, int a2, int a3, const wchar_t * a4, int z) +{ + T((T_CALLED("mvwaddnwstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddnwstr(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwaddwstr +NCURSES_EXPORT(int) mvwaddwstr (WINDOW * a1, int a2, int a3, const wchar_t * z) +{ + T((T_CALLED("mvwaddwstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : waddnwstr(a1,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwget_wch +NCURSES_EXPORT(int) mvwget_wch (WINDOW * a1, int a2, int a3, wint_t * z) +{ + T((T_CALLED("mvwget_wch(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wget_wch(a1,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwget_wstr +NCURSES_EXPORT(int) mvwget_wstr (WINDOW * a1, int a2, int a3, wint_t * z) +{ + T((T_CALLED("mvwget_wstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wgetn_wstr(a1,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwgetn_wstr +NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW * a1, int a2, int a3, wint_t * a4, int z) +{ + T((T_CALLED("mvwgetn_wstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wgetn_wstr(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwhline_set +NCURSES_EXPORT(int) mvwhline_set (WINDOW * a1, int a2, int a3, const cchar_t * a4, int z) +{ + T((T_CALLED("mvwhline_set(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : whline_set(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwin_wch +NCURSES_EXPORT(int) mvwin_wch (WINDOW * a1, int a2, int a3, cchar_t * z) +{ + T((T_CALLED("mvwin_wch(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : win_wch(a1,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwin_wchnstr +NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW * a1, int a2, int a3, cchar_t * a4, int z) +{ + T((T_CALLED("mvwin_wchnstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : win_wchnstr(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwin_wchstr +NCURSES_EXPORT(int) mvwin_wchstr (WINDOW * a1, int a2, int a3, cchar_t * z) +{ + T((T_CALLED("mvwin_wchstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : win_wchnstr(a1,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwinnwstr +NCURSES_EXPORT(int) mvwinnwstr (WINDOW * a1, int a2, int a3, wchar_t * a4, int z) +{ + return (wmove(a1,a2,a3) == (-1) ? (-1) : winnwstr(a1,a4,z)) ; +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwins_nwstr +NCURSES_EXPORT(int) mvwins_nwstr (WINDOW * a1, int a2, int a3, const wchar_t * a4, int z) +{ + T((T_CALLED("mvwins_nwstr(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wins_nwstr(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwins_wch +NCURSES_EXPORT(int) mvwins_wch (WINDOW * a1, int a2, int a3, const cchar_t * z) +{ + T((T_CALLED("mvwins_wch(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wins_wch(a1,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwins_wstr +NCURSES_EXPORT(int) mvwins_wstr (WINDOW * a1, int a2, int a3, const wchar_t * z) +{ + T((T_CALLED("mvwins_wstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wins_nwstr(a1,z,-1))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwinwstr +NCURSES_EXPORT(int) mvwinwstr (WINDOW * a1, int a2, int a3, wchar_t * z) +{ + T((T_CALLED("mvwinwstr(%p,%d,%d,%p)"), a1, a2, a3, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : winwstr(a1,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef mvwvline_set +NCURSES_EXPORT(int) mvwvline_set (WINDOW * a1, int a2, int a3, const cchar_t * a4, int z) +{ + T((T_CALLED("mvwvline_set(%p,%d,%d,%p,%d)"), a1, a2, a3, a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wvline_set(a1,a4,z))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef vline_set +NCURSES_EXPORT(int) vline_set (const cchar_t * a1, int z) +{ + T((T_CALLED("vline_set(%p,%d)"), a1, z)); returnCode(wvline_set(stdscr,a1,z)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef wadd_wchstr +NCURSES_EXPORT(int) wadd_wchstr (WINDOW * a1, const cchar_t * z) +{ + T((T_CALLED("wadd_wchstr(%p,%p)"), a1, z)); returnCode(wadd_wchnstr(a1,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef waddwstr +NCURSES_EXPORT(int) waddwstr (WINDOW * a1, const wchar_t * z) +{ + T((T_CALLED("waddwstr(%p,%p)"), a1, z)); returnCode(waddnwstr(a1,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef wget_wstr +NCURSES_EXPORT(int) wget_wstr (WINDOW * a1, wint_t * z) +{ + T((T_CALLED("wget_wstr(%p,%p)"), a1, z)); returnCode(wgetn_wstr(a1,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef wgetbkgrnd +NCURSES_EXPORT(int) wgetbkgrnd (WINDOW * a1, cchar_t * z) +{ + T((T_CALLED("wgetbkgrnd(%p,%p)"), a1, z)); returnCode((*z = a1->_bkgrnd, (0))); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef win_wchstr +NCURSES_EXPORT(int) win_wchstr (WINDOW * a1, cchar_t * z) +{ + T((T_CALLED("win_wchstr(%p,%p)"), a1, z)); returnCode(win_wchnstr(a1,z,-1)); +} +#endif + + +#if USE_WIDEC_SUPPORT +#undef wins_wstr +NCURSES_EXPORT(int) wins_wstr (WINDOW * a1, const wchar_t * z) +{ + T((T_CALLED("wins_wstr(%p,%p)"), a1, z)); returnCode(wins_nwstr(a1,z,-1)); +} +#endif + + +#undef mouse_trafo +NCURSES_EXPORT(NCURSES_BOOL) mouse_trafo (int * a1, int * a2, NCURSES_BOOL z) +{ + T((T_CALLED("mouse_trafo(%p,%p,%#lx)"), a1, a2, (long)z)); returnBool(wmouse_trafo(stdscr,a1,a2,z)); +} diff --git a/src/ncurses/ncurses/lib_keyname.c b/src/ncurses/ncurses/lib_keyname.c new file mode 100644 index 000000000..85dfbc6e3 --- /dev/null +++ b/src/ncurses/ncurses/lib_keyname.c @@ -0,0 +1,405 @@ +/* generated by MKkeyname.awk */ + +#include +#include +#include + +struct kn { short offset; int code; }; +static const struct kn _nc_key_names[] = { + { 0, KEY_A1 }, + { 7, KEY_A3 }, + { 14, KEY_B2 }, + { 21, KEY_BACKSPACE }, + { 35, KEY_BEG }, + { 43, KEY_BREAK }, + { 53, KEY_BTAB }, + { 62, KEY_C1 }, + { 69, KEY_C3 }, + { 76, KEY_CANCEL }, + { 87, KEY_CATAB }, + { 97, KEY_CLEAR }, + { 107, KEY_CLOSE }, + { 117, KEY_COMMAND }, + { 129, KEY_COPY }, + { 138, KEY_CREATE }, + { 149, KEY_CTAB }, + { 158, KEY_DC }, + { 165, KEY_DL }, + { 172, KEY_DOWN }, + { 181, KEY_EIC }, + { 189, KEY_END }, + { 197, KEY_ENTER }, + { 207, KEY_EOL }, + { 215, KEY_EOS }, + { 223, KEY_EXIT }, + { 232, KEY_F(0) }, + { 241, KEY_F(1) }, + { 250, KEY_F(10) }, + { 260, KEY_F(11) }, + { 270, KEY_F(12) }, + { 280, KEY_F(13) }, + { 290, KEY_F(14) }, + { 300, KEY_F(15) }, + { 310, KEY_F(16) }, + { 320, KEY_F(17) }, + { 330, KEY_F(18) }, + { 340, KEY_F(19) }, + { 350, KEY_F(2) }, + { 359, KEY_F(20) }, + { 369, KEY_F(21) }, + { 379, KEY_F(22) }, + { 389, KEY_F(23) }, + { 399, KEY_F(24) }, + { 409, KEY_F(25) }, + { 419, KEY_F(26) }, + { 429, KEY_F(27) }, + { 439, KEY_F(28) }, + { 449, KEY_F(29) }, + { 459, KEY_F(3) }, + { 468, KEY_F(30) }, + { 478, KEY_F(31) }, + { 488, KEY_F(32) }, + { 498, KEY_F(33) }, + { 508, KEY_F(34) }, + { 518, KEY_F(35) }, + { 528, KEY_F(36) }, + { 538, KEY_F(37) }, + { 548, KEY_F(38) }, + { 558, KEY_F(39) }, + { 568, KEY_F(4) }, + { 577, KEY_F(40) }, + { 587, KEY_F(41) }, + { 597, KEY_F(42) }, + { 607, KEY_F(43) }, + { 617, KEY_F(44) }, + { 627, KEY_F(45) }, + { 637, KEY_F(46) }, + { 647, KEY_F(47) }, + { 657, KEY_F(48) }, + { 667, KEY_F(49) }, + { 677, KEY_F(5) }, + { 686, KEY_F(50) }, + { 696, KEY_F(51) }, + { 706, KEY_F(52) }, + { 716, KEY_F(53) }, + { 726, KEY_F(54) }, + { 736, KEY_F(55) }, + { 746, KEY_F(56) }, + { 756, KEY_F(57) }, + { 766, KEY_F(58) }, + { 776, KEY_F(59) }, + { 786, KEY_F(6) }, + { 795, KEY_F(60) }, + { 805, KEY_F(61) }, + { 815, KEY_F(62) }, + { 825, KEY_F(63) }, + { 835, KEY_F(7) }, + { 844, KEY_F(8) }, + { 853, KEY_F(9) }, + { 862, KEY_FIND }, + { 871, KEY_HELP }, + { 880, KEY_HOME }, + { 889, KEY_IC }, + { 896, KEY_IL }, + { 903, KEY_LEFT }, + { 912, KEY_LL }, + { 919, KEY_MARK }, + { 928, KEY_MESSAGE }, + { 940, KEY_MOUSE }, + { 950, KEY_MOVE }, + { 959, KEY_NEXT }, + { 968, KEY_NPAGE }, + { 978, KEY_OPEN }, + { 987, KEY_OPTIONS }, + { 999, KEY_PPAGE }, + { 1009, KEY_PREVIOUS }, + { 1022, KEY_PRINT }, + { 1032, KEY_REDO }, + { 1041, KEY_REFERENCE }, + { 1055, KEY_REFRESH }, + { 1067, KEY_REPLACE }, + { 1079, KEY_RESET }, + { 1089, KEY_RESIZE }, + { 1100, KEY_RESTART }, + { 1112, KEY_RESUME }, + { 1123, KEY_RIGHT }, + { 1133, KEY_SAVE }, + { 1142, KEY_SBEG }, + { 1151, KEY_SCANCEL }, + { 1163, KEY_SCOMMAND }, + { 1176, KEY_SCOPY }, + { 1186, KEY_SCREATE }, + { 1198, KEY_SDC }, + { 1206, KEY_SDL }, + { 1214, KEY_SELECT }, + { 1225, KEY_SEND }, + { 1234, KEY_SEOL }, + { 1243, KEY_SEXIT }, + { 1253, KEY_SF }, + { 1260, KEY_SFIND }, + { 1270, KEY_SHELP }, + { 1280, KEY_SHOME }, + { 1290, KEY_SIC }, + { 1298, KEY_SLEFT }, + { 1308, KEY_SMESSAGE }, + { 1321, KEY_SMOVE }, + { 1331, KEY_SNEXT }, + { 1341, KEY_SOPTIONS }, + { 1354, KEY_SPREVIOUS }, + { 1368, KEY_SPRINT }, + { 1379, KEY_SR }, + { 1386, KEY_SREDO }, + { 1396, KEY_SREPLACE }, + { 1409, KEY_SRESET }, + { 1420, KEY_SRIGHT }, + { 1431, KEY_SRSUME }, + { 1442, KEY_SSAVE }, + { 1452, KEY_SSUSPEND }, + { 1465, KEY_STAB }, + { 1474, KEY_SUNDO }, + { 1484, KEY_SUSPEND }, + { 1496, KEY_UNDO }, + { 1505, KEY_UP }, + { -1, 0 }}; + +static const char key_names[] = + "KEY_A1\0" + "KEY_A3\0" + "KEY_B2\0" + "KEY_BACKSPACE\0" + "KEY_BEG\0" + "KEY_BREAK\0" + "KEY_BTAB\0" + "KEY_C1\0" + "KEY_C3\0" + "KEY_CANCEL\0" + "KEY_CATAB\0" + "KEY_CLEAR\0" + "KEY_CLOSE\0" + "KEY_COMMAND\0" + "KEY_COPY\0" + "KEY_CREATE\0" + "KEY_CTAB\0" + "KEY_DC\0" + "KEY_DL\0" + "KEY_DOWN\0" + "KEY_EIC\0" + "KEY_END\0" + "KEY_ENTER\0" + "KEY_EOL\0" + "KEY_EOS\0" + "KEY_EXIT\0" + "KEY_F(0)\0" + "KEY_F(1)\0" + "KEY_F(10)\0" + "KEY_F(11)\0" + "KEY_F(12)\0" + "KEY_F(13)\0" + "KEY_F(14)\0" + "KEY_F(15)\0" + "KEY_F(16)\0" + "KEY_F(17)\0" + "KEY_F(18)\0" + "KEY_F(19)\0" + "KEY_F(2)\0" + "KEY_F(20)\0" + "KEY_F(21)\0" + "KEY_F(22)\0" + "KEY_F(23)\0" + "KEY_F(24)\0" + "KEY_F(25)\0" + "KEY_F(26)\0" + "KEY_F(27)\0" + "KEY_F(28)\0" + "KEY_F(29)\0" + "KEY_F(3)\0" + "KEY_F(30)\0" + "KEY_F(31)\0" + "KEY_F(32)\0" + "KEY_F(33)\0" + "KEY_F(34)\0" + "KEY_F(35)\0" + "KEY_F(36)\0" + "KEY_F(37)\0" + "KEY_F(38)\0" + "KEY_F(39)\0" + "KEY_F(4)\0" + "KEY_F(40)\0" + "KEY_F(41)\0" + "KEY_F(42)\0" + "KEY_F(43)\0" + "KEY_F(44)\0" + "KEY_F(45)\0" + "KEY_F(46)\0" + "KEY_F(47)\0" + "KEY_F(48)\0" + "KEY_F(49)\0" + "KEY_F(5)\0" + "KEY_F(50)\0" + "KEY_F(51)\0" + "KEY_F(52)\0" + "KEY_F(53)\0" + "KEY_F(54)\0" + "KEY_F(55)\0" + "KEY_F(56)\0" + "KEY_F(57)\0" + "KEY_F(58)\0" + "KEY_F(59)\0" + "KEY_F(6)\0" + "KEY_F(60)\0" + "KEY_F(61)\0" + "KEY_F(62)\0" + "KEY_F(63)\0" + "KEY_F(7)\0" + "KEY_F(8)\0" + "KEY_F(9)\0" + "KEY_FIND\0" + "KEY_HELP\0" + "KEY_HOME\0" + "KEY_IC\0" + "KEY_IL\0" + "KEY_LEFT\0" + "KEY_LL\0" + "KEY_MARK\0" + "KEY_MESSAGE\0" + "KEY_MOUSE\0" + "KEY_MOVE\0" + "KEY_NEXT\0" + "KEY_NPAGE\0" + "KEY_OPEN\0" + "KEY_OPTIONS\0" + "KEY_PPAGE\0" + "KEY_PREVIOUS\0" + "KEY_PRINT\0" + "KEY_REDO\0" + "KEY_REFERENCE\0" + "KEY_REFRESH\0" + "KEY_REPLACE\0" + "KEY_RESET\0" + "KEY_RESIZE\0" + "KEY_RESTART\0" + "KEY_RESUME\0" + "KEY_RIGHT\0" + "KEY_SAVE\0" + "KEY_SBEG\0" + "KEY_SCANCEL\0" + "KEY_SCOMMAND\0" + "KEY_SCOPY\0" + "KEY_SCREATE\0" + "KEY_SDC\0" + "KEY_SDL\0" + "KEY_SELECT\0" + "KEY_SEND\0" + "KEY_SEOL\0" + "KEY_SEXIT\0" + "KEY_SF\0" + "KEY_SFIND\0" + "KEY_SHELP\0" + "KEY_SHOME\0" + "KEY_SIC\0" + "KEY_SLEFT\0" + "KEY_SMESSAGE\0" + "KEY_SMOVE\0" + "KEY_SNEXT\0" + "KEY_SOPTIONS\0" + "KEY_SPREVIOUS\0" + "KEY_SPRINT\0" + "KEY_SR\0" + "KEY_SREDO\0" + "KEY_SREPLACE\0" + "KEY_SRESET\0" + "KEY_SRIGHT\0" + "KEY_SRSUME\0" + "KEY_SSAVE\0" + "KEY_SSUSPEND\0" + "KEY_STAB\0" + "KEY_SUNDO\0" + "KEY_SUSPEND\0" + "KEY_UNDO\0" + "KEY_UP\0"; + +#define SIZEOF_TABLE 256 +#define MyTable _nc_globals.keyname_table + +NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *sp, int c) +{ + int i; + char name[20]; + char *p; + NCURSES_CONST char *result = 0; + + if (c == -1) { + result = "-1"; + } else { + for (i = 0; _nc_key_names[i].offset != -1; i++) { + if (_nc_key_names[i].code == c) { + result = (NCURSES_CONST char *)key_names + _nc_key_names[i].offset; + break; + } + } + + if (result == 0 && (c >= 0 && c < SIZEOF_TABLE)) { + if (MyTable == 0) + MyTable = typeCalloc(char *, SIZEOF_TABLE); + if (MyTable != 0) { + if (MyTable[c] == 0) { + int cc = c; + p = name; + if (cc >= 128 && (sp == 0 || sp->_use_meta)) { + strcpy(p, "M-"); + p += 2; + cc -= 128; + } + if (cc < 32) + sprintf(p, "^%c", cc + '@'); + else if (cc == 127) + strcpy(p, "^?"); + else + sprintf(p, "%c", cc); + MyTable[c] = strdup(name); + } + result = MyTable[c]; + } +#if NCURSES_EXT_FUNCS && NCURSES_XNAMES + } else if (result == 0 && cur_term != 0) { + int j, k; + char * bound; + TERMTYPE *tp = &(cur_term->type); + int save_trace = _nc_tracing; + + _nc_tracing = 0; /* prevent recursion via keybound() */ + for (j = 0; (bound = keybound(c, j)) != 0; ++j) { + for(k = STRCOUNT; k < (int) NUM_STRINGS(tp); k++) { + if (tp->Strings[k] != 0 && !strcmp(bound, tp->Strings[k])) { + result = ExtStrname(tp, k, strnames); + break; + } + } + free(bound); + if (result != 0) + break; + } + _nc_tracing = save_trace; +#endif + } + } + return result; +} + +NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c) +{ + return _nc_keyname(SP, c); +} + +#if NO_LEAKS +void _nc_keyname_leaks(void) +{ + int j; + if (MyTable != 0) { + for (j = 0; j < SIZEOF_TABLE; ++j) { + FreeIfNeeded(MyTable[j]); + } + FreeAndNull(MyTable); + } +} +#endif /* NO_LEAKS */