Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / ao-tools / ao-dbg / ao-dbg.h
1 /*
2  * Copyright © 2008 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18
19 #include <ccdbg.h>
20
21 extern char *s51_prompt;
22 extern struct ccdbg *s51_dbg;
23 extern int s51_interrupted;
24 extern int s51_monitor;
25 extern char *s51_tty;
26
27 enum command_result {
28         command_success, command_debug, command_syntax, command_interrupt, command_error,
29 };
30
31 struct command_function {
32         char                    *name;
33         char                    *alias;
34         enum command_result     (*func)(int argc, char **argv);
35         char                    *usage;
36         char                    *help;
37 };
38
39 struct command_function *
40 command_string_to_function(struct command_function *functions, char *name);
41
42 enum command_result
43 command_function_help(struct command_function *functions, int argc, char **argv);
44
45 void
46 command_syntax_error(int argc, char **argv);
47
48 enum command_result
49 command_quit (int argc, char **argv);
50
51 enum command_result
52 command_help (int argc, char **argv);
53
54 enum command_result
55 command_stop (int argc, char **argv);
56
57 enum command_result
58 command_di (int argc, char **argv);
59
60 enum command_result
61 command_ds (int argc, char **argv);
62
63 enum command_result
64 command_dx (int argc, char **argv);
65
66 enum command_result
67 command_set (int argc, char **argv);
68
69 enum command_result
70 command_dump (int argc, char **argv);
71
72 enum command_result
73 command_file (int argc, char **argv);
74
75 enum command_result
76 command_pc (int argc, char **argv);
77
78 enum command_result
79 command_break (int argc, char **argv);
80
81 enum command_result
82 command_clear (int argc, char **argv);
83
84 enum command_result
85 command_run (int argc, char **argv);
86
87 enum command_result
88 command_next (int argc, char **argv);
89
90 enum command_result
91 command_step (int argc, char **argv);
92
93 enum command_result
94 command_load (int argc, char **argv);
95
96 enum command_result
97 command_halt (int argc, char **argv);
98
99 enum command_result
100 command_reset (int argc, char **argv);
101
102 enum command_result
103 command_status (int argc, char **argv);
104
105 enum command_result
106 command_info (int argc, char **argv);
107
108 enum command_result
109 cc_wait(void);
110
111 void
112 command_read (void);
113
114 void
115 s51_printf(char *format, ...);
116
117 void
118 s51_putc(int c);
119
120 int
121 s51_check_input(void);
122
123 int
124 s51_read_line(char *line, int len);