currently active. */
int secondary_prompt_depth;
+ /* The UI's stdin. Set to stdin for the main UI. */
+ FILE *stdin_stream;
+
/* stdio stream that command input is being read from. Set to stdin
normally. Set by source_command to the file we are sourcing.
Set to NULL if we are executing a user-defined command or
it with the event loop. */
int input_fd;
+ /* Whether ISATTY returns true on input_fd. Cached here because
+ quit_force needs to know this _after_ input_fd might be
+ closed. */
+ int input_interactive_p;
+
/* See enum prompt_state's description. */
enum prompt_state prompt_state;
/* Create a new UI. */
extern struct ui *new_ui (FILE *instream, FILE *outstream, FILE *errstream);
+extern void delete_ui (struct ui *todel);
+
+/* Cleanup that deletes a UI. */
+extern struct cleanup *make_delete_ui_cleanup (struct ui *ui);
+
+/* Make a cleanup that restores the current UI. */
+extern struct cleanup *make_cleanup_restore_current_ui (void);
+
+/* Register the UI's input file descriptor in the event loop. */
+extern void ui_register_input_event_handler (struct ui *ui);
-/* Cleanup that restores the current UI. */
-extern void restore_ui_cleanup (void *data);
+/* Unregister the UI's input file descriptor from the event loop. */
+extern void ui_unregister_input_event_handler (struct ui *ui);
/* From top.c. */
extern char *saved_command_line;
extern void init_history (void);
extern void command_loop (void);
extern int quit_confirm (void);
-extern void quit_force (char *, int);
+extern void quit_force (int *, int);
extern void quit_command (char *, int);
extern void quit_cover (void);
extern void execute_command (char *, int);