tty-ncurses.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. /*
  2. Interface to the terminal controlling library.
  3. Ncurses wrapper.
  4. Copyright (C) 2005-2021
  5. Free Software Foundation, Inc.
  6. Written by:
  7. Andrew Borodin <aborodin@vmail.ru>, 2009.
  8. Ilia Maslakov <il.smind@gmail.com>, 2009.
  9. This file is part of the Midnight Commander.
  10. The Midnight Commander is free software: you can redistribute it
  11. and/or modify it under the terms of the GNU General Public License as
  12. published by the Free Software Foundation, either version 3 of the License,
  13. or (at your option) any later version.
  14. The Midnight Commander is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. GNU General Public License for more details.
  18. You should have received a copy of the GNU General Public License
  19. along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. /** \file
  22. * \brief Source: NCurses-based tty layer of Midnight-commander
  23. */
  24. #include <config.h>
  25. #include <stdlib.h>
  26. #include <stdarg.h>
  27. #include <signal.h>
  28. #ifdef HAVE_SYS_IOCTL_H
  29. #include <sys/ioctl.h>
  30. #endif
  31. #include <termios.h>
  32. #include "lib/global.h"
  33. #include "lib/strutil.h" /* str_term_form */
  34. #ifndef WANT_TERM_H
  35. #define WANT_TERM_H
  36. #endif
  37. #include "tty-internal.h" /* mc_tty_normalize_from_utf8() */
  38. #include "tty.h"
  39. #include "color.h" /* tty_setcolor */
  40. #include "color-internal.h"
  41. #include "key.h"
  42. #include "mouse.h"
  43. #include "win.h"
  44. /* include at last !!! */
  45. #ifdef WANT_TERM_H
  46. #ifdef HAVE_NCURSES_TERM_H
  47. #include <ncurses/term.h>
  48. #else
  49. #include <term.h>
  50. #endif /* HAVE_NCURSES_TERM_H */
  51. #endif /* WANT_TERM_H */
  52. /*** global variables ****************************************************************************/
  53. /*** file scope macro definitions ****************************************************************/
  54. #if !defined(CTRL)
  55. #define CTRL(x) ((x) & 0x1f)
  56. #endif
  57. #define yx_in_screen(y, x) \
  58. (y >= 0 && y < LINES && x >= 0 && x < COLS)
  59. /*** global variables ****************************************************************************/
  60. /*** file scope type declarations ****************************************************************/
  61. /*** file scope variables ************************************************************************/
  62. /* ncurses supports cursor positions only within window */
  63. /* We use our own cursor coordinates to support partially visible widgets */
  64. static int mc_curs_row, mc_curs_col;
  65. /*** file scope functions ************************************************************************/
  66. /* --------------------------------------------------------------------------------------------- */
  67. /* --------------------------------------------------------------------------------------------- */
  68. static void
  69. tty_setup_sigwinch (void (*handler) (int))
  70. {
  71. #if (NCURSES_VERSION_MAJOR >= 4) && defined (SIGWINCH)
  72. struct sigaction act, oact;
  73. memset (&act, 0, sizeof (act));
  74. act.sa_handler = handler;
  75. sigemptyset (&act.sa_mask);
  76. #ifdef SA_RESTART
  77. act.sa_flags = SA_RESTART;
  78. #endif /* SA_RESTART */
  79. sigaction (SIGWINCH, &act, &oact);
  80. #endif /* SIGWINCH */
  81. tty_create_winch_pipe ();
  82. }
  83. /* --------------------------------------------------------------------------------------------- */
  84. static void
  85. sigwinch_handler (int dummy)
  86. {
  87. ssize_t n = 0;
  88. (void) dummy;
  89. n = write (sigwinch_pipe[1], "", 1);
  90. (void) n;
  91. }
  92. /* --------------------------------------------------------------------------------------------- */
  93. /**
  94. * Get visible part of area.
  95. *
  96. * @returns TRUE if any part of area is in screen bounds, FALSE otherwise.
  97. */
  98. static gboolean
  99. tty_clip (int *y, int *x, int *rows, int *cols)
  100. {
  101. if (*y < 0)
  102. {
  103. *rows += *y;
  104. if (*rows <= 0)
  105. return FALSE;
  106. *y = 0;
  107. }
  108. if (*x < 0)
  109. {
  110. *cols += *x;
  111. if (*cols <= 0)
  112. return FALSE;
  113. *x = 0;
  114. }
  115. if (*y + *rows > LINES)
  116. *rows = LINES - *y;
  117. if (*rows <= 0)
  118. return FALSE;
  119. if (*x + *cols > COLS)
  120. *cols = COLS - *x;
  121. if (*cols <= 0)
  122. return FALSE;
  123. return TRUE;
  124. }
  125. /* --------------------------------------------------------------------------------------------- */
  126. /*** public functions ****************************************************************************/
  127. /* --------------------------------------------------------------------------------------------- */
  128. int
  129. mc_tty_normalize_lines_char (const char *ch)
  130. {
  131. char *str2;
  132. int res;
  133. struct mc_tty_lines_struct
  134. {
  135. const char *line;
  136. int line_code;
  137. } const lines_codes[] = {
  138. {"\342\224\230", ACS_LRCORNER}, /* ┌ */
  139. {"\342\224\224", ACS_LLCORNER}, /* └ */
  140. {"\342\224\220", ACS_URCORNER}, /* ┐ */
  141. {"\342\224\214", ACS_ULCORNER}, /* ┘ */
  142. {"\342\224\234", ACS_LTEE}, /* ├ */
  143. {"\342\224\244", ACS_RTEE}, /* ┤ */
  144. {"\342\224\254", ACS_TTEE}, /* ┬ */
  145. {"\342\224\264", ACS_BTEE}, /* ┴ */
  146. {"\342\224\200", ACS_HLINE}, /* ─ */
  147. {"\342\224\202", ACS_VLINE}, /* │ */
  148. {"\342\224\274", ACS_PLUS}, /* ┼ */
  149. {"\342\225\235", ACS_LRCORNER | A_BOLD}, /* ╔ */
  150. {"\342\225\232", ACS_LLCORNER | A_BOLD}, /* ╚ */
  151. {"\342\225\227", ACS_URCORNER | A_BOLD}, /* ╗ */
  152. {"\342\225\224", ACS_ULCORNER | A_BOLD}, /* ╝ */
  153. {"\342\225\237", ACS_LTEE | A_BOLD}, /* ╟ */
  154. {"\342\225\242", ACS_RTEE | A_BOLD}, /* ╢ */
  155. {"\342\225\244", ACS_TTEE | A_BOLD}, /* ╤ */
  156. {"\342\225\247", ACS_BTEE | A_BOLD}, /* ╧ */
  157. {"\342\225\220", ACS_HLINE | A_BOLD}, /* ═ */
  158. {"\342\225\221", ACS_VLINE | A_BOLD}, /* ║ */
  159. {NULL, 0}
  160. };
  161. if (ch == NULL)
  162. return (int) ' ';
  163. for (res = 0; lines_codes[res].line; res++)
  164. {
  165. if (strcmp (ch, lines_codes[res].line) == 0)
  166. return lines_codes[res].line_code;
  167. }
  168. str2 = mc_tty_normalize_from_utf8 (ch);
  169. res = g_utf8_get_char_validated (str2, -1);
  170. if (res < 0)
  171. res = (unsigned char) str2[0];
  172. g_free (str2);
  173. return res;
  174. }
  175. /* --------------------------------------------------------------------------------------------- */
  176. void
  177. tty_init (gboolean mouse_enable, gboolean is_xterm)
  178. {
  179. struct termios mode;
  180. initscr ();
  181. #ifdef HAVE_ESCDELAY
  182. /*
  183. * If ncurses exports the ESCDELAY variable, it should be set to
  184. * a low value, or you'll experience a delay in processing escape
  185. * sequences that are recognized by mc (e.g. Esc-Esc). On the other
  186. * hand, making ESCDELAY too small can result in some sequences
  187. * (e.g. cursor arrows) being reported as separate keys under heavy
  188. * processor load, and this can be a problem if mc hasn't learned
  189. * them in the "Learn Keys" dialog. The value is in milliseconds.
  190. */
  191. ESCDELAY = 200;
  192. #endif /* HAVE_ESCDELAY */
  193. tcgetattr (STDIN_FILENO, &mode);
  194. /* use Ctrl-g to generate SIGINT */
  195. mode.c_cc[VINTR] = CTRL ('g'); /* ^g */
  196. /* disable SIGQUIT to allow use Ctrl-\ key */
  197. mode.c_cc[VQUIT] = NULL_VALUE;
  198. tcsetattr (STDIN_FILENO, TCSANOW, &mode);
  199. /* curses remembers the "in-program" modes after this call */
  200. def_prog_mode ();
  201. tty_start_interrupt_key ();
  202. if (!mouse_enable)
  203. use_mouse_p = MOUSE_DISABLED;
  204. tty_init_xterm_support (is_xterm); /* do it before tty_enter_ca_mode() call */
  205. tty_enter_ca_mode ();
  206. tty_raw_mode ();
  207. noecho ();
  208. keypad (stdscr, TRUE);
  209. nodelay (stdscr, FALSE);
  210. tty_setup_sigwinch (sigwinch_handler);
  211. }
  212. /* --------------------------------------------------------------------------------------------- */
  213. void
  214. tty_shutdown (void)
  215. {
  216. tty_destroy_winch_pipe ();
  217. tty_reset_shell_mode ();
  218. tty_noraw_mode ();
  219. tty_keypad (FALSE);
  220. tty_reset_screen ();
  221. tty_exit_ca_mode ();
  222. }
  223. /* --------------------------------------------------------------------------------------------- */
  224. void
  225. tty_enter_ca_mode (void)
  226. {
  227. if (mc_global.tty.xterm_flag && smcup != NULL)
  228. {
  229. fprintf (stdout, /* ESC_STR ")0" */ ESC_STR "7" ESC_STR "[?47h");
  230. fflush (stdout);
  231. }
  232. }
  233. /* --------------------------------------------------------------------------------------------- */
  234. void
  235. tty_exit_ca_mode (void)
  236. {
  237. if (mc_global.tty.xterm_flag && rmcup != NULL)
  238. {
  239. fprintf (stdout, ESC_STR "[?47l" ESC_STR "8" ESC_STR "[m");
  240. fflush (stdout);
  241. }
  242. }
  243. /* --------------------------------------------------------------------------------------------- */
  244. void
  245. tty_change_screen_size (void)
  246. {
  247. #if defined(TIOCGWINSZ) && NCURSES_VERSION_MAJOR >= 4
  248. struct winsize winsz;
  249. winsz.ws_col = winsz.ws_row = 0;
  250. #ifndef NCURSES_VERSION
  251. tty_noraw_mode ();
  252. tty_reset_screen ();
  253. #endif
  254. /* Ioctl on the STDIN_FILENO */
  255. ioctl (fileno (stdout), TIOCGWINSZ, &winsz);
  256. if (winsz.ws_col != 0 && winsz.ws_row != 0)
  257. {
  258. #if defined(NCURSES_VERSION) && defined(HAVE_RESIZETERM)
  259. resizeterm (winsz.ws_row, winsz.ws_col);
  260. clearok (stdscr, TRUE); /* sigwinch's should use a semaphore! */
  261. #else
  262. COLS = winsz.ws_col;
  263. LINES = winsz.ws_row;
  264. #endif
  265. }
  266. #endif /* defined(TIOCGWINSZ) || NCURSES_VERSION_MAJOR >= 4 */
  267. #ifdef ENABLE_SUBSHELL
  268. if (mc_global.tty.use_subshell)
  269. tty_resize (mc_global.tty.subshell_pty);
  270. #endif
  271. }
  272. /* --------------------------------------------------------------------------------------------- */
  273. void
  274. tty_reset_prog_mode (void)
  275. {
  276. reset_prog_mode ();
  277. }
  278. /* --------------------------------------------------------------------------------------------- */
  279. void
  280. tty_reset_shell_mode (void)
  281. {
  282. reset_shell_mode ();
  283. }
  284. /* --------------------------------------------------------------------------------------------- */
  285. void
  286. tty_raw_mode (void)
  287. {
  288. raw (); /* FIXME: uneeded? */
  289. cbreak ();
  290. }
  291. /* --------------------------------------------------------------------------------------------- */
  292. void
  293. tty_noraw_mode (void)
  294. {
  295. nocbreak (); /* FIXME: unneeded? */
  296. noraw ();
  297. }
  298. /* --------------------------------------------------------------------------------------------- */
  299. void
  300. tty_noecho (void)
  301. {
  302. noecho ();
  303. }
  304. /* --------------------------------------------------------------------------------------------- */
  305. int
  306. tty_flush_input (void)
  307. {
  308. return flushinp ();
  309. }
  310. /* --------------------------------------------------------------------------------------------- */
  311. void
  312. tty_keypad (gboolean set)
  313. {
  314. keypad (stdscr, (bool) set);
  315. }
  316. /* --------------------------------------------------------------------------------------------- */
  317. void
  318. tty_nodelay (gboolean set)
  319. {
  320. nodelay (stdscr, (bool) set);
  321. }
  322. /* --------------------------------------------------------------------------------------------- */
  323. int
  324. tty_baudrate (void)
  325. {
  326. return baudrate ();
  327. }
  328. /* --------------------------------------------------------------------------------------------- */
  329. int
  330. tty_lowlevel_getch (void)
  331. {
  332. return getch ();
  333. }
  334. /* --------------------------------------------------------------------------------------------- */
  335. int
  336. tty_reset_screen (void)
  337. {
  338. return endwin ();
  339. }
  340. /* --------------------------------------------------------------------------------------------- */
  341. void
  342. tty_touch_screen (void)
  343. {
  344. touchwin (stdscr);
  345. }
  346. /* --------------------------------------------------------------------------------------------- */
  347. void
  348. tty_gotoyx (int y, int x)
  349. {
  350. mc_curs_row = y;
  351. mc_curs_col = x;
  352. if (y < 0)
  353. y = 0;
  354. if (y >= LINES)
  355. y = LINES - 1;
  356. if (x < 0)
  357. x = 0;
  358. if (x >= COLS)
  359. x = COLS - 1;
  360. move (y, x);
  361. }
  362. /* --------------------------------------------------------------------------------------------- */
  363. void
  364. tty_getyx (int *py, int *px)
  365. {
  366. *py = mc_curs_row;
  367. *px = mc_curs_col;
  368. }
  369. /* --------------------------------------------------------------------------------------------- */
  370. void
  371. tty_draw_hline (int y, int x, int ch, int len)
  372. {
  373. int x1;
  374. if (y < 0 || y >= LINES || x >= COLS)
  375. return;
  376. x1 = x;
  377. if (x < 0)
  378. {
  379. len += x;
  380. if (len <= 0)
  381. return;
  382. x = 0;
  383. }
  384. if ((chtype) ch == ACS_HLINE)
  385. ch = mc_tty_frm[MC_TTY_FRM_HORIZ];
  386. move (y, x);
  387. hline (ch, len);
  388. move (y, x1);
  389. mc_curs_row = y;
  390. mc_curs_col = x1;
  391. }
  392. /* --------------------------------------------------------------------------------------------- */
  393. void
  394. tty_draw_vline (int y, int x, int ch, int len)
  395. {
  396. int y1;
  397. if (x < 0 || x >= COLS || y >= LINES)
  398. return;
  399. y1 = y;
  400. if (y < 0)
  401. {
  402. len += y;
  403. if (len <= 0)
  404. return;
  405. y = 0;
  406. }
  407. if ((chtype) ch == ACS_VLINE)
  408. ch = mc_tty_frm[MC_TTY_FRM_VERT];
  409. move (y, x);
  410. vline (ch, len);
  411. move (y1, x);
  412. mc_curs_row = y1;
  413. mc_curs_col = x;
  414. }
  415. /* --------------------------------------------------------------------------------------------- */
  416. void
  417. tty_fill_region (int y, int x, int rows, int cols, unsigned char ch)
  418. {
  419. int i;
  420. if (!tty_clip (&y, &x, &rows, &cols))
  421. return;
  422. for (i = 0; i < rows; i++)
  423. {
  424. move (y + i, x);
  425. hline (ch, cols);
  426. }
  427. move (y, x);
  428. mc_curs_row = y;
  429. mc_curs_col = x;
  430. }
  431. /* --------------------------------------------------------------------------------------------- */
  432. void
  433. tty_colorize_area (int y, int x, int rows, int cols, int color)
  434. {
  435. cchar_t *ctext;
  436. wchar_t wch[10]; /* TODO not sure if the length is correct */
  437. attr_t attrs;
  438. short color_pair;
  439. if (!use_colors || !tty_clip (&y, &x, &rows, &cols))
  440. return;
  441. tty_setcolor (color);
  442. ctext = g_malloc (sizeof (cchar_t) * (cols + 1));
  443. for (int row = 0; row < rows; row++)
  444. {
  445. mvin_wchnstr (y + row, x, ctext, cols);
  446. for (int col = 0; col < cols; col++)
  447. {
  448. getcchar (&ctext[col], wch, &attrs, &color_pair, NULL);
  449. setcchar (&ctext[col], wch, attrs, color, NULL);
  450. }
  451. mvadd_wchnstr (y + row, x, ctext, cols);
  452. }
  453. g_free (ctext);
  454. }
  455. /* --------------------------------------------------------------------------------------------- */
  456. void
  457. tty_set_alt_charset (gboolean alt_charset)
  458. {
  459. (void) alt_charset;
  460. }
  461. /* --------------------------------------------------------------------------------------------- */
  462. void
  463. tty_display_8bit (gboolean what)
  464. {
  465. meta (stdscr, (int) what);
  466. }
  467. /* --------------------------------------------------------------------------------------------- */
  468. void
  469. tty_print_char (int c)
  470. {
  471. if (yx_in_screen (mc_curs_row, mc_curs_col))
  472. addch (c);
  473. mc_curs_col++;
  474. }
  475. /* --------------------------------------------------------------------------------------------- */
  476. void
  477. tty_print_anychar (int c)
  478. {
  479. if (mc_global.utf8_display || c > 255)
  480. {
  481. int res;
  482. unsigned char str[UTF8_CHAR_LEN + 1];
  483. res = g_unichar_to_utf8 (c, (char *) str);
  484. if (res == 0)
  485. {
  486. if (yx_in_screen (mc_curs_row, mc_curs_col))
  487. addch ('.');
  488. mc_curs_col++;
  489. }
  490. else
  491. {
  492. const char *s;
  493. str[res] = '\0';
  494. s = str_term_form ((char *) str);
  495. if (yx_in_screen (mc_curs_row, mc_curs_col))
  496. addstr (s);
  497. if (g_unichar_iswide (c))
  498. mc_curs_col += 2;
  499. else if (!g_unichar_iszerowidth (c))
  500. mc_curs_col++;
  501. }
  502. }
  503. else
  504. {
  505. if (yx_in_screen (mc_curs_row, mc_curs_col))
  506. addch (c);
  507. mc_curs_col++;
  508. }
  509. }
  510. /* --------------------------------------------------------------------------------------------- */
  511. void
  512. tty_print_alt_char (int c, gboolean single)
  513. {
  514. if (yx_in_screen (mc_curs_row, mc_curs_col))
  515. {
  516. if ((chtype) c == ACS_VLINE)
  517. c = mc_tty_frm[single ? MC_TTY_FRM_VERT : MC_TTY_FRM_DVERT];
  518. else if ((chtype) c == ACS_HLINE)
  519. c = mc_tty_frm[single ? MC_TTY_FRM_HORIZ : MC_TTY_FRM_DHORIZ];
  520. else if ((chtype) c == ACS_LTEE)
  521. c = mc_tty_frm[single ? MC_TTY_FRM_LEFTMIDDLE : MC_TTY_FRM_DLEFTMIDDLE];
  522. else if ((chtype) c == ACS_RTEE)
  523. c = mc_tty_frm[single ? MC_TTY_FRM_RIGHTMIDDLE : MC_TTY_FRM_DRIGHTMIDDLE];
  524. else if ((chtype) c == ACS_ULCORNER)
  525. c = mc_tty_frm[single ? MC_TTY_FRM_LEFTTOP : MC_TTY_FRM_DLEFTTOP];
  526. else if ((chtype) c == ACS_LLCORNER)
  527. c = mc_tty_frm[single ? MC_TTY_FRM_LEFTBOTTOM : MC_TTY_FRM_DLEFTBOTTOM];
  528. else if ((chtype) c == ACS_URCORNER)
  529. c = mc_tty_frm[single ? MC_TTY_FRM_RIGHTTOP : MC_TTY_FRM_DRIGHTTOP];
  530. else if ((chtype) c == ACS_LRCORNER)
  531. c = mc_tty_frm[single ? MC_TTY_FRM_RIGHTBOTTOM : MC_TTY_FRM_DRIGHTBOTTOM];
  532. else if ((chtype) c == ACS_PLUS)
  533. c = mc_tty_frm[MC_TTY_FRM_CROSS];
  534. addch (c);
  535. }
  536. mc_curs_col++;
  537. }
  538. /* --------------------------------------------------------------------------------------------- */
  539. void
  540. tty_print_string (const char *s)
  541. {
  542. int len;
  543. int start = 0;
  544. s = str_term_form (s);
  545. len = str_term_width1 (s);
  546. /* line is upper or below the screen or entire line is before or after screen */
  547. if (mc_curs_row < 0 || mc_curs_row >= LINES || mc_curs_col + len <= 0 || mc_curs_col >= COLS)
  548. {
  549. mc_curs_col += len;
  550. return;
  551. }
  552. /* skip invisible left part */
  553. if (mc_curs_col < 0)
  554. {
  555. start = -mc_curs_col;
  556. len += mc_curs_col;
  557. mc_curs_col = 0;
  558. }
  559. mc_curs_col += len;
  560. if (mc_curs_col >= COLS)
  561. len = COLS - (mc_curs_col - len);
  562. addstr (str_term_substring (s, start, len));
  563. }
  564. /* --------------------------------------------------------------------------------------------- */
  565. void
  566. tty_printf (const char *fmt, ...)
  567. {
  568. va_list args;
  569. char buf[BUF_1K]; /* FIXME: is it enough? */
  570. va_start (args, fmt);
  571. g_vsnprintf (buf, sizeof (buf), fmt, args);
  572. va_end (args);
  573. tty_print_string (buf);
  574. }
  575. /* --------------------------------------------------------------------------------------------- */
  576. char *
  577. tty_tgetstr (const char *cap)
  578. {
  579. char *unused = NULL;
  580. return tgetstr ((NCURSES_CONST char *) cap, &unused);
  581. }
  582. /* --------------------------------------------------------------------------------------------- */
  583. void
  584. tty_refresh (void)
  585. {
  586. refresh ();
  587. doupdate ();
  588. }
  589. /* --------------------------------------------------------------------------------------------- */
  590. void
  591. tty_beep (void)
  592. {
  593. beep ();
  594. }
  595. /* --------------------------------------------------------------------------------------------- */