2 * Simulator of microcontrollers (option.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
42 * Base class for option's objects
43 *____________________________________________________________________________
47 cl_option::cl_option(void *opt, char *Iid, char *Ihelp):
55 cl_option::~cl_option(void)
64 *____________________________________________________________________________
68 cl_bool_opt::cl_bool_opt(bool *opt, char *Iid, char *Ihelp):
69 cl_option(opt, Iid, Ihelp)
73 cl_bool_opt::print(class cl_console *con)
82 cl_bool_opt::get_value(void)
84 return(*((bool *)option));
88 cl_bool_opt::set_value(bool opt)
90 *((bool *)option)= opt;
94 cl_bool_opt::set_value(char *s)
104 *(bool *)option= DD_TRUE;
106 *(bool *)option= DD_FALSE;
115 cl_cons_debug_opt::cl_cons_debug_opt(class cl_app *the_app,
118 cl_option(0, Iid, Ihelp)
124 cl_cons_debug_opt::print(class cl_console *con)
126 if (/*sim->cmd->actual_console &&
127 sim->cmd->actual_console*/con->flags & CONS_DEBUG)
130 con->printf("FALSE");
134 cl_cons_debug_opt::get_value(void)
136 return(app->get_commander()->actual_console?
137 (app->get_commander()->actual_console->flags & CONS_DEBUG):
142 cl_cons_debug_opt::set_value(bool opt)
144 if (app->get_commander()->actual_console)
147 app->get_commander()->actual_console->flags|= CONS_DEBUG;
149 app->get_commander()->actual_console->flags&= ~CONS_DEBUG;
155 cl_cons_debug_opt::set_value(char *s)
160 app->get_commander()->actual_console)
166 app->get_commander()->actual_console->flags|= CONS_DEBUG;
168 app->get_commander()->actual_console->flags&= ~CONS_DEBUG;
173 /* End of option.cc */