summaryrefslogtreecommitdiff
path: root/callback.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-23 19:20:49 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-23 19:20:49 -0500
commit8e82c61d4caacfd43668bf1d2a7e23a0a21fa5bc (patch)
treed159ca5b29e675050fceebaea28437233f09396d /callback.c
parent518937ab89be812ccd45e9b8c1ce4ad721d35ef6 (diff)
downloadreadline-8e82c61d4caacfd43668bf1d2a7e23a0a21fa5bc.tar.gz
Readline-6.0 import
Diffstat (limited to 'callback.c')
-rw-r--r--callback.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/callback.c b/callback.c
index ada04d8..6c52ac0 100644
--- a/callback.c
+++ b/callback.c
@@ -1,24 +1,24 @@
/* callback.c -- functions to use readline as an X `callback' mechanism. */
-/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
- This file is part of the GNU Readline Library, a library for
- reading lines of text with interactive input and history editing.
+ This file is part of the GNU Readline Library (Readline), a library
+ for reading lines of text with interactive input and history editing.
- The GNU Readline Library is free software; you can redistribute it
- and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ Readline is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
- The GNU Readline Library is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ Readline is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- The GNU General Public License is often shipped with GNU software, and
- is generally kept in a file called COPYING or LICENSE. If you do not
- have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ You should have received a copy of the GNU General Public License
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -87,6 +87,7 @@ _rl_callback_newline ()
}
readline_internal_setup ();
+ RL_CHECK_SIGNALS ();
}
/* Install a readline handler, set up the terminal, and issue the prompt. */
@@ -111,22 +112,23 @@ rl_callback_read_char ()
if (rl_linefunc == NULL)
{
- fprintf (stderr, "readline: readline_callback_read_char() called with no handler!\r\n");
+ _rl_errmsg ("readline_callback_read_char() called with no handler!");
abort ();
}
- memcpy ((void *)olevel, (void *)readline_top_level, sizeof (procenv_t));
- jcode = setjmp (readline_top_level);
+ memcpy ((void *)olevel, (void *)_rl_top_level, sizeof (procenv_t));
+ jcode = setjmp (_rl_top_level);
if (jcode)
{
(*rl_redisplay_function) ();
_rl_want_redisplay = 0;
- memcpy ((void *)readline_top_level, (void *)olevel, sizeof (procenv_t));
+ memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
return;
}
do
{
+ RL_CHECK_SIGNALS ();
if (RL_ISSTATE (RL_STATE_ISEARCH))
{
eof = _rl_isearch_callback (_rl_iscxt);
@@ -186,6 +188,7 @@ rl_callback_read_char ()
else
eof = readline_internal_char ();
+ RL_CHECK_SIGNALS ();
if (rl_done == 0 && _rl_want_redisplay)
{
(*rl_redisplay_function) ();
@@ -223,6 +226,7 @@ rl_callback_handler_remove ()
{
rl_linefunc = NULL;
RL_UNSETSTATE (RL_STATE_CALLBACK);
+ RL_CHECK_SIGNALS ();
if (in_handler)
{
in_handler = 0;
@@ -251,8 +255,7 @@ _rl_callback_data_alloc (count)
void _rl_callback_data_dispose (arg)
_rl_callback_generic_arg *arg;
{
- if (arg)
- free (arg);
+ xfree (arg);
}
#endif