session.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* session.h -- Functions found in session.c.
  2. $Id$
  3. Copyright 1993, 1998, 1999, 2001, 2002, 2004, 2007, 2011, 2013, 2014,
  4. 2015, 2016
  5. Free Software Foundation, Inc.
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. Originally written by Brian Fox. */
  17. #ifndef SESSION_H
  18. #define SESSION_H
  19. #include "info.h"
  20. #include "window.h"
  21. #include "dribble.h"
  22. /* Variable controlling the garbage collection of files briefly visited
  23. during searches. Such files are normally gc'ed, unless they were
  24. compressed to begin with. If this variable is non-zero, it says
  25. to gc even those file buffer contents which had to be uncompressed. */
  26. extern int gc_compressed_files;
  27. /* When non-zero, tiling takes place automatically when info_split_window
  28. is called. */
  29. extern int auto_tiling_p;
  30. /* Variable controlling the behaviour of default scrolling when you are
  31. already at the bottom of a node. */
  32. extern int info_scroll_behaviour;
  33. /* Values for info_scroll_behaviour. */
  34. #define IS_Continuous 0 /* Try to get first menu item, or failing that, the
  35. "Next:" pointer, or failing that, the "Up:" and
  36. "Next:" of the up. */
  37. #define IS_NextOnly 1 /* Try to get "Next:" menu item. */
  38. #define IS_PageOnly 2 /* Simply give up at the bottom of a node. */
  39. extern int cursor_movement_scrolls_p;
  40. /* Controls what to do when a scrolling command is issued at the end of the
  41. last node. */
  42. extern int scroll_last_node;
  43. /* Values for scroll_last_node */
  44. #define SLN_Stop 0 /* Stop at the last node */
  45. #define SLN_Top 1 /* Go to the top node */
  46. int get_input_key (void);
  47. int get_another_input_key (void);
  48. VFunction *read_key_sequence (Keymap map, int menu, int mouse,
  49. int insert, int *count);
  50. unsigned char info_input_pending_p (void);
  51. void info_set_node_of_window (WINDOW *window, NODE *node);
  52. void info_set_node_of_window_fast (WINDOW *window, NODE *node);
  53. void initialize_keyseq (void);
  54. void add_char_to_keyseq (int character);
  55. FILE_BUFFER *file_buffer_of_window (WINDOW *window);
  56. int info_select_reference (WINDOW *window, REFERENCE *entry);
  57. int info_any_buffered_input_p (void);
  58. void dump_nodes_to_file (REFERENCE **references,
  59. char *output_filename, int flags);
  60. int write_node_to_stream (NODE *node, FILE *stream);
  61. char *program_name_from_file_name (char *file_name);
  62. /* Do the physical deletion of WINDOW, and forget this window and
  63. associated nodes. */
  64. void info_delete_window_internal (WINDOW *window);
  65. void forget_window_and_nodes (WINDOW *window);
  66. void forget_node (WINDOW *win);
  67. int forget_node_fast (WINDOW *win);
  68. /* Tell Info that input is coming from the file FILENAME. */
  69. void info_set_input_from_file (char *filename);
  70. /* Error and debugging messages */
  71. extern unsigned debug_level;
  72. #define debug(n,c) \
  73. do \
  74. { \
  75. if (debug_level >= (n)) \
  76. info_debug c; \
  77. } \
  78. while (0)
  79. void info_debug (const char *format, ...) TEXINFO_PRINTFLIKE(1,2);
  80. /* Print args as per FORMAT. If the window system was initialized,
  81. then the message is printed in the echo area. Otherwise, a message is
  82. output to stderr. */
  83. void info_error (const char *format, ...) TEXINFO_PRINTFLIKE(1,2);
  84. void initialize_info_session (void);
  85. void info_read_and_dispatch (void);
  86. void close_info_session (void);
  87. void info_session (REFERENCE **ref_list, char *user_filename, char *error);
  88. void initialize_terminal_and_keymaps (char *init_file);
  89. REFERENCE *info_intuit_options_node (NODE *initial_node, char *program);
  90. void info_scroll_forward (WINDOW *window, int count);
  91. void info_abort_key (WINDOW *window, int count);
  92. NODE *info_follow_menus (NODE *initial_node, char **menus,
  93. char **error_msg, int strict);
  94. /* Adding numeric arguments. */
  95. extern int info_explicit_arg;
  96. extern int ea_explicit_arg;
  97. void info_initialize_numeric_arg (void);
  98. /* Found in m-x.c. */
  99. char *read_function_name (char *prompt, WINDOW *window);
  100. void show_error_node (char *error_msg);
  101. #endif /* not SESSION_H */