2 * Simulator of microcontrollers (cmd.src/show.cc)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
46 * Command: show copying
47 *----------------------------------------------------------------------------
51 //cl_show_copying_cmd::do_work(class cl_sim *sim,
52 // class cl_cmdline *cmdline, class cl_console_base *con)
53 COMMAND_DO_WORK(cl_show_copying_cmd)
55 con->dd_printf("%s\n", copying);
61 * Command: show warranty
62 *----------------------------------------------------------------------------
66 //cl_show_warranty_cmd::do_work(class cl_sim *sim,
67 // class cl_cmdline *cmdline, class cl_console_base *con)
68 COMMAND_DO_WORK(cl_show_warranty_cmd)
70 con->dd_printf("%s\n", warranty);
76 * Command: show option
77 *----------------------------------------------------------------------------
79 COMMAND_DO_WORK_APP(cl_show_option_cmd)
81 class cl_cmd_arg *parm= cmdline->param(0);
86 else if (cmdline->syntax_match(0/*app->get_uc()*/, STRING)) {
87 s= parm->value.string.string;
90 con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
93 for (i= 0; i < app->options->count; i++)
95 class cl_option *o= (class cl_option *)(/*uc*/app->options->at(i));
97 !strcmp(s, o->get_name()))
100 con->dd_printf("%d. %s: ", i, object_name(o));
102 con->dd_printf(" - %s\n", o->help);
103 con->dd_printf(" Type: %s\n", o->get_type_name());
104 /*union option_value *val= o->get_value();
105 con->dd_printf(" Value: \"");
107 TYPE_UBYTE *d= (TYPE_UBYTE*)val;
108 for (uj= 0; uj < sizeof(*val); uj++)
109 con->print_char_octal(d[uj]);
110 con->dd_printf("\"\n");*/
111 con->dd_printf(" Hidden: %s\n", (o->hidden)?"True":"False");
112 con->dd_printf(" Creator: \"%s\"\n %d Users:\n",
113 object_name(o->get_creator()),
115 for (j= 0; j < o->users->count; j++)
117 class cl_optref *r= (class cl_optref *)(o->users->at(j));
118 con->dd_printf(" %2d. owner(s)=\"%s\"\n", j,
119 object_name(r->get_owner()));
122 i < app->options->count-1)
123 con->dd_printf("\n");
135 show_error_cmd_print_node(class cl_console_base *con,
136 int indent, class cl_base *node)
141 for (i= 0; i < indent; i++)
143 const char *name= node->get_name("unknown");
144 class cl_error_class *ec= dynamic_cast<class cl_error_class *>(node);
146 con->dd_printf("%s: %s [%s/%s]\n",
147 str= case_string(case_case, ec->get_type_name()),
148 name, get_id_string(error_on_off_names,
150 (ec->is_on())?"ON":"OFF");
152 class cl_base *c= node->first_child();
155 show_error_cmd_print_node(con, indent+2, c);
156 c= node->next_child(c);
161 * Command: show error
162 *----------------------------------------------------------------------------
164 COMMAND_DO_WORK_APP(cl_show_error_cmd)
166 /*class cl_cmd_arg *parm= cmdline->param(0);
171 else if (cmdline->syntax_match(0, STRING)) {
172 s= parm->value.string.string;
175 con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
177 class cl_list *registered_errors = cl_error_registry::get_list();
179 for (i= 0; i < registered_errors->count; i++)
181 class cl_error_class *ec;
182 ec= dynamic_cast<class cl_error_class*>(registered_errors->object_at(i));
183 if (!ec->get_parent())
184 show_error_cmd_print_node(con, 0, ec);
190 /* End of cmd.src/show.cc */