Manual pages: mc • mcdiff • mcedit • mcview

root/lib/tty/tty-ncurses.c

/* [previous][next][first][last][top][bottom][index][help]  */

DEFINITIONS

This source file includes following definitions.
  1. tty_setup_sigwinch
  2. sigwinch_handler
  3. get_maybe_acs
  4. addch_maybe_acs
  5. hline_maybe_acs
  6. vline_maybe_acs
  7. tty_init
  8. tty_shutdown
  9. tty_enter_ca_mode
  10. tty_exit_ca_mode
  11. tty_change_screen_size
  12. tty_reset_prog_mode
  13. tty_reset_shell_mode
  14. tty_raw_mode
  15. tty_noraw_mode
  16. tty_noecho
  17. tty_flush_input
  18. tty_keypad
  19. tty_nodelay
  20. tty_baudrate
  21. tty_lowlevel_getch
  22. tty_reset_screen
  23. tty_touch_screen
  24. tty_gotoyx
  25. tty_getyx
  26. tty_draw_hline
  27. tty_draw_vline
  28. tty_clip
  29. tty_fill_region
  30. tty_display_8bit
  31. tty_print_char
  32. tty_print_anychar
  33. tty_print_string
  34. tty_printf
  35. tty_tigetflag
  36. tty_tigetnum
  37. tty_tigetstr
  38. tty_refresh
  39. tty_beep

   1 /*
   2    Interface to the terminal controlling library.
   3    Ncurses wrapper.
   4 
   5    Copyright (C) 2005-2026
   6    Free Software Foundation, Inc.
   7 
   8    Written by:
   9    Andrew Borodin <aborodin@vmail.ru>, 2009.
  10    Ilia Maslakov <il.smind@gmail.com>, 2009.
  11 
  12    This file is part of the Midnight Commander.
  13 
  14    The Midnight Commander is free software: you can redistribute it
  15    and/or modify it under the terms of the GNU General Public License as
  16    published by the Free Software Foundation, either version 3 of the License,
  17    or (at your option) any later version.
  18 
  19    The Midnight Commander is distributed in the hope that it will be useful,
  20    but WITHOUT ANY WARRANTY; without even the implied warranty of
  21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22    GNU General Public License for more details.
  23 
  24    You should have received a copy of the GNU General Public License
  25    along with this program.  If not, see <https://www.gnu.org/licenses/>.
  26  */
  27 
  28 /** \file
  29  *  \brief Source: NCurses-based tty layer of Midnight Commander
  30  */
  31 
  32 #include <config.h>
  33 
  34 #include <limits.h>  // MB_LEN_MAX
  35 #include <stdlib.h>
  36 #include <stdarg.h>
  37 #include <signal.h>
  38 #ifdef HAVE_SYS_IOCTL_H
  39 #include <sys/ioctl.h>
  40 #endif
  41 #include <termios.h>
  42 
  43 #include "lib/global.h"
  44 #include "lib/strutil.h"  // str_term_form
  45 #include "lib/util.h"
  46 
  47 #include "tty-internal.h"
  48 #include "tty.h"
  49 #include "color.h"  // tty_setcolor
  50 #include "color-internal.h"
  51 #include "key.h"
  52 #include "mouse.h"
  53 #include "win.h"
  54 
  55 /* include at last !!! */
  56 #ifdef HAVE_NCURSESW_TERM_H
  57 #include <ncursesw/term.h>
  58 #elif defined HAVE_NCURSES_TERM_H
  59 #include <ncurses/term.h>
  60 #else
  61 #include <term.h>
  62 #endif
  63 
  64 /*** global variables ****************************************************************************/
  65 
  66 gboolean ncurses_koi8r_double_line_bug;
  67 
  68 /*** file scope macro definitions ****************************************************************/
  69 
  70 #if !defined(CTRL)
  71 #define CTRL(x) ((x) & 0x1f)
  72 #endif
  73 
  74 #define yx_in_screen(y, x) (y >= 0 && y < LINES && x >= 0 && x < COLS)
  75 
  76 /*** global variables ****************************************************************************/
  77 
  78 /*** file scope type declarations ****************************************************************/
  79 
  80 /*** forward declarations (file scope functions) *************************************************/
  81 
  82 /*** file scope variables ************************************************************************/
  83 
  84 /* ncurses supports cursor positions only within window */
  85 /* We use our own cursor coordinates to support partially visible widgets */
  86 static int mc_curs_row, mc_curs_col;
  87 
  88 /* --------------------------------------------------------------------------------------------- */
  89 /*** file scope functions ************************************************************************/
  90 /* --------------------------------------------------------------------------------------------- */
  91 
  92 static void
  93 tty_setup_sigwinch (void (*handler) (int))
     /* [previous][next][first][last][top][bottom][index][help]  */
  94 {
  95 #if (NCURSES_VERSION_MAJOR >= 4) && defined(SIGWINCH)
  96     struct sigaction act, oact;
  97 
  98     memset (&act, 0, sizeof (act));
  99     act.sa_handler = handler;
 100     sigemptyset (&act.sa_mask);
 101 #ifdef SA_RESTART
 102     act.sa_flags = SA_RESTART;
 103 #endif
 104     my_sigaction (SIGWINCH, &act, &oact);
 105 #endif
 106 
 107     tty_create_winch_pipe ();
 108 }
 109 
 110 /* --------------------------------------------------------------------------------------------- */
 111 
 112 static void
 113 sigwinch_handler (int dummy)
     /* [previous][next][first][last][top][bottom][index][help]  */
 114 {
 115     ssize_t n = 0;
 116 
 117     (void) dummy;
 118 
 119     n = write (sigwinch_pipe[1], "", 1);
 120     (void) n;
 121 }
 122 
 123 /* --------------------------------------------------------------------------------------------- */
 124 
 125 static chtype
 126 get_maybe_acs (mc_tty_char_t ch)
     /* [previous][next][first][last][top][bottom][index][help]  */
 127 {
 128     switch (ch)
 129     {
 130     case MC_ACS_HLINE:
 131         return ACS_HLINE;
 132     case MC_ACS_VLINE:
 133         return ACS_VLINE;
 134     case MC_ACS_ULCORNER:
 135         return ACS_ULCORNER;
 136     case MC_ACS_URCORNER:
 137         return ACS_URCORNER;
 138     case MC_ACS_LLCORNER:
 139         return ACS_LLCORNER;
 140     case MC_ACS_LRCORNER:
 141         return ACS_LRCORNER;
 142     case MC_ACS_LTEE:
 143         return ACS_LTEE;
 144     case MC_ACS_RTEE:
 145         return ACS_RTEE;
 146     case MC_ACS_TTEE:
 147         return ACS_TTEE;
 148     case MC_ACS_BTEE:
 149         return ACS_BTEE;
 150     case MC_ACS_PLUS:
 151         return ACS_PLUS;
 152 
 153     default:
 154         return ch;
 155     }
 156 }
 157 
 158 /* --------------------------------------------------------------------------------------------- */
 159 
 160 static inline void
 161 addch_maybe_acs (mc_tty_char_t ch)
     /* [previous][next][first][last][top][bottom][index][help]  */
 162 {
 163 #ifdef HAVE_NCURSES_WIDECHAR
 164     if (mc_global.utf8_display)
 165     {
 166         wchar_t wch[2] = { ch, 0 };
 167         cchar_t ctext;
 168 
 169         setcchar (&ctext, wch, 0, 0, NULL);
 170         add_wch (&ctext);
 171     }
 172     else
 173 #endif
 174         addch (get_maybe_acs (ch));
 175 }
 176 
 177 /* --------------------------------------------------------------------------------------------- */
 178 
 179 static inline void
 180 hline_maybe_acs (mc_tty_char_t ch, int len)
     /* [previous][next][first][last][top][bottom][index][help]  */
 181 {
 182 #ifdef HAVE_NCURSES_WIDECHAR
 183     if (mc_global.utf8_display)
 184     {
 185         wchar_t wch[2] = { ch, 0 };
 186         cchar_t ctext;
 187 
 188         setcchar (&ctext, wch, 0, 0, NULL);
 189         hline_set (&ctext, len);
 190     }
 191     else
 192 #endif
 193         hline (get_maybe_acs (ch), len);
 194 }
 195 
 196 /* --------------------------------------------------------------------------------------------- */
 197 
 198 static inline void
 199 vline_maybe_acs (mc_tty_char_t ch, int len)
     /* [previous][next][first][last][top][bottom][index][help]  */
 200 {
 201 #ifdef HAVE_NCURSES_WIDECHAR
 202     if (mc_global.utf8_display)
 203     {
 204         wchar_t wch[2] = { ch, 0 };
 205         cchar_t ctext;
 206 
 207         setcchar (&ctext, wch, 0, 0, NULL);
 208         vline_set (&ctext, len);
 209     }
 210     else
 211 #endif
 212         vline (get_maybe_acs (ch), len);
 213 }
 214 
 215 /* --------------------------------------------------------------------------------------------- */
 216 /*** public functions ****************************************************************************/
 217 /* --------------------------------------------------------------------------------------------- */
 218 
 219 void
 220 tty_init (gboolean mouse_enable, gboolean is_xterm)
     /* [previous][next][first][last][top][bottom][index][help]  */
 221 {
 222     struct termios mode;
 223 
 224     // ncurses versions before 6.5-20251115 are buggy in KOI8-R locale, see mc #4799.
 225     // Note: This check will fail at ncurses version 10. We can surely remove this workaround then.
 226     const char *ncurses_ver = curses_version ();
 227 
 228     ncurses_koi8r_double_line_bug =
 229         (strncmp (ncurses_ver, "ncurses ", 8) == 0 && strcmp (ncurses_ver + 8, "6.5.20251115") < 0);
 230 
 231     initscr ();
 232 
 233 #ifdef HAVE_ESCDELAY
 234     /*
 235      * If ncurses exports the ESCDELAY variable, it should be set to
 236      * a low value, or you'll experience a delay in processing escape
 237      * sequences that are recognized by mc (e.g. Esc-Esc).  On the other
 238      * hand, making ESCDELAY too small can result in some sequences
 239      * (e.g. cursor arrows) being reported as separate keys under heavy
 240      * processor load, and this can be a problem if mc hasn't learned
 241      * them in the "Learn Keys" dialog.  The value is in milliseconds.
 242      */
 243     ESCDELAY = 200;
 244 #endif
 245 
 246     tcgetattr (STDIN_FILENO, &mode);
 247     // use Ctrl-g to generate SIGINT
 248     mode.c_cc[VINTR] = CTRL ('g');  // ^g
 249     // disable SIGQUIT to allow use Ctrl-\ key
 250     mode.c_cc[VQUIT] = NULL_VALUE;
 251     tcsetattr (STDIN_FILENO, TCSANOW, &mode);
 252 
 253     // curses remembers the "in-program" modes after this call
 254     def_prog_mode ();
 255 
 256     tty_start_interrupt_key ();
 257 
 258     if (!mouse_enable)
 259         use_mouse_p = MOUSE_DISABLED;
 260     tty_init_xterm_support (is_xterm);  // do it before tty_enter_ca_mode() call
 261     tty_enter_ca_mode ();
 262     tty_raw_mode ();
 263     noecho ();
 264     keypad (stdscr, TRUE);
 265     nodelay (stdscr, FALSE);
 266 
 267     tty_setup_sigwinch (sigwinch_handler);
 268 }
 269 
 270 /* --------------------------------------------------------------------------------------------- */
 271 
 272 void
 273 tty_shutdown (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 274 {
 275     tty_destroy_winch_pipe ();
 276     tty_reset_shell_mode ();
 277     tty_noraw_mode ();
 278     tty_keypad (FALSE);
 279     tty_reset_screen ();
 280     tty_exit_ca_mode ();
 281 }
 282 
 283 /* --------------------------------------------------------------------------------------------- */
 284 
 285 void
 286 tty_enter_ca_mode (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 287 {
 288     if (mc_global.tty.xterm_flag && smcup != NULL)
 289     {
 290         fprintf (stdout, ESC_STR "7" ESC_STR "[?47h");
 291         fflush (stdout);
 292     }
 293 }
 294 
 295 /* --------------------------------------------------------------------------------------------- */
 296 
 297 void
 298 tty_exit_ca_mode (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 299 {
 300     if (mc_global.tty.xterm_flag && rmcup != NULL)
 301     {
 302         fprintf (stdout, ESC_STR "[?47l" ESC_STR "8" ESC_STR "[m");
 303         fflush (stdout);
 304     }
 305 }
 306 
 307 /* --------------------------------------------------------------------------------------------- */
 308 
 309 void
 310 tty_change_screen_size (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 311 {
 312 #if defined(TIOCGWINSZ) && NCURSES_VERSION_MAJOR >= 4
 313     struct winsize winsz;
 314 
 315     winsz.ws_col = winsz.ws_row = 0;
 316 
 317 #ifndef NCURSES_VERSION
 318     tty_noraw_mode ();
 319     tty_reset_screen ();
 320 #endif
 321 
 322     // Ioctl on the STDIN_FILENO
 323     ioctl (fileno (stdout), TIOCGWINSZ, &winsz);
 324     if (winsz.ws_col != 0 && winsz.ws_row != 0)
 325     {
 326 #if defined(NCURSES_VERSION) && defined(HAVE_RESIZETERM)
 327         resizeterm (winsz.ws_row, winsz.ws_col);
 328         clearok (stdscr, TRUE);  // sigwinch's should use a semaphore!
 329 #else
 330         COLS = winsz.ws_col;
 331         LINES = winsz.ws_row;
 332 #endif
 333     }
 334 #endif
 335 
 336 #ifdef ENABLE_SUBSHELL
 337     if (mc_global.tty.use_subshell)
 338         tty_resize (mc_global.tty.subshell_pty);
 339 #endif
 340 }
 341 
 342 /* --------------------------------------------------------------------------------------------- */
 343 
 344 void
 345 tty_reset_prog_mode (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 346 {
 347     reset_prog_mode ();
 348 }
 349 
 350 /* --------------------------------------------------------------------------------------------- */
 351 
 352 void
 353 tty_reset_shell_mode (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 354 {
 355     reset_shell_mode ();
 356 }
 357 
 358 /* --------------------------------------------------------------------------------------------- */
 359 
 360 void
 361 tty_raw_mode (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 362 {
 363     raw ();  // FIXME: unneeded?
 364     cbreak ();
 365 }
 366 
 367 /* --------------------------------------------------------------------------------------------- */
 368 
 369 void
 370 tty_noraw_mode (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 371 {
 372     nocbreak ();  // FIXME: unneeded?
 373     noraw ();
 374 }
 375 
 376 /* --------------------------------------------------------------------------------------------- */
 377 
 378 void
 379 tty_noecho (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 380 {
 381     noecho ();
 382 }
 383 
 384 /* --------------------------------------------------------------------------------------------- */
 385 
 386 int
 387 tty_flush_input (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 388 {
 389     return flushinp ();
 390 }
 391 
 392 /* --------------------------------------------------------------------------------------------- */
 393 
 394 void
 395 tty_keypad (gboolean set)
     /* [previous][next][first][last][top][bottom][index][help]  */
 396 {
 397     keypad (stdscr, (bool) set);
 398 }
 399 
 400 /* --------------------------------------------------------------------------------------------- */
 401 
 402 void
 403 tty_nodelay (gboolean set)
     /* [previous][next][first][last][top][bottom][index][help]  */
 404 {
 405     nodelay (stdscr, (bool) set);
 406 }
 407 
 408 /* --------------------------------------------------------------------------------------------- */
 409 
 410 int
 411 tty_baudrate (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 412 {
 413     return baudrate ();
 414 }
 415 
 416 /* --------------------------------------------------------------------------------------------- */
 417 
 418 int
 419 tty_lowlevel_getch (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 420 {
 421     return getch ();
 422 }
 423 
 424 /* --------------------------------------------------------------------------------------------- */
 425 
 426 int
 427 tty_reset_screen (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 428 {
 429     return endwin ();
 430 }
 431 
 432 /* --------------------------------------------------------------------------------------------- */
 433 
 434 void
 435 tty_touch_screen (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 436 {
 437     touchwin (stdscr);
 438 }
 439 
 440 /* --------------------------------------------------------------------------------------------- */
 441 
 442 void
 443 tty_gotoyx (int y, int x)
     /* [previous][next][first][last][top][bottom][index][help]  */
 444 {
 445     mc_curs_row = y;
 446     mc_curs_col = x;
 447 
 448     if (y < 0)
 449         y = 0;
 450     if (y >= LINES)
 451         y = LINES - 1;
 452 
 453     if (x < 0)
 454         x = 0;
 455     if (x >= COLS)
 456         x = COLS - 1;
 457 
 458     move (y, x);
 459 }
 460 
 461 /* --------------------------------------------------------------------------------------------- */
 462 
 463 void
 464 tty_getyx (int *py, int *px)
     /* [previous][next][first][last][top][bottom][index][help]  */
 465 {
 466     *py = mc_curs_row;
 467     *px = mc_curs_col;
 468 }
 469 
 470 /* --------------------------------------------------------------------------------------------- */
 471 
 472 void
 473 tty_draw_hline (int y, int x, mc_tty_char_t ch, int len)
     /* [previous][next][first][last][top][bottom][index][help]  */
 474 {
 475     int x1;
 476 
 477     if (y < 0 || y >= LINES || x >= COLS)
 478         return;
 479 
 480     x1 = x;
 481 
 482     if (x < 0)
 483     {
 484         len += x;
 485         if (len <= 0)
 486             return;
 487         x = 0;
 488     }
 489 
 490     len = MAX (len, 0);
 491 
 492     move (y, x);
 493     hline_maybe_acs (ch, len);
 494     move (y, x1);
 495 
 496     mc_curs_row = y;
 497     mc_curs_col = x1;
 498 }
 499 
 500 /* --------------------------------------------------------------------------------------------- */
 501 
 502 void
 503 tty_draw_vline (int y, int x, mc_tty_char_t ch, int len)
     /* [previous][next][first][last][top][bottom][index][help]  */
 504 {
 505     int y1;
 506 
 507     if (x < 0 || x >= COLS || y >= LINES)
 508         return;
 509 
 510     y1 = y;
 511 
 512     if (y < 0)
 513     {
 514         len += y;
 515         if (len <= 0)
 516             return;
 517         y = 0;
 518     }
 519 
 520     len = MAX (len, 0);
 521 
 522     move (y, x);
 523     vline_maybe_acs (ch, len);
 524     move (y1, x);
 525 
 526     mc_curs_row = y1;
 527     mc_curs_col = x;
 528 }
 529 
 530 /* --------------------------------------------------------------------------------------------- */
 531 
 532 /**
 533  * Get visible part of area.
 534  *
 535  * @return TRUE if any part of area is in screen bounds, FALSE otherwise.
 536  */
 537 gboolean
 538 tty_clip (int *y, int *x, int *rows, int *cols)
     /* [previous][next][first][last][top][bottom][index][help]  */
 539 {
 540     if (*y < 0)
 541     {
 542         *rows += *y;
 543 
 544         if (*rows <= 0)
 545             return FALSE;
 546 
 547         *y = 0;
 548     }
 549 
 550     if (*x < 0)
 551     {
 552         *cols += *x;
 553 
 554         if (*cols <= 0)
 555             return FALSE;
 556 
 557         *x = 0;
 558     }
 559 
 560     if (*y + *rows > LINES)
 561         *rows = LINES - *y;
 562 
 563     if (*rows <= 0)
 564         return FALSE;
 565 
 566     if (*x + *cols > COLS)
 567         *cols = COLS - *x;
 568 
 569     if (*cols <= 0)
 570         return FALSE;
 571 
 572     return TRUE;
 573 }
 574 
 575 /* --------------------------------------------------------------------------------------------- */
 576 
 577 void
 578 tty_fill_region (int y, int x, int rows, int cols, unsigned char ch)
     /* [previous][next][first][last][top][bottom][index][help]  */
 579 {
 580     int i;
 581 
 582     if (!tty_clip (&y, &x, &rows, &cols))
 583         return;
 584 
 585     for (i = 0; i < rows; i++)
 586     {
 587         move (y + i, x);
 588         hline (ch, cols);
 589     }
 590 
 591     move (y, x);
 592 
 593     mc_curs_row = y;
 594     mc_curs_col = x;
 595 }
 596 
 597 /* --------------------------------------------------------------------------------------------- */
 598 
 599 void
 600 tty_display_8bit (gboolean what)
     /* [previous][next][first][last][top][bottom][index][help]  */
 601 {
 602     meta (stdscr, (int) what);
 603 }
 604 
 605 /* --------------------------------------------------------------------------------------------- */
 606 
 607 void
 608 tty_print_char (mc_tty_char_t c)
     /* [previous][next][first][last][top][bottom][index][help]  */
 609 {
 610     if (yx_in_screen (mc_curs_row, mc_curs_col))
 611         addch_maybe_acs (c);
 612     mc_curs_col++;
 613 }
 614 
 615 /* --------------------------------------------------------------------------------------------- */
 616 
 617 void
 618 tty_print_anychar (mc_tty_char_t c)
     /* [previous][next][first][last][top][bottom][index][help]  */
 619 {
 620     if (mc_global.utf8_display || c > 255)
 621     {
 622         int res;
 623         unsigned char str[MB_LEN_MAX + 1];
 624 
 625         res = g_unichar_to_utf8 (c, (char *) str);
 626         if (res == 0)
 627         {
 628             if (yx_in_screen (mc_curs_row, mc_curs_col))
 629                 addch_maybe_acs ('.');
 630             mc_curs_col++;
 631         }
 632         else
 633         {
 634             const char *s;
 635 
 636             str[res] = '\0';
 637             s = str_term_form ((char *) str);
 638 
 639             if (yx_in_screen (mc_curs_row, mc_curs_col))
 640                 addstr (s);
 641 
 642             if (g_unichar_iswide (c))
 643                 mc_curs_col += 2;
 644             else if (!g_unichar_iszerowidth (c))
 645                 mc_curs_col++;
 646         }
 647     }
 648     else
 649     {
 650         if (yx_in_screen (mc_curs_row, mc_curs_col))
 651             addch_maybe_acs (c);
 652         mc_curs_col++;
 653     }
 654 }
 655 
 656 /* --------------------------------------------------------------------------------------------- */
 657 
 658 void
 659 tty_print_string (const char *s)
     /* [previous][next][first][last][top][bottom][index][help]  */
 660 {
 661     int len;
 662     int start = 0;
 663 
 664     s = str_term_form (s);
 665     len = str_term_width1 (s);
 666 
 667     // line is upper or below the screen or entire line is before or after screen
 668     if (mc_curs_row < 0 || mc_curs_row >= LINES || mc_curs_col + len <= 0 || mc_curs_col >= COLS)
 669     {
 670         mc_curs_col += len;
 671         return;
 672     }
 673 
 674     // skip invisible left part
 675     if (mc_curs_col < 0)
 676     {
 677         start = -mc_curs_col;
 678         len += mc_curs_col;
 679         mc_curs_col = 0;
 680     }
 681 
 682     mc_curs_col += len;
 683     if (mc_curs_col >= COLS)
 684         len = COLS - (mc_curs_col - len);
 685 
 686     addstr (str_term_substring (s, start, len));
 687 }
 688 
 689 /* --------------------------------------------------------------------------------------------- */
 690 
 691 void
 692 tty_printf (const char *fmt, ...)
     /* [previous][next][first][last][top][bottom][index][help]  */
 693 {
 694     va_list args;
 695     char buf[BUF_1K];  // FIXME: is it enough?
 696 
 697     va_start (args, fmt);
 698     g_vsnprintf (buf, sizeof (buf), fmt, args);
 699     va_end (args);
 700     tty_print_string (buf);
 701 }
 702 
 703 /* --------------------------------------------------------------------------------------------- */
 704 
 705 int
 706 tty_tigetflag (const char *terminfo_cap, MC_UNUSED const char *termcap_cap)
     /* [previous][next][first][last][top][bottom][index][help]  */
 707 {
 708     return tigetflag ((NCURSES_CONST char *) terminfo_cap);
 709 }
 710 
 711 /* --------------------------------------------------------------------------------------------- */
 712 
 713 int
 714 tty_tigetnum (const char *terminfo_cap, MC_UNUSED const char *termcap_cap)
     /* [previous][next][first][last][top][bottom][index][help]  */
 715 {
 716     return tigetnum ((NCURSES_CONST char *) terminfo_cap);
 717 }
 718 
 719 /* --------------------------------------------------------------------------------------------- */
 720 
 721 char *
 722 tty_tigetstr (const char *terminfo_cap, MC_UNUSED const char *termcap_cap)
     /* [previous][next][first][last][top][bottom][index][help]  */
 723 {
 724     return tigetstr ((NCURSES_CONST char *) terminfo_cap);
 725 }
 726 
 727 /* --------------------------------------------------------------------------------------------- */
 728 
 729 void
 730 tty_refresh (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 731 {
 732     refresh ();
 733     doupdate ();
 734 }
 735 
 736 /* --------------------------------------------------------------------------------------------- */
 737 
 738 void
 739 tty_beep (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 740 {
 741     beep ();
 742 }
 743 
 744 /* --------------------------------------------------------------------------------------------- */

/* [previous][next][first][last][top][bottom][index][help]  */