Back to index

tetex-bin  3.0
Defines | Functions | Variables
session.c File Reference
#include "info.h"
#include "search.h"
#include <sys/ioctl.h>
#include "man.h"

Go to the source code of this file.

Defines

#define DEBUG_FORGET_WINDOW_AND_NODES
#define alphabetic(c)   (islower (c) || isupper (c) || isdigit (c))
#define INFO_LABEL_FOUND()
#define GOTO_COMPLETES
#define VERBOSE_NODE_DUMPING
#define DEFAULT_INFO_PRINT_COMMAND   "lpr"
#define MAX_INFO_INPUT_BUFFERING   512

Functions

static void info_clear_pending_input (void)
static void info_set_pending_input (unsigned char key)
static void info_handle_pointer (char *label, WINDOW *window)
static void display_info_keyseq (int expecting_future_input)
char * node_printed_rep (NODE *node)
void remember_window_and_node (WINDOW *window, NODE *node)
void forget_window_and_nodes (WINDOW *window)
void display_startup_message_and_start (void)
void begin_multiple_window_info_session (char *filename, char **nodenames)
void begin_info_session_with_error (NODE *initial_node, char *format, void *arg1, void *arg2)
void begin_info_session (NODE *initial_node)
void info_session (void)
void info_read_and_dispatch (void)
void initialize_info_signal_handler (void)
void initialize_info_session (NODE *node, int clear_screen)
void info_set_input_from_file (char *filename)
static INFO_WINDOWget_info_window_of_window (WINDOW *window)
void set_remembered_pagetop_and_point (WINDOW *window)
static void consistency_check_info_windows (void)
void info_set_node_of_window (int remember, WINDOW *window, NODE *node)
void set_window_pagetop (WINDOW *window, int desired_top)
static void info_show_point (WINDOW *window)
static void move_to_new_line (int old, int new, WINDOW *window)
static void forward_move_node_structure (WINDOW *window, int behaviour)
static void backward_move_node_structure (WINDOW *window, int behaviour)
 DECLARE_INFO_COMMAND (info_global_next_node, _("Move forwards or down through node structure"))
 DECLARE_INFO_COMMAND (info_global_prev_node, _("Move backwards or up through node structure"))
static void _scroll_forward (WINDOW *window, int count, unsigned char key, int behaviour)
static void _scroll_backward (WINDOW *window, int count, unsigned char key, int behaviour)
 DECLARE_INFO_COMMAND (info_tile_windows, _("Divide the available screen space among the visible windows"))
 DECLARE_INFO_COMMAND (info_toggle_wrap, _("Toggle the state of line wrapping in the current window"))
void info_select_reference (WINDOW *window, REFERENCE *entry)
static void info_parse_and_select (char *line, WINDOW *window)
static void dump_node_to_stream (char *filename, char *nodename, FILE *stream, int dump_subnodes)
static void initialize_dumping (void)
void dump_nodes_to_file (char *filename, char **nodenames, char *output_filename, int dump_subnodes)
void dump_node_to_file (NODE *node, char *filename, int dump_subnodes)
 DECLARE_INFO_COMMAND (info_print_node, _("Pipe the contents of this node through INFO_PRINT_COMMAND"))
void print_node (NODE *node)
static void write_node_to_stream (NODE *node, FILE *stream)
static void info_gc_file_buffers (void)
static void info_search_1 (WINDOW *window, int count, unsigned char key, int case_sensitive, int ask_for_string)
FILE_BUFFERfile_buffer_of_window (WINDOW *window)
long info_search_in_node (char *string, NODE *node, long int start, WINDOW *window, int dir, int case_sensitive)
long info_target_search_node (NODE *node, char *string, long int start)
static int info_search_internal (char *string, WINDOW *window, int dir, int case_sensitive)
 DECLARE_INFO_COMMAND (info_search_case_sensitively, _("Read a string and search for it case-sensitively"))
 DECLARE_INFO_COMMAND (isearch_forward, _("Search interactively for a string as you type it"))
 DECLARE_INFO_COMMAND (isearch_backward, _("Search interactively for a string as you type it"))
static void push_isearch (WINDOW *window, int search_index, int direction, int failing)
static void pop_isearch (WINDOW *window, int *search_index, int *direction, int *failing)
static void free_isearch_states (void)
static void show_isearch_prompt (int dir, unsigned char *string, int failing_p)
static void incremental_search (WINDOW *window, int count, unsigned char ignore)
static void info_move_to_xref (WINDOW *window, int count, unsigned char key, int dir)
 DECLARE_INFO_COMMAND (info_move_to_prev_xref, _("Move to the previous cross reference"))
 DECLARE_INFO_COMMAND (info_move_to_next_xref, _("Move to the next cross reference"))
 DECLARE_INFO_COMMAND (info_select_reference_this_line, _("Select reference or menu item appearing on this line"))
void initialize_keyseq (void)
void add_char_to_keyseq (char character)
unsigned char info_get_another_input_char (void)
void info_dispatch_on_key (unsigned char key, Keymap map)
 DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg, _("Add this digit to the current numeric argument"))
 DECLARE_INFO_COMMAND (info_universal_argument, _("Start (or multiply by 4) the current numeric argument"))
void info_initialize_numeric_arg (void)
 DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop, _("Internally used by \\[universal-argument]"))
unsigned char info_input_pending_p (void)
static void info_push_typeahead (unsigned char key)
static int info_input_buffer_space_available (void)
static int info_get_key_from_typeahead (unsigned char *key)
int info_any_buffered_input_p (void)
void info_gather_typeahead (void)
unsigned char info_get_input_char (void)

Variables

static FILEinfo_input_stream = NULL
VFunctioninfo_last_executed_command = NULL
int quit_info_immediately = 0
INFO_WINDOW ** info_windows = NULL
static int info_windows_index = 0
static int info_windows_slots = 0
char * info_scroll_choices []
int default_window_size = -1
int default_scroll_size = -1
static char ** dumped_already = (char **)NULL
static int dumped_already_index = 0
static int dumped_already_slots = 0
int gc_compressed_files = 0
static char * search_string = (char *)NULL
static int search_string_size = 0
static int isearch_is_active = 0
static int last_search_direction = 0
static int last_search_case_sensitive = 0
static char * last_isearch_accepted = (char *)NULL
static char * isearch_string = (char *)NULL
static int isearch_string_index = 0
static int isearch_string_size = 0
static unsigned char isearch_terminate_search_key = ESC
static SEARCH_STATE ** isearch_states = (SEARCH_STATE **)NULL
static int isearch_states_index = 0
static int isearch_states_slots = 0
static int info_keyseq_index = 0
static int info_keyseq_size = 0
static int info_keyseq_displayed_p = 0
int info_explicit_arg = 0
int info_numeric_arg_sign = 1
int info_numeric_arg = 1
static int pending_input_character = 0
static int pop_index = 0
static int push_index = 0
static unsigned char info_input_buffer [MAX_INFO_INPUT_BUFFERING]

Define Documentation

#define alphabetic (   c)    (islower (c) || isupper (c) || isdigit (c))

Definition at line 414 of file session.c.

#define DEFAULT_INFO_PRINT_COMMAND   "lpr"

Definition at line 3292 of file session.c.

#define GOTO_COMPLETES
#define INFO_LABEL_FOUND ( )
Value:

Definition at line 843 of file session.c.

#define MAX_INFO_INPUT_BUFFERING   512

Definition at line 4839 of file session.c.


Function Documentation

static void _scroll_backward ( WINDOW window,
int  count,
unsigned char  key,
int  behaviour 
) [static]

Definition at line 1171 of file session.c.

{
  if (count < 0)
    _scroll_forward (window, -count, key, behaviour);
  else
    {
      int desired_top;

      /* Without an explicit numeric argument, scroll the top two lines
         to the bottom of this window, or, depending on the selected
        behaviour, move to the previous, or Up'th node. */
      if (default_window_size > 0)
        desired_top = window->pagetop - default_window_size;
      else if (!info_explicit_arg && count == 1)
        {
          desired_top = window->pagetop - (window->height - 2);

          if ((desired_top < 0) && (window->pagetop == 0))
            {
              backward_move_node_structure (window, behaviour);
              return;
            }
        }
      else
        desired_top = window->pagetop - count;

      if (desired_top < 0)
        desired_top = 0;

      set_window_pagetop (window, desired_top);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void _scroll_forward ( WINDOW window,
int  count,
unsigned char  key,
int  behaviour 
) [static]

Definition at line 1131 of file session.c.

{
  if (count < 0)
    _scroll_backward (window, -count, key, behaviour);
  else
    {
      int desired_top;

      /* Without an explicit numeric argument, scroll the bottom two
         lines to the top of this window,  Or, if at bottom of window,
         and the chosen behaviour is to scroll through nodes get the
        "Next" node for this window. */
      if (default_window_size > 0)
        desired_top = window->pagetop + default_window_size;
      else if (!info_explicit_arg && count == 1)
        {
          desired_top = window->pagetop + (window->height - 2);

          /* If there are no more lines to scroll here, error, or get
             another node, depending on BEHAVIOUR. */
          if (desired_top > window->line_count)
            {
              forward_move_node_structure (window, behaviour);
              return;
            }
        }
      else
        desired_top = window->pagetop + count;

      if (desired_top >= window->line_count)
        desired_top = window->line_count - 2;

      if (window->pagetop > desired_top)
        return;
      else
        set_window_pagetop (window, desired_top);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void add_char_to_keyseq ( char  character)

Definition at line 4518 of file session.c.

{
  if (info_keyseq_index + 2 >= info_keyseq_size)
    info_keyseq = (char *)xrealloc (info_keyseq, info_keyseq_size += 10);

  info_keyseq[info_keyseq_index++] = character;
  info_keyseq[info_keyseq_index] = '\0';
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void backward_move_node_structure ( WINDOW window,
int  behaviour 
) [static]

Definition at line 1000 of file session.c.

{
  switch (behaviour)
    {
    case IS_PageOnly:
      info_error ((char *) msg_at_node_top, NULL, NULL);
      break;

    case IS_NextOnly:
      info_prev_label_of_node (window->node);
      if (!info_parsed_nodename && !info_parsed_filename)
        info_error ((char *) _("No `Prev' for this node."), NULL, NULL);
      else
        {
          window_message_in_echo_area ((char *) _("Moving Prev in this window."),
              NULL, NULL);
          info_handle_pointer ("Prev", window);
        }
      break;

    case IS_Continuous:
      info_prev_label_of_node (window->node);

      if (!info_parsed_nodename && (!info_parsed_filename
                                    || is_dir_name (info_parsed_filename)))
        {
          info_up_label_of_node (window->node);
          if (!info_parsed_nodename && (!info_parsed_filename
                                        || is_dir_name (info_parsed_filename)))
            info_error ((char *)
                _("No `Prev' or `Up' for this node within this document."),
                NULL, NULL);
          else
            {
              window_message_in_echo_area ((char *) _("Moving Up in this window."),
                  NULL, NULL);
              info_handle_pointer ("Up", window);
            }
        }
      else
        {
          REFERENCE **menu;
          int inhibit_menu_traversing = 0;

          /* Watch out!  If this node's Prev is the same as the Up, then
             move Up.  Otherwise, we could move Prev, and then to the last
             menu item in the Prev.  This would cause the user to loop
             through a subsection of the info file. */
          if (!info_parsed_filename && info_parsed_nodename)
            {
              char *pnode;

              pnode = xstrdup (info_parsed_nodename);
              info_up_label_of_node (window->node);

              if (!info_parsed_filename && info_parsed_nodename &&
                  strcmp (info_parsed_nodename, pnode) == 0)
                {
                  /* The nodes are the same.  Inhibit moving to the last
                     menu item. */
                  free (pnode);
                  inhibit_menu_traversing = 1;
                }
              else
                {
                  free (pnode);
                  info_prev_label_of_node (window->node);
                }
            }

          /* Move to the previous node.  If this node now contains a menu,
             and we have not inhibited movement to it, move to the node
             corresponding to the last menu item. */
          window_message_in_echo_area ((char *) _("Moving Prev in this window."),
              NULL, NULL);
          info_handle_pointer ("Prev", window);

          if (!inhibit_menu_traversing)
            {
              while (!info_error_was_printed &&
                     (menu = info_menu_of_node (window->node)))
                {
                  info_free_references (menu);
                  window_message_in_echo_area
                    ((char *) _("Moving to `Prev's last menu item."), NULL, NULL);
                  info_menu_digit (window, 1, '0');
                }
            }
        }
      break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void begin_info_session ( NODE initial_node)

Definition at line 150 of file session.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void begin_info_session_with_error ( NODE initial_node,
char *  format,
void arg1,
void arg2 
)

Definition at line 140 of file session.c.

{
  initialize_info_session (initial_node, 1);
  info_error (format, arg1, arg2);
  info_session ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void begin_multiple_window_info_session ( char *  filename,
char **  nodenames 
)

Definition at line 75 of file session.c.

{
  register int i;
  WINDOW *window = (WINDOW *)NULL;

  for (i = 0; nodenames[i]; i++)
    {
      NODE *node;

      node = info_get_node (filename, nodenames[i]);

      if (!node)
        break;

      /* If this is the first node, initialize the info session. */
      if (!window)
        {
          initialize_info_session (node, 1);
          window = active_window;
        }
      else
        {
          /* Find the largest window in WINDOWS, and make that be the active
             one.  Then split it and add our window and node to the list
             of remembered windows and nodes.  Then tile the windows. */
          WINDOW *win, *largest = NULL;
          int max_height = 0;

          for (win = windows; win; win = win->next)
            if (win->height > max_height)
              {
                max_height = win->height;
                largest = win;
              }

          if (!largest)
            {
              display_update_display (windows);
              info_error ((char *) msg_cant_find_window, NULL, NULL);
              info_session ();
              xexit (0);
            }

          active_window = largest;
          window = window_make_window (node);
          if (window)
            {
              window_tile_windows (TILE_INTERNALS);
              remember_window_and_node (window, node);
            }
          else
            {
              display_update_display (windows);
              info_error ((char *) msg_win_too_small, NULL, NULL);
              info_session ();
              xexit (0);
            }
        }
    }
  display_startup_message_and_start ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void consistency_check_info_windows ( void  ) [static]

Definition at line 417 of file session.c.

{
  register int i;

  for (i = 0; i < info_windows_index; i++)
    {
      WINDOW *win;

      for (win = windows; win; win = win->next)
        if (win == info_windows[i]->window)
          break;

      if (!win)
        abort ();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

DECLARE_INFO_COMMAND ( info_global_next_node  ,
_("Move forwards or down through node structure")   
)

Definition at line 1094 of file session.c.

{
  if (count < 0)
    info_global_prev_node (window, -count, key);
  else
    {
      while (count && !info_error_was_printed)
        {
          forward_move_node_structure (window, IS_Continuous);
          count--;
        }
    }
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_global_prev_node  ,
_("Move backwards or up through node structure")   
)

Definition at line 1110 of file session.c.

{
  if (count < 0)
    info_global_next_node (window, -count, key);
  else
    {
      while (count && !info_error_was_printed)
        {
          backward_move_node_structure (window, IS_Continuous);
          count--;
        }
    }
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_tile_windows  ,
_("Divide the available screen space among the visible windows")   
)

Definition at line 1668 of file session.c.

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_toggle_wrap  ,
_("Toggle the state of line wrapping in the current window")   
)

Definition at line 1675 of file session.c.

{
  window_toggle_wrap (window);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_print_node  ,
_("Pipe the contents of this node through INFO_PRINT_COMMAND")   
)

Definition at line 3295 of file session.c.

{
  print_node (window->node);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_search_case_sensitively  ,
_("Read a string and search for it case-sensitively")   
)

Definition at line 3618 of file session.c.

{
  last_search_direction = count > 0 ? 1 : -1;
  last_search_case_sensitive = 1;
  info_search_1 (window, count, key, 1, 1);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( isearch_forward  ,
_("Search interactively for a string as you type it")   
)

Definition at line 3764 of file session.c.

{
  incremental_search (window, count, key);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( isearch_backward  ,
_("Search interactively for a string as you type it")   
)

Definition at line 3770 of file session.c.

{
  incremental_search (window, -count, key);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_move_to_prev_xref  ,
_("Move to the previous cross reference")   
)

Definition at line 4339 of file session.c.

{
  if (count < 0)
    info_move_to_prev_xref (window, -count, key);
  else
    info_move_to_xref (window, count, key, -1);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_move_to_next_xref  ,
_("Move to the next cross reference")   
)

Definition at line 4348 of file session.c.

{
  if (count < 0)
    info_move_to_next_xref (window, -count, key);
  else
    info_move_to_xref (window, count, key, 1);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_select_reference_this_line  ,
_("Select reference or menu item appearing on this line")   
)

Definition at line 4358 of file session.c.

{
  char *line;

  if (window->line_starts)
    line = window->line_starts[window_line_of_point (window)];
  else
    line = "";

  /* If this line contains a menu item, select that one. */
  if (strncmp ("* ", line, 2) == 0)
    info_menu_or_ref_item (window, count, key, info_menu_of_node, 0);
  else
    info_menu_or_ref_item (window, count, key, info_xrefs_of_node, 0);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_add_digit_to_numeric_arg  ,
_("Add this digit to the current numeric argument")   
)

Definition at line 4708 of file session.c.

{
  info_numeric_arg_digit_loop (window, 0, key);
}

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_universal_argument  ,
_("Start (or multiply by 4) the current numeric argument")   
)

Definition at line 4717 of file session.c.

Here is the call graph for this function:

DECLARE_INFO_COMMAND ( info_numeric_arg_digit_loop  ,
_("Internally used by \\[universal-argument]")   
)

Definition at line 4732 of file session.c.

{
  unsigned char pure_key;
  Keymap keymap = window->keymap;

  while (1)
    {
      if (key)
        pure_key = key;
      else
        {
          if (display_was_interrupted_p && !info_any_buffered_input_p ())
            display_update_display (windows);

          if (active_window != the_echo_area)
            display_cursor_at_point (active_window);

          pure_key = key = info_get_another_input_char ();

#if !defined(INFOKEY)
          if (Meta_p (key))
            add_char_to_keyseq (ESC);

          add_char_to_keyseq (UnMeta (key));
#else /* defined(INFOKEY) */
          add_char_to_keyseq (key);
#endif /* defined(INFOKEY) */
        }

#if !defined(INFOKEY)
      if (Meta_p (key))
        key = UnMeta (key);
#endif /* !defined(INFOKEY) */

      if (keymap[key].type == ISFUNC
          && InfoFunction(keymap[key].function)
              == (VFunction *) info_universal_argument)
        {
          info_numeric_arg *= 4;
          key = 0;
          continue;
        }

#if defined(INFOKEY)
      if (Meta_p (key))
        key = UnMeta (key);
#endif /* !defined(INFOKEY) */


      if (isdigit (key))
        {
          if (info_explicit_arg)
            info_numeric_arg = (info_numeric_arg * 10) + (key - '0');
          else
            info_numeric_arg = (key - '0');
          info_explicit_arg = 1;
        }
      else
        {
          if (key == '-' && !info_explicit_arg)
            {
              info_numeric_arg_sign = -1;
              info_numeric_arg = 1;
            }
          else
            {
              info_keyseq_index--;
              info_dispatch_on_key (pure_key, keymap);
              return;
            }
        }
      key = 0;
    }
}

Here is the call graph for this function:

static void display_info_keyseq ( int  expecting_future_input) [static]

Definition at line 4531 of file session.c.

{
  char *rep;

  rep = pretty_keyseq (info_keyseq);
  if (expecting_future_input)
    strcat (rep, "-");

  if (echo_area_is_active)
    inform_in_echo_area (rep);
  else
    {
      window_message_in_echo_area (rep, NULL, NULL);
      display_cursor_at_point (active_window);
    }
  info_keyseq_displayed_p = 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 157 of file session.c.

{
  char *format;

  format = replace_in_documentation
    ((char *) _("Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] for menu item."),
     0);

  window_message_in_echo_area (format, VERSION, NULL);
  info_session ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_node_to_file ( NODE node,
char *  filename,
int  dump_subnodes 
)

Definition at line 3255 of file session.c.

{
  FILE *output_stream;
  char *nodes_filename;

  /* Get the stream to print this node to.  Special case of an output
     filename of "-" means to dump the nodes to stdout. */
  if (strcmp (filename, "-") == 0)
    output_stream = stdout;
  else
    output_stream = fopen (filename, "w");

  if (!output_stream)
    {
      info_error ((char *) _("Could not create output file `%s'."), filename,
          NULL);
      return;
    }

  if (node->parent)
    nodes_filename = node->parent;
  else
    nodes_filename = node->filename;

  initialize_dumping ();
  dump_node_to_stream
    (nodes_filename, node->nodename, output_stream, dump_subnodes);

  if (output_stream != stdout)
    fclose (output_stream);

#if defined (VERBOSE_NODE_DUMPING)
  info_error ((char *) _("Done."), NULL, NULL);
#endif /* VERBOSE_NODE_DUMPING */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void dump_node_to_stream ( char *  filename,
char *  nodename,
FILE stream,
int  dump_subnodes 
) [static]

Definition at line 3184 of file session.c.

{
  register int i;
  NODE *node;

  node = info_get_node (filename, nodename);

  if (!node)
    {
      if (info_recent_file_error)
        info_error (info_recent_file_error, NULL, NULL);
      else
        {
          if (filename && *nodename != '(')
            info_error ((char *) msg_cant_file_node,
                filename_non_directory (filename),
                nodename);
          else
            info_error ((char *) msg_cant_find_node, nodename, NULL);
        }
      return;
    }

  /* If we have already dumped this node, don't dump it again. */
  for (i = 0; i < dumped_already_index; i++)
    if (strcmp (node->nodename, dumped_already[i]) == 0)
      {
        free (node);
        return;
      }
  add_pointer_to_array (node->nodename, dumped_already_index, dumped_already,
                        dumped_already_slots, 50, char *);

#if defined (VERBOSE_NODE_DUMPING)
  /* Maybe we should print some information about the node being output. */
  info_error ((char *) _("Writing node %s..."), node_printed_rep (node), NULL);
#endif /* VERBOSE_NODE_DUMPING */

  write_node_to_stream (node, stream);

  /* If we are dumping subnodes, get the list of menu items in this node,
     and dump each one recursively. */
  if (dump_subnodes)
    {
      REFERENCE **menu = (REFERENCE **)NULL;

      /* If this node is an Index, do not dump the menu references. */
      if (string_in_line ("Index", node->nodename) == -1)
        menu = info_menu_of_node (node);

      if (menu)
        {
          for (i = 0; menu[i]; i++)
            {
              /* We don't dump Info files which are different than the
                 current one. */
              if (!menu[i]->filename)
                dump_node_to_stream
                  (filename, menu[i]->nodename, stream, dump_subnodes);
            }
          info_free_references (menu);
        }
    }

  free (node);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_nodes_to_file ( char *  filename,
char **  nodenames,
char *  output_filename,
int  dump_subnodes 
)

Definition at line 3136 of file session.c.

{
  register int i;
  FILE *output_stream;

  /* Get the stream to print the nodes to.  Special case of an output
     filename of "-" means to dump the nodes to stdout. */
  if (strcmp (output_filename, "-") == 0)
    output_stream = stdout;
  else
    output_stream = fopen (output_filename, "w");

  if (!output_stream)
    {
      info_error ((char *) _("Could not create output file `%s'."),
          output_filename, NULL);
      return;
    }

  /* Print each node to stream. */
  initialize_dumping ();
  for (i = 0; nodenames[i]; i++)
    dump_node_to_stream (filename, nodenames[i], output_stream, dump_subnodes);

  if (output_stream != stdout)
    fclose (output_stream);

#if defined (VERBOSE_NODE_DUMPING)
  info_error ((char *) _("Done."), NULL, NULL);
#endif /* VERBOSE_NODE_DUMPING */
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3382 of file session.c.

{
  /* If this window has no node, then it has no file buffer. */
  if (!window->node)
    return ((FILE_BUFFER *)NULL);

  if (window->node->parent)
    return (info_find_file (window->node->parent));

  if (window->node->filename)
    return (info_find_file (window->node->filename));

  return ((FILE_BUFFER *)NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 437 of file session.c.

{
  register int i;
  INFO_WINDOW *info_win = (INFO_WINDOW *)NULL;

  for (i = 0; info_windows && (info_win = info_windows[i]); i++)
    if (info_win->window == window)
      break;

  /* If we found the window to forget, then do so. */
  if (info_win)
    {
      while (i < info_windows_index)
        {
          info_windows[i] = info_windows[i + 1];
          i++;
        }

      info_windows_index--;
      info_windows[info_windows_index] = (INFO_WINDOW *)NULL;

      if (info_win->nodes)
        {
          /* Free the node structures which held onto internal node contents
             here.  This doesn't free the contents; we have a garbage collector
             which does that. */
          for (i = 0; info_win->nodes[i]; i++)
            if (internal_info_node_p (info_win->nodes[i]))
              free (info_win->nodes[i]);
          free (info_win->nodes);

          maybe_free (info_win->pagetops);
          maybe_free (info_win->points);
        }

      free (info_win);
    }
#if defined (DEBUG_FORGET_WINDOW_AND_NODES)
  consistency_check_info_windows ();
#endif /* DEBUG_FORGET_WINDOW_AND_NODES */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void forward_move_node_structure ( WINDOW window,
int  behaviour 
) [static]

Definition at line 849 of file session.c.

{
  switch (behaviour)
    {
    case IS_PageOnly:
      info_error ((char *) msg_at_node_bottom, NULL, NULL);
      break;

    case IS_NextOnly:
      info_next_label_of_node (window->node);
      if (!info_parsed_nodename && !info_parsed_filename)
        info_error ((char *) msg_no_pointer, (char *) _("Next"), NULL);
      else
        {
          window_message_in_echo_area ((char *) _("Following Next node..."),
              NULL, NULL);
          info_handle_pointer ("Next", window);
        }
      break;

    case IS_Continuous:
      {
        /* First things first.  If this node contains a menu, move down
           into the menu. */
        {
          REFERENCE **menu;

          menu = info_menu_of_node (window->node);

          if (menu)
            {
              info_free_references (menu);
              window_message_in_echo_area ((char *) _("Selecting first menu item..."),
                  NULL, NULL);
              info_menu_digit (window, 1, '1');
              return;
            }
        }

        /* Okay, this node does not contain a menu.  If it contains a
           "Next:" pointer, use that. */
        info_next_label_of_node (window->node);
        if (INFO_LABEL_FOUND ())
          {
            window_message_in_echo_area ((char *) _("Selecting Next node..."),
                NULL, NULL);
            info_handle_pointer ("Next", window);
            return;
          }

        /* Okay, there wasn't a "Next:" for this node.  Move "Up:" until we
           can move "Next:".  If that isn't possible, complain that there
           are no more nodes. */
        {
          int up_counter, old_current;
          INFO_WINDOW *info_win;

          /* Remember the current node and location. */
          info_win = get_info_window_of_window (window);
          old_current = info_win->current;

          /* Back up through the "Up:" pointers until we have found a "Next:"
             that isn't the same as the first menu item found in that node. */
          up_counter = 0;
          while (!info_error_was_printed)
            {
              info_up_label_of_node (window->node);
              if (INFO_LABEL_FOUND ())
                {
                  info_handle_pointer ("Up", window);
                  if (info_error_was_printed)
                    continue;

                  up_counter++;

                  info_next_label_of_node (window->node);

                  /* If no "Next" pointer, keep backing up. */
                  if (!INFO_LABEL_FOUND ())
                    continue;

                  /* If this node's first menu item is the same as this node's
                     Next pointer, keep backing up. */
                  if (!info_parsed_filename)
                    {
                      REFERENCE **menu;
                      char *next_nodename;

                      /* Remember the name of the Next node, since reading
                         the menu can overwrite the contents of the
                         info_parsed_xxx strings. */
                      next_nodename = xstrdup (info_parsed_nodename);

                      menu = info_menu_of_node (window->node);
                      if (menu &&
                          (strcmp
                           (menu[0]->nodename, next_nodename) == 0))
                        {
                          info_free_references (menu);
                          free (next_nodename);
                          continue;
                        }
                      else
                        {
                          /* Restore the world to where it was before
                             reading the menu contents. */
                          info_free_references (menu);
                          free (next_nodename);
                          info_next_label_of_node (window->node);
                        }
                    }

                  /* This node has a "Next" pointer, and it is not the
                     same as the first menu item found in this node. */
                  window_message_in_echo_area
                    ((char *) _("Moving Up %d time(s), then Next."),
                     (void *) (long) up_counter, NULL);

                  info_handle_pointer ("Next", window);
                  return;
                }
              else
                {
                  /* No more "Up" pointers.  Print an error, and call it
                     quits. */
                  register int i;

                  for (i = 0; i < up_counter; i++)
                    {
                      info_win->nodes_index--;
                      free (info_win->nodes[info_win->nodes_index]);
                      info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
                    }
                  info_win->current = old_current;
                  window->node = info_win->nodes[old_current];
                  window->pagetop = info_win->pagetops[old_current];
                  window->point = info_win->points[old_current];
                  recalculate_line_starts (window);
                  window->flags |= W_UpdateWindow;
                  info_error ((char *) _("No more nodes within this document."),
                      NULL, NULL);
                }
            }
        }
        break;
      }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void free_isearch_states ( void  ) [static]

Definition at line 3829 of file session.c.

{
  register int i;

  for (i = 0; i < isearch_states_index; i++)
    {
      free (isearch_states[i]);
      isearch_states[i] = (SEARCH_STATE *)NULL;
    }
  isearch_states_index = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static INFO_WINDOW* get_info_window_of_window ( WINDOW window) [static]

Definition at line 324 of file session.c.

{
  register int i;
  INFO_WINDOW *info_win = (INFO_WINDOW *)NULL;

  for (i = 0; info_windows && (info_win = info_windows[i]); i++)
    if (info_win->window == window)
      break;

  return (info_win);
}

Here is the caller graph for this function:

static void incremental_search ( WINDOW window,
int  count,
unsigned char  ignore 
) [static]

Definition at line 3890 of file session.c.

{
  unsigned char key;
  int last_search_result, search_result, dir;
  SEARCH_STATE mystate, orig_state;
  char *p;
  int case_sensitive = 0;

  if (count < 0)
    dir = -1;
  else
    dir = 1;

  last_search_result = search_result = 0;

  window_get_state (window, &orig_state);

  isearch_string_index = 0;
  if (!isearch_string_size)
    isearch_string = (char *)xmalloc (isearch_string_size = 50);

  /* Show the search string in the echo area. */
  isearch_string[isearch_string_index] = '\0';
  show_isearch_prompt (dir, (unsigned char *) isearch_string, search_result);

  isearch_is_active = 1;

  while (isearch_is_active)
    {
      VFunction *func = (VFunction *)NULL;
      int quoted = 0;

      /* If a recent display was interrupted, then do the redisplay now if
         it is convenient. */
      if (!info_any_buffered_input_p () && display_was_interrupted_p)
        {
          display_update_one_window (window);
          display_cursor_at_point (active_window);
        }

      /* Read a character and dispatch on it. */
      key = info_get_input_char ();
      window_get_state (window, &mystate);

      if (key == DEL || key == Control ('h'))
        {
          /* User wants to delete one level of search? */
          if (!isearch_states_index)
            {
              terminal_ring_bell ();
              continue;
            }
          else
            {
              pop_isearch
                (window, &isearch_string_index, &dir, &search_result);
              isearch_string[isearch_string_index] = '\0';
              show_isearch_prompt (dir, (unsigned char *) isearch_string,
                  search_result);
              goto after_search;
            }
        }
      else if (key == Control ('q'))
        {
          key = info_get_input_char ();
          quoted = 1;
        }

      /* We are about to search again, or quit.  Save the current search. */
      push_isearch (window, isearch_string_index, dir, search_result);

      if (quoted)
        goto insert_and_search;

      if (!Meta_p (key) || key > 32)
        {
          /* If this key is not a keymap, get its associated function,
             if any.  If it is a keymap, then it's probably ESC from an
             arrow key, and we handle that case below.  */
          char type = window->keymap[key].type;
          func = type == ISFUNC
                 ? InfoFunction(window->keymap[key].function)
                 : NULL;  /* function member is a Keymap if ISKMAP */

          if (isprint (key) || (type == ISFUNC && func == NULL))
            {
            insert_and_search:

              if (isearch_string_index + 2 >= isearch_string_size)
                isearch_string = (char *)xrealloc
                  (isearch_string, isearch_string_size += 100);

              isearch_string[isearch_string_index++] = key;
              isearch_string[isearch_string_index] = '\0';
              goto search_now;
            }
          else if (func == (VFunction *) isearch_forward
              || func == (VFunction *) isearch_backward)
            {
             /* If this key invokes an incremental search, then this
               means that we will either search again in the same
               direction, search again in the reverse direction, or
               insert the last search string that was accepted through
               incremental searching. */
              if ((func == (VFunction *) isearch_forward && dir > 0) ||
                  (func == (VFunction *) isearch_backward && dir < 0))
                {
                  /* If the user has typed no characters, then insert the
                     last successful search into the current search string. */
                  if (isearch_string_index == 0)
                    {
                      /* Of course, there must be something to insert. */
                      if (last_isearch_accepted)
                        {
                          if (strlen ((char *) last_isearch_accepted) + 1
                              >= (unsigned int) isearch_string_size)
                            isearch_string = (char *)
                              xrealloc (isearch_string,
                                        isearch_string_size += 10 +
                                        strlen (last_isearch_accepted));
                          strcpy (isearch_string, last_isearch_accepted);
                          isearch_string_index = strlen (isearch_string);
                          goto search_now;
                        }
                      else
                        continue;
                    }
                  else
                    {
                      /* Search again in the same direction.  This means start
                         from a new place if the last search was successful. */
                      if (search_result == 0)
                        window->point += dir;
                    }
                }
              else
                {
                  /* Reverse the direction of the search. */
                  dir = -dir;
                }
            }
          else if (func == (VFunction *) info_abort_key)
            {
              /* If C-g pressed, and the search is failing, pop the search
                 stack back to the last unfailed search. */
              if (isearch_states_index && (search_result != 0))
                {
                  terminal_ring_bell ();
                  while (isearch_states_index && (search_result != 0))
                    pop_isearch
                      (window, &isearch_string_index, &dir, &search_result);
                  isearch_string[isearch_string_index] = '\0';
                  show_isearch_prompt (dir, (unsigned char *) isearch_string,
                      search_result);
                  continue;
                }
              else
                goto exit_search;
            }
          else
            goto exit_search;
        }
      else
        {
        exit_search:
          /* The character is not printable, or it has a function which is
             non-null.  Exit the search, remembering the search string.  If
             the key is not the same as the isearch_terminate_search_key,
             then push it into pending input. */
          if (isearch_string_index && func != (VFunction *) info_abort_key)
            {
              maybe_free (last_isearch_accepted);
              last_isearch_accepted = xstrdup (isearch_string);
            }

         /* If the key is the isearch_terminate_search_key, but some buffered
            input is pending, it is almost invariably because the ESC key is
            actually the beginning of an escape sequence, like in case they
            pressed an arrow key.  So don't gobble the ESC key, push it back
            into pending input.  */
         /* FIXME: this seems like a kludge!  We need a more reliable
            mechanism to know when ESC is a separate key and when it is
            part of an escape sequence.  */
          if (key != RET  /* Emacs addicts want RET to get lost */
             && (key != isearch_terminate_search_key
                || info_any_buffered_input_p ()))
            info_set_pending_input (key);

          if (func == (VFunction *) info_abort_key)
            {
              if (isearch_states_index)
                window_set_state (window, &orig_state);
            }

          if (!echo_area_is_active)
            window_clear_echo_area ();

          if (auto_footnotes_p)
            info_get_or_remove_footnotes (active_window);

          isearch_is_active = 0;
          continue;
        }

      /* Search for the contents of isearch_string. */
    search_now:
      show_isearch_prompt (dir, (unsigned char *) isearch_string, search_result);

      /* If the search string includes upper-case letters, make the
         search case-sensitive.  */
      for (p = isearch_string; *p; p++)
        if (isupper (*p))
          {
            case_sensitive = 1;
            break;
          }
      

      if (search_result == 0)
        {
          /* Check to see if the current search string is right here.  If
             we are looking at it, then don't bother calling the search
             function. */
          if (((dir < 0) &&
              ((case_sensitive ? strncmp : strncasecmp)
                            (window->node->contents + window->point,
                             isearch_string, isearch_string_index) == 0)) ||
              ((dir > 0) &&
               ((window->point - isearch_string_index) >= 0) &&
              ((case_sensitive ? strncmp : strncasecmp)
                            (window->node->contents +
                             (window->point - (isearch_string_index - 1)),
                             isearch_string, isearch_string_index) == 0)))
            {
              if (dir > 0)
                window->point++;
            }
          else
            search_result = info_search_internal (isearch_string,
                                            window, dir, case_sensitive);
        }

      /* If this search failed, and we didn't already have a failed search,
         then ring the terminal bell. */
      if (search_result != 0 && last_search_result == 0)
        terminal_ring_bell ();

    after_search:
      show_isearch_prompt (dir, (unsigned char *) isearch_string, search_result);

      if (search_result == 0)
        {
          if ((mystate.node == window->node) &&
              (mystate.pagetop != window->pagetop))
            {
              int newtop = window->pagetop;
              window->pagetop = mystate.pagetop;
              set_window_pagetop (window, newtop);
            }
          display_update_one_window (window);
          display_cursor_at_point (window);
        }

      last_search_result = search_result;
    }

  /* Free the memory used to remember each search state. */
  free_isearch_states ();

  /* Perhaps GC some file buffers. */
  info_gc_file_buffers ();

  /* After searching, leave the window in the correct state. */
  if (!echo_area_is_active)
    window_clear_echo_area ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4890 of file session.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void info_clear_pending_input ( void  ) [static]

Definition at line 4819 of file session.c.

void info_dispatch_on_key ( unsigned char  key,
Keymap  map 
)

Definition at line 4588 of file session.c.

{
#if !defined(INFOKEY)
  if (Meta_p (key) && (!ISO_Latin_p || map[key].function != ea_insert))
    {
      if (map[ESC].type == ISKMAP)
        {
          map = (Keymap)map[ESC].function;
          add_char_to_keyseq (ESC);
          key = UnMeta (key);
          info_dispatch_on_key (key, map);
        }
      else
        {
          dispatch_error (info_keyseq);
        }
      return;
    }
#endif /* INFOKEY */

  switch (map[key].type)
    {
    case ISFUNC:
      {
        VFunction *func;

        func = InfoFunction(map[key].function);
        if (func != (VFunction *)NULL)
          {
            /* Special case info_do_lowercase_version (). */
            if (func == (VFunction *) info_do_lowercase_version)
              {
#if defined(INFOKEY)
              unsigned char lowerkey;

              lowerkey = Meta_p(key) ? Meta (tolower (UnMeta (key))) : tolower (key);
              if (lowerkey == key)
                {
                  add_char_to_keyseq (key);
                  dispatch_error (info_keyseq);
                  return;
                }
                info_dispatch_on_key (lowerkey, map);
#else /* !INFOKEY */
                info_dispatch_on_key (tolower (key), map);
#endif /* INFOKEY */
                return;
              }

            add_char_to_keyseq (key);

            if (info_keyseq_displayed_p)
              display_info_keyseq (0);

            {
              WINDOW *where;

              where = active_window;
              (*InfoFunction(map[key].function))
                (active_window, info_numeric_arg * info_numeric_arg_sign, key);

              /* If we have input pending, then the last command was a prefix
                 command.  Don't change the value of the last function vars.
                 Otherwise, remember the last command executed in the var
                 appropriate to the window in which it was executed. */
              if (!info_input_pending_p ())
                {
                  if (where == the_echo_area)
                    ea_last_executed_command = InfoFunction(map[key].function);
                  else
                    info_last_executed_command = InfoFunction(map[key].function);
                }
            }
          }
        else
          {
            add_char_to_keyseq (key);
            dispatch_error (info_keyseq);
            return;
          }
      }
      break;

    case ISKMAP:
      add_char_to_keyseq (key);
      if (map[key].function != (InfoCommand *)NULL)
        {
          unsigned char newkey;

          newkey = info_get_another_input_char ();
          info_dispatch_on_key (newkey, (Keymap)map[key].function);
        }
      else
        {
          dispatch_error (info_keyseq);
          return;
        }
      break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4899 of file session.c.

{
  register int i = 0;
  int tty, space_avail;
  long chars_avail;
  unsigned char input[MAX_INFO_INPUT_BUFFERING];

  tty = fileno (info_input_stream);
  chars_avail = 0;

  space_avail = info_input_buffer_space_available ();

  /* If we can just find out how many characters there are to read, do so. */
#if defined (FIONREAD)
  {
    ioctl (tty, FIONREAD, &chars_avail);

    if (chars_avail > space_avail)
      chars_avail = space_avail;

    if (chars_avail)
      chars_avail = read (tty, &input[0], chars_avail);
  }
#else /* !FIONREAD */
#  if defined (O_NDELAY)
  {
    int flags;

    flags = fcntl (tty, F_GETFL, 0);

    fcntl (tty, F_SETFL, (flags | O_NDELAY));
      chars_avail = read (tty, &input[0], space_avail);
    fcntl (tty, F_SETFL, flags);

    if (chars_avail == -1)
      chars_avail = 0;
  }
#  else  /* !O_NDELAY */
#   ifdef __DJGPP__
  {
    extern long pc_term_chars_avail (void);

    if (isatty (tty))
      chars_avail = pc_term_chars_avail ();
    else
      {
       /* We could be more accurate by calling ltell, but we have no idea
          whether tty is buffered by stdio functions, and if so, how many
          characters are already waiting in the buffer.  So we punt.  */
       struct stat st;

       if (fstat (tty, &st) < 0)
         chars_avail = 1;
       else
         chars_avail = st.st_size;
      }
    if (chars_avail > space_avail)
      chars_avail = space_avail;
    if (chars_avail)
      chars_avail = read (tty, &input[0], chars_avail);
  }
#   endif/* __DJGPP__ */
#  endif /* O_NDELAY */
#endif /* !FIONREAD */

  while (i < chars_avail)
    {
      info_push_typeahead (input[i]);
      i++;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void info_gc_file_buffers ( void  ) [static]

Definition at line 4172 of file session.c.

{
  register int fb_index, iw_index, i;
  register FILE_BUFFER *fb;
  register INFO_WINDOW *iw;

  if (!info_loaded_files)
    return;

  for (fb_index = 0; (fb = info_loaded_files[fb_index]); fb_index++)
    {
      int fb_referenced_p = 0;

      /* If already gc-ed, do nothing. */
      if (!fb->contents)
        continue;

      /* If this file had to be uncompressed, check to see if we should
         gc it.  This means that the user-variable "gc-compressed-files"
         is non-zero. */
      if ((fb->flags & N_IsCompressed) && !gc_compressed_files)
        continue;

      /* If this file's contents are not gc-able, move on. */
      if (fb->flags & N_CannotGC)
        continue;

      /* Check each INFO_WINDOW to see if it has any nodes which reference
         this file. */
      for (iw_index = 0; (iw = info_windows[iw_index]); iw_index++)
        {
          for (i = 0; iw->nodes && iw->nodes[i]; i++)
            {
              if ((FILENAME_CMP (fb->fullpath, iw->nodes[i]->filename) == 0) ||
                  (FILENAME_CMP (fb->filename, iw->nodes[i]->filename) == 0))
                {
                  fb_referenced_p = 1;
                  break;
                }
            }
        }

      /* If this file buffer wasn't referenced, free its contents. */
      if (!fb_referenced_p)
        {
          free (fb->contents);
          fb->contents = (char *)NULL;
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char info_get_another_input_char ( void  )

Definition at line 4551 of file session.c.

{
  int ready = !info_keyseq_displayed_p; /* ready if new and pending key */

  /* If there isn't any input currently available, then wait a
     moment looking for input.  If we don't get it fast enough,
     prompt a little bit with the current key sequence. */
  if (!info_keyseq_displayed_p)
    {
      ready = 1;
      if (!info_any_buffered_input_p () &&
          !info_input_pending_p ())
        {
#if defined (FD_SET)
          struct timeval timer;
          fd_set readfds;

          FD_ZERO (&readfds);
          FD_SET (fileno (info_input_stream), &readfds);
          timer.tv_sec = 1;
          timer.tv_usec = 750;
          ready = select (fileno(info_input_stream)+1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
#else
          ready = 0;
#endif /* FD_SET */
      }
    }

  if (!ready)
    display_info_keyseq (1);

  return (info_get_input_char ());
}

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char info_get_input_char ( void  )

Definition at line 4973 of file session.c.

{
  unsigned char keystroke;

  info_gather_typeahead ();

  if (pending_input_character)
    {
      keystroke = pending_input_character;
      pending_input_character = 0;
    }
  else if (info_get_key_from_typeahead (&keystroke) == 0)
    {
      int rawkey;
      unsigned char c;
      int tty = fileno (info_input_stream);

      /* Using stream I/O causes FIONREAD etc to fail to work
         so unless someone can find a portable way of finding
         out how many characters are currently buffered, we
         should stay with away from stream I/O.
         --Egil Kvaleberg <egilk@sn.no>, January 1997.  */
#ifdef EINTR
      /* Keep reading if we got EINTR, so that we don't just exit.
         --Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>,
         22 Dec 1997.  */
      {
        int n;
        do
         n = read (tty, &c, 1);
        while (n == -1 && errno == EINTR);
        rawkey = n == 1 ? c : EOF;
      }
#else
      rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
#endif

      keystroke = rawkey;

      if (rawkey == EOF)
        {
          if (info_input_stream != stdin)
            {
              fclose (info_input_stream);
              info_input_stream = stdin;
             tty = fileno (info_input_stream);
              display_inhibited = 0;
              display_update_display (windows);
              display_cursor_at_point (active_window);
              rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
              keystroke = rawkey;
            }

          if (rawkey == EOF)
            {
              terminal_unprep_terminal ();
              close_dribble_file ();
              xexit (0);
            }
        }
    }

  if (info_dribble_file)
    dribble (keystroke);

  return keystroke;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int info_get_key_from_typeahead ( unsigned char *  key) [static]

Definition at line 4876 of file session.c.

{
  if (push_index == pop_index)
    return (0);

  *key = info_input_buffer[pop_index++];

  if ((unsigned int) pop_index >= sizeof (info_input_buffer))
    pop_index = 0;

  return (1);
}

Here is the caller graph for this function:

static void info_handle_pointer ( char *  label,
WINDOW window 
) [static]

Definition at line 1791 of file session.c.

{
  if (info_parsed_filename || info_parsed_nodename)
    {
      char *filename, *nodename;
      NODE *node;

      filename = nodename = (char *)NULL;

      if (info_parsed_filename)
        filename = xstrdup (info_parsed_filename);
      else
        {
          if (window->node->parent)
            filename = xstrdup (window->node->parent);
          else if (window->node->filename)
            filename = xstrdup (window->node->filename);
        }

      if (info_parsed_nodename)
        nodename = xstrdup (info_parsed_nodename);
      else
        nodename = xstrdup ("Top");

      node = info_get_node (filename, nodename);

      if (node)
        {
          INFO_WINDOW *info_win;

          info_win = get_info_window_of_window (window);
          if (info_win)
            {
              info_win->pagetops[info_win->current] = window->pagetop;
              info_win->points[info_win->current] = window->point;
            }
          info_set_node_of_window (1, window, node);
        }
      else
        {
          if (info_recent_file_error)
            info_error (info_recent_file_error, NULL, NULL);
          else
            info_error ((char *) msg_cant_file_node, filename, nodename);
        }

      free (filename);
      free (nodename);
    }
  else
    {
      info_error ((char *) msg_no_pointer, label, NULL);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4726 of file session.c.

Here is the caller graph for this function:

Definition at line 4864 of file session.c.

{
  if (pop_index > push_index)
    return (pop_index - push_index);
  else
    return (sizeof (info_input_buffer) - (push_index - pop_index));
}

Here is the caller graph for this function:

unsigned char info_input_pending_p ( void  )

Definition at line 4833 of file session.c.

Here is the caller graph for this function:

static void info_move_to_xref ( WINDOW window,
int  count,
unsigned char  key,
int  dir 
) [static]

Definition at line 4231 of file session.c.

{
  long firstmenu, firstxref;
  long nextmenu, nextxref;
  long placement = -1;
  long start = 0;
  NODE *node = window->node;

  if (dir < 0)
    start = node->nodelen;

  /* This search is only allowed to fail if there is no menu or cross
     reference in the current node.  Otherwise, the first menu or xref
     found is moved to. */

  firstmenu = info_search_in_node
    (INFO_MENU_ENTRY_LABEL, node, start, (WINDOW *)NULL, dir, 0);

  /* FIRSTMENU may point directly to the line defining the menu.  Skip that
     and go directly to the first item. */

  if (firstmenu != -1)
    {
      char *text = node->contents + firstmenu;

      if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
        firstmenu = info_search_in_node
          (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir, 0);
    }

  firstxref =
    info_search_in_node (INFO_XREF_LABEL, node, start, (WINDOW *)NULL, dir, 0);

#if defined (HANDLE_MAN_PAGES)
  if ((firstxref == -1) && (node->flags & N_IsManPage))
    {
      firstxref = locate_manpage_xref (node, start, dir);
    }
#endif /* HANDLE_MAN_PAGES */

  if (firstmenu == -1 && firstxref == -1)
    {
      info_error ((char *) msg_no_xref_node, NULL, NULL);
      return;
    }

  /* There is at least one cross reference or menu entry in this node.
     Try hard to find the next available one. */

  nextmenu = info_search_in_node
    (INFO_MENU_ENTRY_LABEL, node, window->point + dir, (WINDOW *)NULL, dir, 0);

  nextxref = info_search_in_node
    (INFO_XREF_LABEL, node, window->point + dir, (WINDOW *)NULL, dir, 0);

#if defined (HANDLE_MAN_PAGES)
  if ((nextxref == -1) && (node->flags & N_IsManPage) && (firstxref != -1))
    nextxref = locate_manpage_xref (node, window->point + dir, dir);
#endif /* HANDLE_MAN_PAGES */

  /* Ignore "Menu:" as a menu item. */
  if (nextmenu != -1)
    {
      char *text = node->contents + nextmenu;

      if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
        nextmenu = info_search_in_node
          (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir, 0);
    }

  /* If there is both a next menu entry, and a next xref entry, choose the
     one which occurs first.  Otherwise, select the one which actually
     appears in this node following point. */
  if (nextmenu != -1 && nextxref != -1)
    {
      if (((dir == 1) && (nextmenu < nextxref)) ||
          ((dir == -1) && (nextmenu > nextxref)))
        placement = nextmenu + 1;
      else
        placement = nextxref;
    }
  else if (nextmenu != -1)
    placement = nextmenu + 1;
  else if (nextxref != -1)
    placement = nextxref;

  /* If there was neither a menu or xref entry appearing in this node after
     point, choose the first menu or xref entry appearing in this node. */
  if (placement == -1)
    {
      if (firstmenu != -1 && firstxref != -1)
        {
          if (((dir == 1) && (firstmenu < firstxref)) ||
              ((dir == -1) && (firstmenu > firstxref)))
            placement = firstmenu + 1;
          else
            placement = firstxref;
        }
      else if (firstmenu != -1)
        placement = firstmenu + 1;
      else
        placement = firstxref;
    }
  window->point = placement;
  window_adjust_pagetop (window);
  window->flags |= W_UpdateWindow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void info_parse_and_select ( char *  line,
WINDOW window 
) [static]

Definition at line 1773 of file session.c.

{
  REFERENCE entry;

  info_parse_node (line, DONT_SKIP_NEWLINES);

  entry.nodename = info_parsed_nodename;
  entry.filename = info_parsed_filename;
  entry.label = "*info-parse-and-select*";

  info_select_reference (window, &entry);
}

Here is the call graph for this function:

static void info_push_typeahead ( unsigned char  key) [static]

Definition at line 4846 of file session.c.

{
  /* Flush all pending input in the case of C-g pressed. */
  if (key == Control ('g'))
    {
      push_index = pop_index;
      info_set_pending_input (Control ('g'));
    }
  else
    {
      info_input_buffer[push_index++] = key;
      if ((unsigned int) push_index >= sizeof (info_input_buffer))
        push_index = 0;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 188 of file session.c.

{
  unsigned char key;
  int done;
  done = 0;

  while (!done && !quit_info_immediately)
    {
      int lk = 0;

      /* If we haven't just gone up or down a line, there is no
         goal column for this window. */
      if ((info_last_executed_command != (VFunction *) info_next_line) &&
          (info_last_executed_command != (VFunction *) info_prev_line))
        active_window->goal_column = -1;

      if (echo_area_is_active)
        {
          lk = echo_area_last_command_was_kill;
          echo_area_prep_read ();
        }

      if (!info_any_buffered_input_p ())
        display_update_display (windows);

      display_cursor_at_point (active_window);
      info_initialize_numeric_arg ();

      initialize_keyseq ();
      key = info_get_input_char ();

      /* No errors yet.  We just read a character, that's all.  Only clear
         the echo_area if it is not currently active. */
      if (!echo_area_is_active)
        window_clear_echo_area ();

      info_error_was_printed = 0;

      /* Do the selected command. */
      info_dispatch_on_key (key, active_window->keymap);

      if (echo_area_is_active)
        {
          /* Echo area commands that do killing increment the value of
             ECHO_AREA_LAST_COMMAND_WAS_KILL.  Thus, if there is no
             change in the value of this variable, the last command
             executed was not a kill command. */
          if (lk == echo_area_last_command_was_kill)
            echo_area_last_command_was_kill = 0;

          if (ea_last_executed_command == (VFunction *) ea_newline ||
              info_aborted_echo_area)
            {
              ea_last_executed_command = (VFunction *)NULL;
              done = 1;
            }

          if (info_last_executed_command == (VFunction *) info_quit)
            quit_info_immediately = 1;
        }
      else if (info_last_executed_command == (VFunction *) info_quit)
        done = 1;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void info_search_1 ( WINDOW window,
int  count,
unsigned char  key,
int  case_sensitive,
int  ask_for_string 
) [static]

Here is the caller graph for this function:

long info_search_in_node ( char *  string,
NODE node,
long int  start,
WINDOW window,
int  dir,
int  case_sensitive 
)

Definition at line 3404 of file session.c.

{
  SEARCH_BINDING binding;
  long offset;

  binding.buffer = node->contents;
  binding.start = start;
  binding.end = node->nodelen;
  binding.flags = 0;
  if (!case_sensitive)
    binding.flags |= S_FoldCase;

  if (dir < 0)
    {
      binding.end = 0;
      binding.flags |= S_SkipDest;
    }

  if (binding.start < 0)
    return (-1);

  /* For incremental searches, we always wish to skip past the string. */
  if (isearch_is_active)
    binding.flags |= S_SkipDest;

  offset = search (string, &binding);

  if (offset != -1 && window)
    {
      set_remembered_pagetop_and_point (window);
      if (window->node != node)
        window_set_node_of_window (window, node);
      window->point = offset;
      window_adjust_pagetop (window);
    }
  return (offset);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int info_search_internal ( char *  string,
WINDOW window,
int  dir,
int  case_sensitive 
) [static]

Definition at line 3479 of file session.c.

{
  register int i;
  FILE_BUFFER *file_buffer;
  char *initial_nodename;
  long ret, start = 0;

  file_buffer = file_buffer_of_window (window);
  initial_nodename = window->node->nodename;

  /* This used to begin from window->point, unless this was a repeated
     search command.  But invoking search with an argument loses with
     that logic, since info_last_executed_command is then set to
     info_add_digit_to_numeric_arg.  I think there's no sense in
     ``finding'' a string that is already under the cursor, anyway.  */
  ret = info_search_in_node
        (string, window->node, window->point + dir, window, dir,
         case_sensitive);

  if (ret != -1)
    {
      /* We won! */
      if (!echo_area_is_active && !isearch_is_active)
        window_clear_echo_area ();
      return (0);
    }

  /* The string wasn't found in the current node.  Search through the
     window's file buffer, iff the current node is not "*". */
  if (!file_buffer || (strcmp (initial_nodename, "*") == 0))
    return (-1);

  /* If this file has tags, search through every subfile, starting at
     this node's subfile and node.  Otherwise, search through the
     file's node list. */
  if (file_buffer->tags)
    {
      register int current_tag = 0, number_of_tags;
      char *last_subfile;
      TAG *tag;

      /* Find number of tags and current tag. */
      last_subfile = (char *)NULL;
      for (i = 0; file_buffer->tags[i]; i++)
        if (strcmp (initial_nodename, file_buffer->tags[i]->nodename) == 0)
          {
            current_tag = i;
            last_subfile = file_buffer->tags[i]->filename;
          }

      number_of_tags = i;

      /* If there is no last_subfile, our tag wasn't found. */
      if (!last_subfile)
        return (-1);

      /* Search through subsequent nodes, wrapping around to the top
         of the info file until we find the string or return to this
         window's node and point. */
      while (1)
        {
          NODE *node;

          /* Allow C-g to quit the search, failing it if pressed. */
          return_if_control_g (-1);

          /* Find the next tag that isn't an anchor.  */
          for (i = current_tag + dir; i != current_tag; i += dir)
            {
              if (i < 0)
                i = number_of_tags - 1;
              else if (i == number_of_tags)
                i = 0;

              tag = file_buffer->tags[i];
              if (tag->nodelen != 0)
                break;
            }

          /* If we got past out starting point, bail out.  */
          if (i == current_tag)
            return (-1);
          current_tag = i;

          if (!echo_area_is_active && (last_subfile != tag->filename))
            {
              window_message_in_echo_area
                ((char *) _("Searching subfile %s ..."),
                 filename_non_directory (tag->filename), NULL);

              last_subfile = tag->filename;
            }

          node = info_get_node (file_buffer->filename, tag->nodename);

          if (!node)
            {
              /* If not doing i-search... */
              if (!echo_area_is_active)
                {
                  if (info_recent_file_error)
                    info_error (info_recent_file_error, NULL, NULL);
                  else
                    info_error ((char *) msg_cant_file_node,
                                filename_non_directory (file_buffer->filename),
                                tag->nodename);
                }
              return (-1);
            }

          if (dir < 0)
            start = tag->nodelen;

          ret =
            info_search_in_node (string, node, start, window, dir,
                                 case_sensitive);

          /* Did we find the string in this node? */
          if (ret != -1)
            {
              /* Yes!  We win. */
              remember_window_and_node (window, node);
              if (!echo_area_is_active)
                window_clear_echo_area ();
              return (0);
            }

          /* No.  Free this node, and make sure that we haven't passed
             our starting point. */
          free (node);

          if (strcmp (initial_nodename, tag->nodename) == 0)
            return (-1);
        }
    }
  return (-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void info_select_reference ( WINDOW window,
REFERENCE entry 
)

Definition at line 1711 of file session.c.

{
  NODE *node;
  char *filename, *nodename, *file_system_error;

  file_system_error = (char *)NULL;

  filename = entry->filename;
  if (!filename)
    filename = window->node->parent;
  if (!filename)
    filename = window->node->filename;

  if (filename)
    filename = xstrdup (filename);

  if (entry->nodename)
    nodename = xstrdup (entry->nodename);
  else
    nodename = xstrdup ("Top");

  node = info_get_node (filename, nodename);

  /* Try something a little weird.  If the node couldn't be found, and the
     reference was of the form "foo::", see if the entry->label can be found
     as a file, with a node of "Top". */
  if (!node)
    {
      if (info_recent_file_error)
        file_system_error = xstrdup (info_recent_file_error);

      if (entry->nodename && (strcmp (entry->nodename, entry->label) == 0))
        {
          node = info_get_node (entry->label, "Top");
          if (!node && info_recent_file_error)
            {
              maybe_free (file_system_error);
              file_system_error = xstrdup (info_recent_file_error);
            }
        }
    }

  if (!node)
    {
      if (file_system_error)
        info_error (file_system_error, NULL, NULL);
      else
        info_error ((char *) msg_cant_find_node, nodename, NULL);
    }

  maybe_free (file_system_error);
  maybe_free (filename);
  maybe_free (nodename);

  if (node)
    info_set_node_of_window (1, window, node);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 171 of file session.c.

{
  display_update_display (windows);
  info_last_executed_command = NULL;
  info_read_and_dispatch ();
  /* On program exit, leave the cursor at the bottom of the window, and
     restore the terminal I/O. */
  terminal_goto_xy (0, screenheight - 1);
  terminal_clear_to_eol ();
  fflush (stdout);
  terminal_unprep_terminal ();
  close_dribble_file ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void info_set_input_from_file ( char *  filename)

Definition at line 302 of file session.c.

{
  FILE *stream;

  /* Input may include binary characters.  */
  stream = fopen (filename, FOPEN_RBIN);

  if (!stream)
    return;

  if ((info_input_stream != (FILE *)NULL) &&
      (info_input_stream != stdin))
    fclose (info_input_stream);

  info_input_stream = stream;

  if (stream != stdin)
    display_inhibited = 1;
}

Here is the caller graph for this function:

void info_set_node_of_window ( int  remember,
WINDOW window,
NODE node 
)

Definition at line 484 of file session.c.

{
  if (remember)
    set_remembered_pagetop_and_point (window);

  /* Put this node into the window. */
  window_set_node_of_window (window, node);

  /* Remember this node and window in our list of info windows. */
  remember_window_and_node (window, node);

  /* If doing auto-footnote display/undisplay, show the footnotes belonging
     to this window's node. */
  if (auto_footnotes_p)
    info_get_or_remove_footnotes (window);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void info_set_pending_input ( unsigned char  key) [static]

Definition at line 4826 of file session.c.

Here is the caller graph for this function:

static void info_show_point ( WINDOW window) [static]

Definition at line 574 of file session.c.

{
  int old_pagetop;

  old_pagetop = window->pagetop;
  window_adjust_pagetop (window);
  if (old_pagetop != window->pagetop)
    {
      int new_pagetop;

      new_pagetop = window->pagetop;
      window->pagetop = old_pagetop;
      set_window_pagetop (window, new_pagetop);
    }

  if (window->flags & W_UpdateWindow)
    display_update_one_window (window);

  display_cursor_at_point (window);
}

Here is the call graph for this function:

Here is the caller graph for this function:

long info_target_search_node ( NODE node,
char *  string,
long int  start 
)

Definition at line 3447 of file session.c.

{
  register int i;
  long offset = 0;
  char *target;

  target = xstrdup (string);
  i = strlen (target);

  /* Try repeatedly searching for this string while removing words from
     the end of it. */
  while (i)
    {
      target[i] = '\0';
      offset = info_search_in_node (target, node, start, (WINDOW *)NULL, 1, 0);

      if (offset != -1)
        break;

      /* Delete the last word from TARGET. */
      for (; i && (!whitespace (target[i]) && (target[i] != ',')); i--);
    }
  free (target);
  return (offset);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void initialize_dumping ( void  ) [static]

Definition at line 3175 of file session.c.

Here is the caller graph for this function:

void initialize_info_session ( NODE node,
int  clear_screen 
)

Definition at line 259 of file session.c.

{
  char *term_name = getenv ("TERM");
  terminal_initialize_terminal (term_name);

  if (terminal_is_dumb_p)
    {
      if (!term_name)
        term_name = "dumb";

      info_error ((char *) msg_term_too_dumb, term_name, NULL);
      xexit (1);
    }

  if (clear_screen)
    {
      terminal_prep_terminal ();
      terminal_clear_screen ();
    }

  initialize_info_keymaps ();
  window_initialize_windows (screenwidth, screenheight);
  initialize_info_signal_handler ();
  display_initialize_display (screenwidth, screenheight);
  info_set_node_of_window (0, active_window, node);

  /* Tell the window system how to notify us when a window needs to be
     asynchronously deleted (e.g., user resizes window very small). */
  window_deletion_notifier = (VFunction *) forget_window_and_nodes;

  /* If input has not been redirected yet, make it come from unbuffered
     standard input. */
  if (!info_input_stream)
    {
      setbuf (stdin, NULL);
      info_input_stream = stdin;
    }

  info_windows_initialized_p = 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 119 of file signals.c.

{
#ifdef SA_NOCLDSTOP
  /* (Based on info from Paul Eggert found in coreutils.)  Don't use
     HAVE_SIGACTION to decide whether to use the sa_handler, sa_flags,
     sa_mask members, as some systems (Solaris 7+) don't define them.  Use
     SA_NOCLDSTOP instead; it's been part of POSIX.1 since day 1 (in 1988).  */
  info_signal_handler.sa_handler = info_signal_proc;
  info_signal_handler.sa_flags = 0;
  mask_termsig (&info_signal_handler.sa_mask);
#endif /* SA_NOCLDSTOP */

#if defined (SIGTSTP)
  set_termsig (SIGTSTP, &old_TSTP);
  set_termsig (SIGTTOU, &old_TTOU);
  set_termsig (SIGTTIN, &old_TTIN);
#endif /* SIGTSTP */

#if defined (SIGWINCH)
  set_termsig (SIGWINCH, &old_WINCH);
#endif

#if defined (SIGQUIT)
  set_termsig (SIGQUIT, &old_QUIT);
#endif

#if defined (SIGINT)
  set_termsig (SIGINT, &old_INT);
#endif

#if defined (SIGUSR1)
  /* Used by DJGPP to simulate SIGTSTP on Ctrl-Z.  */
  set_termsig (SIGUSR1, &old_USR1);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4510 of file session.c.

Here is the caller graph for this function:

static void move_to_new_line ( int  old,
int  new,
WINDOW window 
) [static]

Definition at line 597 of file session.c.

{
  if (old == -1)
    {
      info_error ((char *) msg_cant_find_point, NULL, NULL);
    }
  else
    {
      int goal;

      if (new >= window->line_count || new < 0)
        return;

      goal = window_get_goal_column (window);
      window->goal_column = goal;

      window->point = window->line_starts[new] - window->node->contents;
      window->point += window_chars_to_goal (window->line_starts[new], goal);
      info_show_point (window);
    }
}

Here is the call graph for this function:

char * node_printed_rep ( NODE node)

Definition at line 1690 of file session.c.

{
  char *rep;

  if (node->filename)
    {
      char *filename
       = filename_non_directory (node->parent ? node->parent : node->filename);
      rep = xmalloc (1 + strlen (filename) + 1 + strlen (node->nodename) + 1);
      sprintf (rep, "(%s)%s", filename, node->nodename);
    }
  else
    rep = node->nodename;

  return rep;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void pop_isearch ( WINDOW window,
int search_index,
int direction,
int failing 
) [static]

Definition at line 3809 of file session.c.

{
  SEARCH_STATE *state;

  if (isearch_states_index)
    {
      isearch_states_index--;
      state = isearch_states[isearch_states_index];
      window_set_state (window, state);
      *search_index = state->search_index;
      *direction = state->direction;
      *failing = state->failing;

      free (state);
      isearch_states[isearch_states_index] = (SEARCH_STATE *)NULL;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void print_node ( NODE node)

Definition at line 3303 of file session.c.

{
  FILE *printer_pipe;
  char *print_command = getenv ("INFO_PRINT_COMMAND");
  int piping = 0;

  if (!print_command || !*print_command)
    print_command = DEFAULT_INFO_PRINT_COMMAND;

  /* Note that on MS-DOS/MS-Windows, this MUST open the pipe in the
     (default) text mode, since the printer drivers there need to see
     DOS-style CRLF pairs at the end of each line.

     FIXME: if we are to support Mac-style text files, we might need
     to convert the text here.  */

  /* INFO_PRINT_COMMAND which says ">file" means write to that file.
     Presumably, the name of the file is the local printer device.  */
  if (*print_command == '>')
    printer_pipe = fopen (++print_command, "w");
  else
    {
      printer_pipe = popen (print_command, "w");
      piping = 1;
    }

  if (!printer_pipe)
    {
      info_error ((char *) _("Cannot open pipe to `%s'."), print_command, NULL);
      return;
    }

#if defined (VERBOSE_NODE_DUMPING)
  /* Maybe we should print some information about the node being output. */
  info_error ((char *) _("Printing node %s..."), node_printed_rep (node), NULL);
#endif /* VERBOSE_NODE_DUMPING */

  write_node_to_stream (node, printer_pipe);
  if (piping)
    pclose (printer_pipe);
  else
    fclose (printer_pipe);

#if defined (VERBOSE_NODE_DUMPING)
  info_error ((char *) _("Done."), NULL, NULL);
#endif /* VERBOSE_NODE_DUMPING */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void push_isearch ( WINDOW window,
int  search_index,
int  direction,
int  failing 
) [static]

Definition at line 3793 of file session.c.

{
  SEARCH_STATE *state;

  state = (SEARCH_STATE *)xmalloc (sizeof (SEARCH_STATE));
  window_get_state (window, state);
  state->search_index = search_index;
  state->direction = direction;
  state->failing = failing;

  add_pointer_to_array (state, isearch_states_index, isearch_states,
                        isearch_states_slots, 20, SEARCH_STATE *);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void remember_window_and_node ( WINDOW window,
NODE node 
)

Definition at line 358 of file session.c.

{
  /* See if we already have this window in our list. */
  INFO_WINDOW *info_win = get_info_window_of_window (window);

  /* If the window wasn't already on our list, then make a new entry. */
  if (!info_win)
    {
      info_win = (INFO_WINDOW *)xmalloc (sizeof (INFO_WINDOW));
      info_win->window = window;
      info_win->nodes = (NODE **)NULL;
      info_win->pagetops = (int *)NULL;
      info_win->points = (long *)NULL;
      info_win->current = 0;
      info_win->nodes_index = 0;
      info_win->nodes_slots = 0;

      add_pointer_to_array (info_win, info_windows_index, info_windows,
                            info_windows_slots, 10, INFO_WINDOW *);
    }

  /* If this node, the current pagetop, and the current point are the
     same as the current saved node and pagetop, don't really add this to
     the list of history nodes.  This may happen only at the very
     beginning of the program, I'm not sure.  --karl  */
  if (info_win->nodes
      && info_win->current >= 0
      && info_win->nodes[info_win->current]->contents == node->contents
      && info_win->pagetops[info_win->current] == window->pagetop
      && info_win->points[info_win->current] == window->point)
  return;

  /* Remember this node, the currently displayed pagetop, and the current
     location of point in this window.  Because we are updating pagetops
     and points as well as nodes, it is more efficient to avoid the
     add_pointer_to_array macro here. */
  if (info_win->nodes_index + 2 >= info_win->nodes_slots)
    {
      info_win->nodes_slots += 20;
      info_win->nodes = (NODE **) xrealloc (info_win->nodes,
                                      info_win->nodes_slots * sizeof (NODE *));
      info_win->pagetops = (int *) xrealloc (info_win->pagetops,
                                      info_win->nodes_slots * sizeof (int));
      info_win->points = (long *) xrealloc (info_win->points,
                                      info_win->nodes_slots * sizeof (long));
    }

  info_win->nodes[info_win->nodes_index] = node;
  info_win->pagetops[info_win->nodes_index] = window->pagetop;
  info_win->points[info_win->nodes_index] = window->point;
  info_win->current = info_win->nodes_index++;
  info_win->nodes[info_win->nodes_index] = NULL;
  info_win->pagetops[info_win->nodes_index] = 0;
  info_win->points[info_win->nodes_index] = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 340 of file session.c.

{
  INFO_WINDOW *info_win;

  info_win = get_info_window_of_window (window);

  if (!info_win)
    return;

  if (info_win->nodes_index &&
      (info_win->nodes[info_win->current] == window->node))
    {
      info_win->pagetops[info_win->current] = window->pagetop;
      info_win->points[info_win->current] = window->point;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void set_window_pagetop ( WINDOW window,
int  desired_top 
)

Definition at line 511 of file session.c.

{
  int point_line, old_pagetop;

  if (desired_top < 0)
    desired_top = 0;
  else if (desired_top > window->line_count)
    desired_top = window->line_count - 1;

  if (window->pagetop == desired_top)
    return;

  old_pagetop = window->pagetop;
  window->pagetop = desired_top;

  /* Make sure that point appears in this window. */
  point_line = window_line_of_point (window);
  if ((point_line < window->pagetop) ||
      ((point_line - window->pagetop) > window->height - 1))
    window->point =
      window->line_starts[window->pagetop] - window->node->contents;

  window->flags |= W_UpdateWindow;

  /* Find out which direction to scroll, and scroll the window in that
     direction.  Do this only if there would be a savings in redisplay
     time.  This is true if the amount to scroll is less than the height
     of the window, and if the number of lines scrolled would be greater
     than 10 % of the window's height. */
  if (old_pagetop < desired_top)
    {
      int start, end, amount;

      amount = desired_top - old_pagetop;

      if ((amount >= window->height) ||
          (((window->height - amount) * 10) < window->height))
        return;

      start = amount + window->first_row;
      end = window->height + window->first_row;

      display_scroll_display (start, end, -amount);
    }
  else
    {
      int start, end, amount;

      amount = old_pagetop - desired_top;

      if ((amount >= window->height) ||
          (((window->height - amount) * 10) < window->height))
        return;

      start = window->first_row;
      end = (window->first_row + window->height) - amount;
      display_scroll_display (start, end, amount);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void show_isearch_prompt ( int  dir,
unsigned char *  string,
int  failing_p 
) [static]

Definition at line 3843 of file session.c.

{
  register int i;
  const char *prefix;
  char *prompt, *p_rep;
  unsigned int prompt_len, p_rep_index, p_rep_size;

  if (dir < 0)
    prefix = _("I-search backward: ");
  else
    prefix = _("I-search: ");

  p_rep_index = p_rep_size = 0;
  p_rep = (char *)NULL;
  for (i = 0; string[i]; i++)
    {
      char *rep;

      switch (string[i])
        {
        case ' ': rep = " "; break;
        case LFD: rep = "\\n"; break;
        case TAB: rep = "\\t"; break;
        default:
          rep = pretty_keyname (string[i]);
        }
      if ((p_rep_index + strlen (rep) + 1) >= p_rep_size)
        p_rep = (char *)xrealloc (p_rep, p_rep_size += 100);

      strcpy (p_rep + p_rep_index, rep);
      p_rep_index += strlen (rep);
    }

  prompt_len = strlen (prefix) + p_rep_index + 1;
  if (failing_p)
    prompt_len += strlen (_("Failing "));
  prompt = xmalloc (prompt_len);
  sprintf (prompt, "%s%s%s", failing_p ? _("Failing ") : "", prefix,
           p_rep ? p_rep : "");

  window_message_in_echo_area ("%s", prompt, NULL);
  maybe_free (p_rep);
  free (prompt);
  display_cursor_at_point (active_window);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_node_to_stream ( NODE node,
FILE stream 
) [static]

Definition at line 3352 of file session.c.

{
  fwrite (node->contents, 1, node->nodelen, stream);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 841 of file session.c.

Definition at line 840 of file session.c.

char** dumped_already = (char **)NULL [static]

Definition at line 3170 of file session.c.

int dumped_already_index = 0 [static]

Definition at line 3171 of file session.c.

int dumped_already_slots = 0 [static]

Definition at line 3172 of file session.c.

Definition at line 3367 of file session.c.

Definition at line 4699 of file session.c.

Definition at line 4842 of file session.c.

Definition at line 49 of file session.c.

Definition at line 4506 of file session.c.

int info_keyseq_index = 0 [static]

Definition at line 4504 of file session.c.

int info_keyseq_size = 0 [static]

Definition at line 4505 of file session.c.

Definition at line 52 of file session.c.

Definition at line 4705 of file session.c.

Definition at line 4702 of file session.c.

Initial value:
 {
  "Continuous", "Next Only", "Page Only", (char *)NULL
}

Definition at line 835 of file session.c.

Definition at line 59 of file session.c.

int info_windows_index = 0 [static]

Definition at line 62 of file session.c.

int info_windows_slots = 0 [static]

Definition at line 65 of file session.c.

int isearch_is_active = 0 [static]

Definition at line 3375 of file session.c.

Definition at line 3787 of file session.c.

int isearch_states_index = 0 [static]

Definition at line 3788 of file session.c.

int isearch_states_slots = 0 [static]

Definition at line 3789 of file session.c.

char* isearch_string = (char *)NULL [static]

Definition at line 3781 of file session.c.

int isearch_string_index = 0 [static]

Definition at line 3782 of file session.c.

int isearch_string_size = 0 [static]

Definition at line 3783 of file session.c.

unsigned char isearch_terminate_search_key = ESC [static]

Definition at line 3784 of file session.c.

char* last_isearch_accepted = (char *)NULL [static]

Definition at line 3778 of file session.c.

Definition at line 3378 of file session.c.

int last_search_direction = 0 [static]

Definition at line 3377 of file session.c.

Definition at line 4815 of file session.c.

int pop_index = 0 [static]

Definition at line 4841 of file session.c.

int push_index = 0 [static]

Definition at line 4841 of file session.c.

Definition at line 55 of file session.c.

char* search_string = (char *)NULL [static]

Definition at line 3373 of file session.c.

int search_string_size = 0 [static]

Definition at line 3374 of file session.c.