1/* Manages interpreters for GDB, the GNU debugger.
2
3   Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
4
5   Written by Jim Ingham <jingham@apple.com> of Apple Computer, Inc.
6
7   This file is part of GDB.
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
13
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19   You should have received a copy of the GNU General Public License
20   along with this program; if not, write to the Free Software
21   Foundation, Inc., 59 Temple Place - Suite 330,
22   Boston, MA 02111-1307, USA. */
23
24#ifndef INTERPS_H
25#define INTERPS_H
26
27struct ui_out;
28struct interp;
29
30extern int interp_resume (struct interp *interp);
31extern int interp_suspend (struct interp *interp);
32extern int interp_prompt_p (struct interp *interp);
33extern int interp_exec_p (struct interp *interp);
34extern int interp_exec (struct interp *interp, const char *command);
35extern int interp_quiet_p (struct interp *interp);
36
37typedef void *(interp_init_ftype) (void);
38typedef int (interp_resume_ftype) (void *data);
39typedef int (interp_suspend_ftype) (void *data);
40typedef int (interp_prompt_p_ftype) (void *data);
41typedef int (interp_exec_ftype) (void *data, const char *command);
42typedef void (interp_command_loop_ftype) (void *data);
43
44struct interp_procs
45{
46  interp_init_ftype *init_proc;
47  interp_resume_ftype *resume_proc;
48  interp_suspend_ftype *suspend_proc;
49  interp_exec_ftype *exec_proc;
50  interp_prompt_p_ftype *prompt_proc_p;
51  interp_command_loop_ftype *command_loop_proc;
52};
53
54extern struct interp *interp_new (const char *name, void *data,
55				  struct ui_out *uiout,
56				  const struct interp_procs *procs);
57extern void interp_add (struct interp *interp);
58extern int interp_set (struct interp *interp);
59extern struct interp *interp_lookup (const char *name);
60extern struct ui_out *interp_ui_out (struct interp *interp);
61
62extern int current_interp_named_p (const char *name);
63extern int current_interp_display_prompt_p (void);
64extern void current_interp_command_loop (void);
65
66extern void clear_interpreter_hooks (void);
67
68/* well-known interpreters */
69#define INTERP_CONSOLE		"console"
70#define INTERP_MI1             "mi1"
71#define INTERP_MI2             "mi2"
72#define INTERP_MI3             "mi3"
73#define INTERP_MI		"mi"
74#define INTERP_TUI		"tui"
75
76#endif
77