/*struct id_element option_type_names[]= {
- { non_opt , "non" },
- { integer_opt , "integer" },
- { float_opt , "float" },
- { bool_opt , "boolean" },
- { string_opt , "string" },
- { pointer_opt , "pointer" },
+ { non_opt , "non" },
+ { integer_opt , "integer" },
+ { float_opt , "float" },
+ { bool_opt , "boolean" },
+ { string_opt , "string" },
+ { pointer_opt , "pointer" },
{ 0, 0 }
};*/
idx--;
o= (class cl_option *)(at(idx));
while (compare(the_name, key_of(o)) == 0 &&
- idx > 0)
- {
- idx--;
- o= (class cl_option *)(at(idx));
- }
+ idx > 0)
+ {
+ idx--;
+ o= (class cl_option *)(at(idx));
+ }
if (compare(the_name, key_of(o)) != 0)
- idx++;
+ idx++;
}
o= (class cl_option *)(at(idx));
while (compare(the_name, key_of(o)) == 0 &&
- o->get_creator() != creator &&
- idx < count)
+ o->get_creator() != creator &&
+ idx < count)
{
idx++;
o= (class cl_option *)(at(idx));
if (compare(the_name, key_of(o)) == 0 &&
- o->get_creator() == creator)
- return(o);
+ o->get_creator() == creator)
+ return(o);
}
if (compare(the_name, key_of(o)) == 0 &&
o->get_creator() == creator)
idx--;
o= (class cl_option *)(at(idx));
while (compare(the_name, key_of(o)) == 0 &&
- idx > 0)
- {
- idx--;
- o= (class cl_option *)(at(idx));
- }
+ idx > 0)
+ {
+ idx--;
+ o= (class cl_option *)(at(idx));
+ }
if (compare(the_name, key_of(o)) != 0)
- idx++;
+ idx++;
}
o= (class cl_option *)(at(idx));
while (compare(the_name, key_of(o)) == 0 &&
- strcmp(object_name(o->get_creator()), creator) != 0 &&
- idx < count)
+ strcmp(object_name(o->get_creator()), creator) != 0 &&
+ idx < count)
{
idx++;
o= (class cl_option *)(at(idx));
if (compare(the_name, key_of(o)) == 0 &&
- strcmp(object_name(o->get_creator()), creator) == 0)
- return(o);
+ strcmp(object_name(o->get_creator()), creator) == 0)
+ return(o);
}
if (compare(the_name, key_of(o)) == 0 &&
strcmp(object_name(o->get_creator()), creator) == 0)
{
class cl_option *o= (class cl_option *)(at(i));
if (strcmp(the_name, o->get_name()) == 0)
- n++;
+ n++;
}
return(n);
}
{
class cl_option *o= (class cl_option *)(at(i));
if (strcmp(the_name, o->get_name()) == 0 &&
- strcmp(creator, object_name(o->get_creator())) == 0)
- n++;
+ strcmp(creator, object_name(o->get_creator())) == 0)
+ n++;
}
return(n);
}
{
option->del_reference(this);
if (option->get_creator() == owner)
- application->options->del_option(option);
+ application->options->del_option(option);
}
}
class cl_option *
cl_optref::create(class cl_base *creator,
- enum option_type type,
- char *the_name, char *help)
+ enum option_type type,
+ char *the_name, char *help)
{
if (option)
option->del_reference(this);
if (!option)
{
fprintf(stderr, "Warning: \"%s\" is sdereferencing a non-existent "
- "bool option: %s\n", object_name(owner), get_name());
+ "bool option: %s\n", object_name(owner), get_name());
return(DD_FALSE);
}
else
if (!option)
{
fprintf(stderr, "Warning: \"%s\" is sdereferencing a non-existent "
- "string option: %s\n", object_name(owner), get_name());
+ "string option: %s\n", object_name(owner), get_name());
return(0);
}
else
if (!option)
{
fprintf(stderr, "Warning: \"%s\" is sdereferencing a non-existent "
- "pointer option: %s\n", object_name(owner), get_name());
+ "pointer option: %s\n", object_name(owner), get_name());
return(NIL);
}
else
if (!option)
{
fprintf(stderr, "Warning: \"%s\" is sdereferencing a non-existent "
- "number option: %s\n", object_name(owner), get_name());
+ "number option: %s\n", object_name(owner), get_name());
return(0);
}
else
if (!option)
{
fprintf(stderr, "Warning: \"%s\" is sdereferencing a non-existent "
- "float option: %s\n", object_name(owner), get_name());
+ "float option: %s\n", object_name(owner), get_name());
return(0);
}
else
*/
cl_bool_option::cl_bool_option(class cl_base *the_creator,
- char *aname, char *Ihelp):
+ char *aname, char *Ihelp):
cl_option(the_creator, aname, Ihelp)
{}
void
-cl_bool_option::print(class cl_console *con)
+cl_bool_option::print(class cl_console_base *con)
{
if (/**(bool *)option*/value.bval)
con->dd_printf("TRUE");
{
c= toupper(*s);
if (c == '1' ||
- c == 'T' ||
- c == 'Y')
- /**(bool *)option=*/ value.bval= DD_TRUE;
+ c == 'T' ||
+ c == 'Y')
+ /**(bool *)option=*/ value.bval= DD_TRUE;
else
- /**(bool *)option=*/ value.bval= DD_FALSE;
+ /**(bool *)option=*/ value.bval= DD_FALSE;
}
inform_users();
}
*/
cl_string_option::cl_string_option(class cl_base *the_creator,
- char *aname, char *Ihelp):
+ char *aname, char *Ihelp):
cl_option(the_creator, aname, Ihelp)
{}
}
void
-cl_string_option::print(class cl_console *con)
+cl_string_option::print(class cl_console_base *con)
{
if (/**(bool *)option*/value.sval)
con->dd_printf("\"%s\"", value.sval);
*/
cl_pointer_option::cl_pointer_option(class cl_base *the_creator,
- char *aname, char *Ihelp):
+ char *aname, char *Ihelp):
cl_option(the_creator, aname, Ihelp)
{}
}
void
-cl_pointer_option::print(class cl_console *con)
+cl_pointer_option::print(class cl_console_base *con)
{
if (value.pval)
con->dd_printf("\"%p\"", value.pval);
*/
/*
cl_cons_debug_opt::cl_cons_debug_opt(class cl_app *the_app,
- char *Iid,
- char *Ihelp):
+ char *Iid,
+ char *Ihelp):
cl_option(0, Iid, Ihelp)
{
app= the_app;
}
void
-cl_cons_debug_opt::print(class cl_console *con)
+cl_cons_debug_opt::print(class cl_console_base *con)
{
if (con->flags & CONS_DEBUG)
con->dd_printf("TRUE");
if (app->get_commander()->actual_console)
{
if (opt)
- app->get_commander()->actual_console->flags|= CONS_DEBUG;
+ app->get_commander()->actual_console->flags|= CONS_DEBUG;
else
- app->get_commander()->actual_console->flags&= ~CONS_DEBUG;
+ app->get_commander()->actual_console->flags&= ~CONS_DEBUG;
}
inform_users();
}
{
c= toupper(*s);
if (c == '1' ||
- c == 'T' ||
- c == 'Y')
- set_value(1);
+ c == 'T' ||
+ c == 'Y')
+ set_value(1);
else
- set_value(0);
+ set_value(0);
}
}
*/
*/
cl_number_option::cl_number_option(class cl_base *the_creator,
- char *aname, char *Ihelp):
+ char *aname, char *Ihelp):
cl_option(the_creator, aname, Ihelp)
{}
void
-cl_number_option::print(class cl_console *con)
+cl_number_option::print(class cl_console_base *con)
{
con->dd_printf("%ld", value.ival);
}
*/
cl_float_option::cl_float_option(class cl_base *the_creator,
- char *aname, char *Ihelp):
+ char *aname, char *Ihelp):
cl_option(the_creator, aname, Ihelp)
{}
void
-cl_float_option::print(class cl_console *con)
+cl_float_option::print(class cl_console_base *con)
{
con->dd_printf("%.3f", value.fval);
}