user definable flags for commands

master
Daniel Kolesa 2015-10-10 21:22:56 +01:00
parent fb11619ef7
commit 352dfd58f6
2 changed files with 6 additions and 5 deletions

View File

@ -929,7 +929,7 @@ void CsState::set_var_str_checked(Ident *id, ostd::ConstCharRange v) {
}
bool CsState::add_command(ostd::ConstCharRange name, ostd::ConstCharRange args,
IdentFunc func, int type) {
IdentFunc func, int type, int flags) {
ostd::Uint32 argmask = 0;
int nargs = 0;
bool limit = true;
@ -979,7 +979,7 @@ bool CsState::add_command(ostd::ConstCharRange name, ostd::ConstCharRange args,
name, nargs);
return false;
}
add_ident(type, name, args, argmask, nargs, func);
add_ident(type, name, args, argmask, nargs, func, flags);
return true;
}

View File

@ -380,13 +380,14 @@ struct CsState {
template<typename F>
bool add_command(ostd::ConstCharRange name, ostd::ConstCharRange args,
F func, int type = ID_COMMAND) {
F func, int type = ID_COMMAND, int flags = 0) {
return add_command(name, args,
(IdentFunc)(ostd::FunctionMakeDefaultConstructible<F>)func, type);
(IdentFunc)(ostd::FunctionMakeDefaultConstructible<F>)func,
type, flags);
}
bool add_command(ostd::ConstCharRange name, ostd::ConstCharRange args,
IdentFunc func, int type = ID_COMMAND);
IdentFunc func, int type = ID_COMMAND, int flags = 0);
ostd::String run_str(const ostd::Uint32 *code);
ostd::String run_str(ostd::ConstCharRange code);