Remove unnecessary null_cleanup
[deliverable/binutils-gdb.git] / gdb / interps.h
index e5cd779f264ae6bbda11641e131a23f00f81d2f5..97d510ff9c0876fbf05841c08b3d9daf564faa0e 100644 (file)
@@ -46,13 +46,15 @@ typedef int (interp_resume_ftype) (void *data);
 typedef int (interp_suspend_ftype) (void *data);
 typedef struct gdb_exception (interp_exec_ftype) (void *data,
                                                  const char *command);
-typedef void (interp_command_loop_ftype) (void *data);
+typedef void (interp_pre_command_loop_ftype) (struct interp *self);
 typedef struct ui_out *(interp_ui_out_ftype) (struct interp *self);
 
 typedef int (interp_set_logging_ftype) (struct interp *self, int start_log,
                                        struct ui_file *out,
                                        struct ui_file *logfile);
 
+typedef int (interp_supports_command_editing_ftype) (struct interp *self);
+
 struct interp_procs
 {
   interp_init_ftype *init_proc;
@@ -71,7 +73,14 @@ struct interp_procs
      disabled.  */
   interp_set_logging_ftype *set_logging_proc;
 
-  interp_command_loop_ftype *command_loop_proc;
+  /* Called before starting an event loop, to give the interpreter a
+     chance to e.g., print a prompt.  */
+  interp_pre_command_loop_ftype *pre_command_loop_proc;
+
+  /* Returns true if this interpreter supports using the readline
+     library; false if it uses GDB's own simplified readline
+     emulation.  */
+  interp_supports_command_editing_ftype *supports_command_editing_proc;
 };
 
 extern struct interp *interp_new (const char *name,
@@ -86,6 +95,11 @@ extern int interp_set (struct interp *interp, int top_level);
    the interpreter.  */
 extern struct interp *interp_lookup (struct ui *ui, const char *name);
 
+/* Set the current UI's top level interpreter to the interpreter named
+   NAME.  Throws an error if NAME is not a known interpreter or the
+   interpreter fails to initialize.  */
+extern void set_top_level_interpreter (const char *name);
+
 extern struct ui_out *interp_ui_out (struct interp *interp);
 extern void *interp_data (struct interp *interp);
 extern const char *interp_name (struct interp *interp);
@@ -93,8 +107,6 @@ extern struct interp *interp_set_temp (const char *name);
 
 extern int current_interp_named_p (const char *name);
 
-extern void current_interp_command_loop (void);
-
 /* Call this function to give the current interpreter an opportunity
    to do any special handling of streams when logging is enabled or
    disabled.  START_LOG is 1 when logging is starting, 0 when it ends,
@@ -109,10 +121,27 @@ extern int current_interp_set_logging (int start_log, struct ui_file *out,
 extern void *top_level_interpreter_data (void);
 extern struct interp *top_level_interpreter (void);
 
+/* Return the current UI's current interpreter.  */
+extern struct interp *current_interpreter (void);
+
 extern struct interp *command_interp (void);
 
 extern void clear_interpreter_hooks (void);
 
+/* Returns true if INTERP supports using the readline library; false
+   if it uses GDB's own simplified form of readline.  */
+extern int interp_supports_command_editing (struct interp *interp);
+
+/* Called before starting an event loop, to give the interpreter a
+   chance to e.g., print a prompt.  */
+extern void interp_pre_command_loop (struct interp *interp);
+
+/* List the possible interpreters which could complete the given
+   text.  */
+extern VEC (char_ptr) *interpreter_completer (struct cmd_list_element *ignore,
+                                             const char *text,
+                                             const char *word);
+
 /* well-known interpreters */
 #define INTERP_CONSOLE         "console"
 #define INTERP_MI1             "mi1"
This page took 0.025633 seconds and 4 git commands to generate.