Back to index

tetex-bin  3.0
Defines | Functions | Variables
session.h File Reference
#include "info.h"
#include "dribble.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DECLARE_INFO_COMMAND(name, doc)   void name (WINDOW *window, int count, unsigned char key)
#define IS_Continuous
#define IS_NextOnly   1 /* Try to get "Next:" menu item. */
#define IS_PageOnly   2 /* Simply give up at the bottom of a node. */
#define return_if_control_g(val)

Functions

void info_dispatch_on_key (unsigned char key, Keymap map)
unsigned char info_get_input_char (void)
unsigned char info_get_another_input_char (void)
unsigned char info_input_pending_p (void)
void remember_window_and_node (WINDOW *window, NODE *node)
void set_remembered_pagetop_and_point (WINDOW *window)
void set_window_pagetop (WINDOW *window, int desired_top)
void info_set_node_of_window (int remember, WINDOW *window, NODE *node)
void initialize_keyseq (void)
void add_char_to_keyseq (char character)
void info_gather_typeahead (void)
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)
void info_select_reference (WINDOW *window, REFERENCE *entry)
int info_any_buffered_input_p (void)
void print_node (NODE *node)
void dump_node_to_file (NODE *node, char *filename, int dump_subnodes)
void dump_nodes_to_file (char *filename, char **nodenames, char *output_filename, int dump_subnodes)
char * program_name_from_file_name (char *file_name)
void info_delete_window_internal (WINDOW *window)
void info_set_input_from_file (char *filename)
void begin_multiple_window_info_session (char *filename, char **nodenames)
void begin_info_session (NODE *initial_node)
void begin_info_session_with_error (NODE *initial_node, char *format, void *arg1, void *arg2)
void info_session (void)
void initialize_info_session (NODE *node, int clear_screen)
void info_read_and_dispatch (void)
void info_intuit_options_node (WINDOW *window, NODE *initial_node, char *program)
void info_next_line (WINDOW *window, int count, unsigned char key)
void info_prev_line (WINDOW *window, int count, unsigned char key)
void info_end_of_line (WINDOW *window, int count, unsigned char key)
void info_beginning_of_line (WINDOW *window, int count, unsigned char key)
void info_forward_char (WINDOW *window, int count, unsigned char key)
void info_backward_char (WINDOW *window, int count, unsigned char key)
void info_forward_word (WINDOW *window, int count, unsigned char key)
void info_backward_word (WINDOW *window, int count, unsigned char key)
void info_beginning_of_node (WINDOW *window, int count, unsigned char key)
void info_end_of_node (WINDOW *window, int count, unsigned char key)
void info_move_to_prev_xref (WINDOW *window, int count, unsigned char key)
void info_move_to_next_xref (WINDOW *window, int count, unsigned char key)
void info_scroll_forward (WINDOW *window, int count, unsigned char key)
void info_scroll_backward (WINDOW *window, int count, unsigned char key)
void info_redraw_display (WINDOW *window, int count, unsigned char key)
void info_toggle_wrap (WINDOW *window, int count, unsigned char key)
void info_move_to_window_line (WINDOW *window, int count, unsigned char key)
void info_up_line (WINDOW *window, int count, unsigned char key)
void info_down_line (WINDOW *window, int count, unsigned char key)
void info_scroll_half_screen_down (WINDOW *window, int count, unsigned char key)
void info_scroll_half_screen_up (WINDOW *window, int count, unsigned char key)
void info_scroll_forward_set_window (WINDOW *window, int count, unsigned char key)
void info_scroll_forward_page_only (WINDOW *window, int count, unsigned char key)
void info_scroll_forward_page_only_set_window (WINDOW *window, int count, unsigned char key)
void info_scroll_backward_set_window (WINDOW *window, int count, unsigned char key)
void info_scroll_backward_page_only (WINDOW *window, int count, unsigned char key)
void info_scroll_backward_page_only_set_window (WINDOW *window, int count, unsigned char key)
void info_scroll_other_window_backward (WINDOW *window, int count, unsigned char key)
void info_split_window (WINDOW *window, int count, unsigned char key)
void info_delete_window (WINDOW *window, int count, unsigned char key)
void info_keep_one_window (WINDOW *window, int count, unsigned char key)
void info_grow_window (WINDOW *window, int count, unsigned char key)
void info_scroll_other_window (WINDOW *window, int count, unsigned char key)
void info_tile_windows (WINDOW *window, int count, unsigned char key)
void info_next_window (WINDOW *window, int count, unsigned char key)
void info_prev_window (WINDOW *window, int count, unsigned char key)
void info_next_node (WINDOW *window, int count, unsigned char key)
void info_prev_node (WINDOW *window, int count, unsigned char key)
void info_up_node (WINDOW *window, int count, unsigned char key)
void info_last_node (WINDOW *window, int count, unsigned char key)
void info_first_node (WINDOW *window, int count, unsigned char key)
void info_history_node (WINDOW *window, int count, unsigned char key)
void info_goto_node (WINDOW *window, int count, unsigned char key)
void info_goto_invocation_node (WINDOW *window, int count, unsigned char key)
void info_top_node (WINDOW *window, int count, unsigned char key)
void info_dir_node (WINDOW *window, int count, unsigned char key)
void info_global_next_node (WINDOW *window, int count, unsigned char key)
void info_global_prev_node (WINDOW *window, int count, unsigned char key)
void info_kill_node (WINDOW *window, int count, unsigned char key)
void info_view_file (WINDOW *window, int count, unsigned char key)
void info_menu_sequence (WINDOW *window, int count, unsigned char key)
NODEinfo_follow_menus (NODE *initial_node, char **menus, const char **errstr, char **errarg1, char **errarg2)
void info_man (WINDOW *window, int count, unsigned char key)
void list_visited_nodes (WINDOW *window, int count, unsigned char key)
void select_visited_node (WINDOW *window, int count, unsigned char key)
void info_menu_digit (WINDOW *window, int count, unsigned char key)
void info_menu_item (WINDOW *window, int count, unsigned char key)
void info_xref_item (WINDOW *window, int count, unsigned char key)
void info_find_menu (WINDOW *window, int count, unsigned char key)
void info_select_reference_this_line (WINDOW *window, int count, unsigned char key)
void info_last_menu_item (WINDOW *window, int count, unsigned char key)
void info_visit_menu (WINDOW *window, int count, unsigned char key)
void info_add_digit_to_numeric_arg (WINDOW *window, int count, unsigned char key)
void info_universal_argument (WINDOW *window, int count, unsigned char key)
void info_initialize_numeric_arg (void)
void info_numeric_arg_digit_loop (WINDOW *window, int count, unsigned char key)
void info_search (WINDOW *window, int count, unsigned char key)
void isearch_forward (WINDOW *window, int count, unsigned char key)
void isearch_backward (WINDOW *window, int count, unsigned char key)
void info_search_case_sensitively (WINDOW *window, int count, unsigned char key)
void info_search_backward (WINDOW *window, int count, unsigned char key)
void info_search_next (WINDOW *window, int count, unsigned char key)
void info_search_previous (WINDOW *window, int count, unsigned char key)
void info_print_node (WINDOW *window, int count, unsigned char key)
void info_show_footnotes (WINDOW *window, int count, unsigned char key)
void info_abort_key (WINDOW *window, int count, unsigned char key)
void info_quit (WINDOW *window, int count, unsigned char key)
void info_do_lowercase_version (WINDOW *window, int count, unsigned char key)

Variables

VFunctioninfo_last_executed_command
int gc_compressed_files
int auto_tiling_p
int info_scroll_behaviour
char * info_scroll_choices []
int info_explicit_arg
int info_numeric_arg
int info_numeric_arg_sign

Define Documentation

#define DECLARE_INFO_COMMAND (   name,
  doc 
)    void name (WINDOW *window, int count, unsigned char key)

Definition at line 35 of file session.h.

#define IS_Continuous
Value:
0 /* Try to get first menu item, or failing that, the
                           "Next:" pointer, or failing that, the "Up:" and
                           "Next:" of the up. */

Definition at line 57 of file session.h.

#define IS_NextOnly   1 /* Try to get "Next:" menu item. */

Definition at line 58 of file session.h.

#define IS_PageOnly   2 /* Simply give up at the bottom of a node. */

Definition at line 59 of file session.h.

#define return_if_control_g (   val)
Value:
do { \
    info_gather_typeahead (); \
    if (info_input_pending_p () == Control ('g')) \
      return (val); \
  } while (0)

Definition at line 95 of file session.h.


Function Documentation

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:

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:

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:

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:

void info_abort_key ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_add_digit_to_numeric_arg ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

Definition at line 4890 of file session.c.

Here is the call graph for this function:

void info_backward_char ( WINDOW window,
int  count,
unsigned char  key 
)
void info_backward_word ( WINDOW window,
int  count,
unsigned char  key 
)
void info_beginning_of_line ( WINDOW window,
int  count,
unsigned char  key 
)
void info_beginning_of_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_delete_window ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_dir_node ( WINDOW window,
int  count,
unsigned char  key 
)
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:

void info_do_lowercase_version ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_down_line ( WINDOW window,
int  count,
unsigned char  key 
)
void info_end_of_line ( WINDOW window,
int  count,
unsigned char  key 
)
void info_end_of_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_find_menu ( WINDOW window,
int  count,
unsigned char  key 
)
void info_first_node ( WINDOW window,
int  count,
unsigned char  key 
)
NODE* info_follow_menus ( NODE initial_node,
char **  menus,
const char **  errstr,
char **  errarg1,
char **  errarg2 
)

Here is the caller graph for this function:

void info_forward_char ( WINDOW window,
int  count,
unsigned char  key 
)
void info_forward_word ( WINDOW window,
int  count,
unsigned char  key 
)

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:

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:

void info_global_next_node ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_global_prev_node ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_goto_invocation_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_goto_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_grow_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_history_node ( WINDOW window,
int  count,
unsigned char  key 
)

Definition at line 4726 of file session.c.

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:

void info_intuit_options_node ( WINDOW window,
NODE initial_node,
char *  program 
)

Here is the caller graph for this function:

void info_keep_one_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_kill_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_last_menu_item ( WINDOW window,
int  count,
unsigned char  key 
)
void info_last_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_man ( WINDOW window,
int  count,
unsigned char  key 
)
void info_menu_digit ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_menu_item ( WINDOW window,
int  count,
unsigned char  key 
)
void info_menu_sequence ( WINDOW window,
int  count,
unsigned char  key 
)
void info_move_to_next_xref ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_move_to_prev_xref ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_move_to_window_line ( WINDOW window,
int  count,
unsigned char  key 
)
void info_next_line ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_next_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_next_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_numeric_arg_digit_loop ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_prev_line ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_prev_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_prev_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_print_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_quit ( WINDOW window,
int  count,
unsigned char  key 
)

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:

void info_redraw_display ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_backward ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_backward_page_only ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_backward_page_only_set_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_backward_set_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_forward ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_forward_page_only ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_forward_page_only_set_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_forward_set_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_half_screen_down ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_half_screen_up ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_other_window ( WINDOW window,
int  count,
unsigned char  key 
)
void info_scroll_other_window_backward ( WINDOW window,
int  count,
unsigned char  key 
)
void info_search ( WINDOW window,
int  count,
unsigned char  key 
)
void info_search_backward ( WINDOW window,
int  count,
unsigned char  key 
)
void info_search_case_sensitively ( WINDOW window,
int  count,
unsigned char  key 
)
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:

void info_search_next ( WINDOW window,
int  count,
unsigned char  key 
)
void info_search_previous ( WINDOW window,
int  count,
unsigned char  key 
)
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:

void info_select_reference_this_line ( WINDOW window,
int  count,
unsigned char  key 
)

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:

void info_show_footnotes ( WINDOW window,
int  count,
unsigned char  key 
)
void info_split_window ( WINDOW window,
int  count,
unsigned char  key 
)
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:

void info_tile_windows ( WINDOW window,
int  count,
unsigned char  key 
)
void info_toggle_wrap ( WINDOW window,
int  count,
unsigned char  key 
)
void info_top_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_universal_argument ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void info_up_line ( WINDOW window,
int  count,
unsigned char  key 
)
void info_up_node ( WINDOW window,
int  count,
unsigned char  key 
)
void info_view_file ( WINDOW window,
int  count,
unsigned char  key 
)
void info_visit_menu ( WINDOW window,
int  count,
unsigned char  key 
)
void info_xref_item ( WINDOW window,
int  count,
unsigned char  key 
)
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 4510 of file session.c.

Here is the caller graph for this function:

void isearch_backward ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void isearch_forward ( WINDOW window,
int  count,
unsigned char  key 
)

Here is the caller graph for this function:

void list_visited_nodes ( WINDOW window,
int  count,
unsigned char  key 
)
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:

char* program_name_from_file_name ( char *  file_name)

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:

void select_visited_node ( WINDOW window,
int  count,
unsigned char  key 
)

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:


Variable Documentation

Definition at line 3367 of file session.c.

Definition at line 4699 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.

Definition at line 835 of file session.c.