"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "callback.c" between
readline-7.0-rc1.tar.gz and readline-7.0-rc2.tar.gz

About: GNU Readline library - get a line from a user with editing. Release candidate.

callback.c  (readline-7.0-rc1):callback.c  (readline-7.0-rc2)
skipping to change at line 53 skipping to change at line 53
#include "rldefs.h" #include "rldefs.h"
#include "readline.h" #include "readline.h"
#include "rlprivate.h" #include "rlprivate.h"
#include "xmalloc.h" #include "xmalloc.h"
/* Private data for callback registration functions. See comments in /* Private data for callback registration functions. See comments in
rl_callback_read_char for more details. */ rl_callback_read_char for more details. */
_rl_callback_func_t *_rl_callback_func = 0; _rl_callback_func_t *_rl_callback_func = 0;
_rl_callback_generic_arg *_rl_callback_data = 0; _rl_callback_generic_arg *_rl_callback_data = 0;
/* Applications can set this to non-zero to have readline's signal handlers
installed during the entire duration of reading a complete line, as in
readline-6.2. This should be used with care, because it can result in
readline receiving signals and not handling them until it's called again
via rl_callback_read_char, thereby stealing them from the application.
By default, signal handlers are only active while readline is active. */
int rl_persistent_signal_handlers = 0;
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
/* Callback Readline Functions */ /* Callback Readline Functions */
/* */ /* */
/* **************************************************************** */ /* **************************************************************** */
/* Allow using readline in situations where a program may have multiple /* Allow using readline in situations where a program may have multiple
things to handle at once, and dispatches them via select(). Call things to handle at once, and dispatches them via select(). Call
rl_callback_handler_install() with the prompt and a function to call rl_callback_handler_install() with the prompt and a function to call
whenever a complete line of input is ready. The user must then whenever a complete line of input is ready. The user must then
skipping to change at line 85 skipping to change at line 93
_rl_callback_newline () _rl_callback_newline ()
{ {
rl_initialize (); rl_initialize ();
if (in_handler == 0) if (in_handler == 0)
{ {
in_handler = 1; in_handler = 1;
if (rl_prep_term_function) if (rl_prep_term_function)
(*rl_prep_term_function) (_rl_meta_flag); (*rl_prep_term_function) (_rl_meta_flag);
#if defined (HANDLE_SIGNALS)
if (rl_persistent_signal_handlers)
rl_set_signals ();
#endif
} }
readline_internal_setup (); readline_internal_setup ();
RL_CHECK_SIGNALS (); RL_CHECK_SIGNALS ();
} }
/* Install a readline handler, set up the terminal, and issue the prompt. */ /* Install a readline handler, set up the terminal, and issue the prompt. */
void void
rl_callback_handler_install (prompt, linefunc) rl_callback_handler_install (prompt, linefunc)
const char *prompt; const char *prompt;
skipping to change at line 106 skipping to change at line 119
{ {
rl_set_prompt (prompt); rl_set_prompt (prompt);
RL_SETSTATE (RL_STATE_CALLBACK); RL_SETSTATE (RL_STATE_CALLBACK);
rl_linefunc = linefunc; rl_linefunc = linefunc;
_rl_callback_newline (); _rl_callback_newline ();
} }
#if defined (HANDLE_SIGNALS) #if defined (HANDLE_SIGNALS)
#define CALLBACK_READ_RETURN() \ #define CALLBACK_READ_RETURN() \
do { \ do { \
rl_clear_signals (); \ if (rl_persistent_signal_handlers == 0) \
rl_clear_signals (); \
return; \ return; \
} while (0) } while (0)
#else #else
#define CALLBACK_READ_RETURN() return #define CALLBACK_READ_RETURN() return
#endif #endif
/* Read one character, and dispatch to the handler if it ends the line. */ /* Read one character, and dispatch to the handler if it ends the line. */
void void
rl_callback_read_char () rl_callback_read_char ()
{ {
skipping to change at line 143 skipping to change at line 157
if (jcode) if (jcode)
{ {
(*rl_redisplay_function) (); (*rl_redisplay_function) ();
_rl_want_redisplay = 0; _rl_want_redisplay = 0;
memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t)); memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
CALLBACK_READ_RETURN (); CALLBACK_READ_RETURN ();
} }
#if defined (HANDLE_SIGNALS) #if defined (HANDLE_SIGNALS)
/* Install signal handlers only when readline has control. */ /* Install signal handlers only when readline has control. */
rl_set_signals (); if (rl_persistent_signal_handlers == 0)
rl_set_signals ();
#endif #endif
do do
{ {
RL_CHECK_SIGNALS (); RL_CHECK_SIGNALS ();
if (RL_ISSTATE (RL_STATE_ISEARCH)) if (RL_ISSTATE (RL_STATE_ISEARCH))
{ {
eof = _rl_isearch_callback (_rl_iscxt); eof = _rl_isearch_callback (_rl_iscxt);
if (eof == 0 && (RL_ISSTATE (RL_STATE_ISEARCH) == 0) && RL_ISSTATE (RL_ STATE_INPUTPENDING)) if (eof == 0 && (RL_ISSTATE (RL_STATE_ISEARCH) == 0) && RL_ISSTATE (RL_ STATE_INPUTPENDING))
rl_callback_read_char (); rl_callback_read_char ();
 End of changes. 4 change blocks. 
2 lines changed or deleted 17 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS