1/* terminal.c -- controlling the terminal with termcap. */
2
3/* Copyright (C) 1996 Free Software Foundation, Inc.
4
5 This file is part of the GNU Readline Library, a library for
6 reading lines of text with interactive input and history editing.
7
8 The GNU Readline Library is free software; you can redistribute it
--- 5 unchanged lines hidden (view full) ---
14 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 The GNU General Public License is often shipped with GNU software, and
19 is generally kept in a file called COPYING or LICENSE. If you do not
20 have a copy of the license, write to the Free Software Foundation,
21 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
22/* $FreeBSD: head/contrib/libreadline/terminal.c 119614 2003-08-31 18:29:38Z ache $ */
23#define READLINE_LIBRARY
24
25#if defined (HAVE_CONFIG_H)
26# include <config.h>
27#endif
28
29#include <sys/types.h>
30#include "posixstat.h"
--- 312 unchanged lines hidden (view full) ---
343static void
344get_term_capabilities (bp)
345 char **bp;
346{
347#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
348 register int i;
349
350 for (i = 0; i < NUM_TC_STRINGS; i++)
351# ifdef __LCC__
352 *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
353# else
354 *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
355# endif
356#endif
357 tcap_initialized = 1;
358}
359
360int
361_rl_init_terminal_io (terminal_name)
362 const char *terminal_name;
363{
--- 121 unchanged lines hidden (view full) ---
485bind_termcap_arrow_keys (map)
486 Keymap map;
487{
488 Keymap xkeymap;
489
490 xkeymap = _rl_keymap;
491 _rl_keymap = map;
492
493 _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
494 _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
495 _rl_bind_if_unbound (_rl_term_kr, rl_forward);
496 _rl_bind_if_unbound (_rl_term_kl, rl_backward);
497
498 _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
499 _rl_bind_if_unbound (_rl_term_at7, rl_end_of_line); /* End */
500
501 _rl_keymap = xkeymap;
502}
503
504char *
505rl_get_termcap (cap)
506 const char *cap;
507{
--- 156 unchanged lines hidden ---
2
3/* Copyright (C) 1996 Free Software Foundation, Inc.
4
5 This file is part of the GNU Readline Library, a library for
6 reading lines of text with interactive input and history editing.
7
8 The GNU Readline Library is free software; you can redistribute it
--- 5 unchanged lines hidden (view full) ---
14 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 The GNU General Public License is often shipped with GNU software, and
19 is generally kept in a file called COPYING or LICENSE. If you do not
20 have a copy of the license, write to the Free Software Foundation,
21 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
22/* $FreeBSD: head/contrib/libreadline/terminal.c 119614 2003-08-31 18:29:38Z ache $ */
23#define READLINE_LIBRARY
24
25#if defined (HAVE_CONFIG_H)
26# include <config.h>
27#endif
28
29#include <sys/types.h>
30#include "posixstat.h"
--- 312 unchanged lines hidden (view full) ---
343static void
344get_term_capabilities (bp)
345 char **bp;
346{
347#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
348 register int i;
349
350 for (i = 0; i < NUM_TC_STRINGS; i++)
351# ifdef __LCC__
352 *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
353# else
354 *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
355# endif
356#endif
357 tcap_initialized = 1;
358}
359
360int
361_rl_init_terminal_io (terminal_name)
362 const char *terminal_name;
363{
--- 121 unchanged lines hidden (view full) ---
485bind_termcap_arrow_keys (map)
486 Keymap map;
487{
488 Keymap xkeymap;
489
490 xkeymap = _rl_keymap;
491 _rl_keymap = map;
492
493 _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
494 _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
495 _rl_bind_if_unbound (_rl_term_kr, rl_forward);
496 _rl_bind_if_unbound (_rl_term_kl, rl_backward);
497
498 _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
499 _rl_bind_if_unbound (_rl_term_at7, rl_end_of_line); /* End */
500
501 _rl_keymap = xkeymap;
502}
503
504char *
505rl_get_termcap (cap)
506 const char *cap;
507{
--- 156 unchanged lines hidden ---