ug4
|
the shell for ug4 More...
Functions | |
int | ug::bridge::CompletionFunction (char *buf, int len, int buflen, int iPrintCompletionList) |
A function to implement word completion of classes and functions of ugscript When entered Dom<tab>, it completes to Domain2d, for example. If Domain2d and Domain3d are registered, it completes to Domain and shows suggestions Domain2d and Domain3d. currently only works with Linenoise. todo: - not all completions must have same snipped length. change. More... | |
static size_t | ug::bridge::GetClassesCompletitions (char *buf, int len, std::vector< string > &matches, size_t &sniplen, int iPrintCompletionList) |
static bool | ug::bridge::GetGlobalFunctionInfo (char *buf, int len) |
static size_t | ug::bridge::GetGlobalsCompletitions (char *buf, int len, std::vector< string > &matches, size_t &sniplen, int iPrintCompletionList) |
static size_t | ug::bridge::GetMemberFunctionCompletitions (char *buf, int len, std::vector< string > &matches, size_t &sniplen) |
static bool | ug::bridge::GetMemberFunctionInfo (char *buf, int len) |
static size_t | ug::bridge::GetNamespaceCompletitions (char *buf, int len, std::vector< string > &matches, size_t &sniplen, int iPrintCompletionList) |
static size_t | ug::bridge::GetOtherCompletitions (char *buf, int len, std::vector< string > &matches, size_t &sniplen) |
size_t | ug::bridge::GetPathCompletitions (char *buf, int len, std::vector< string > &matches, size_t &sniplen) |
void | quit_all_mpi_procs_in_parallel () |
void | ug::bridge::SetOtherCompletions (const char **otherCompletions, int nr) |
void | ug_check_registry (bool &errorOccurred) |
void | ug_init_bridge (bool &errorOccurred) |
void | ug_init_luashell (int argc, char *argv[]) |
void | ug_init_path (char *argv[], bool &errorOccurred) |
void | ug_init_plugins (bool &errorOccurred) |
bool | ugshell_get_call_command (int argc, char *argv[], std::string &callCommand) |
int | ugshell_main (int argc, char *argv[]) |
void | ugshell_print_header () |
Variables | |
static const char * | errSymb = " % " |
the shell for ug4
int ug::bridge::CompletionFunction | ( | char * | buf, |
int | len, | ||
int | buflen, | ||
int | iPrintCompletionList | ||
) |
A function to implement word completion of classes and functions of ugscript When entered Dom<tab>, it completes to Domain2d, for example. If Domain2d and Domain3d are registered, it completes to Domain and shows suggestions Domain2d and Domain3d. currently only works with Linenoise. todo: - not all completions must have same snipped length. change.
buf | buffer from linenoise to complete |
len | length of the buf |
buflen | maximal length of the buffer buf |
iPrintCompletitionList | number of times <tab> has been pushed, so we can display next 5 matches each time <tab> has been pushed. |
References ug::bridge::GetClassesCompletitions(), ug::bridge::GetGlobalFunctionInfo(), ug::bridge::GetGlobalsCompletitions(), ug::bridge::GetMemberFunctionCompletitions(), ug::bridge::GetMemberFunctionInfo(), ug::bridge::GetNamespaceCompletitions(), ug::bridge::GetOtherCompletitions(), ug::bridge::GetPathCompletitions(), and printf().
Referenced by ug::bridge::InitShell().
|
static |
References ug::bridge::Registry::get_class(), ug::bridge::Registry::get_class_group(), ug::bridge::GetUGRegistry(), ug::bridge::ClassGroupDesc::name(), ug::bridge::IExportedClass::name(), ug::bridge::Registry::num_class_groups(), ug::bridge::Registry::num_classes(), p, UG_LOG, and ug::bridge::UGTypeInfo().
Referenced by ug::bridge::CompletionFunction().
|
static |
GetGlobalFunctionInfo if buf is something like "function(", we print the function info (like "void function(number a, number b)")
References ug::bridge::FunctionInfo(), ug::script::GetDefaultLuaState(), ug::bridge::GetUGRegistry(), LUA_STACK_CHECK, p, print(), and printf().
Referenced by ug::bridge::CompletionFunction().
|
static |
GetGlobalsCompletitions searches in the Lua string table for string that completes the string in buf if they are also globals, we add them to vector<string> matches.
buf | the buffer to complete |
len | the length of buf |
matches | put your matches here |
sniplen | how much of buf we use (for example, completing "ex" to "example" is 2, completing "examp" to "example" is 5) |
References ug::script::GetDefaultLuaState(), LUA_STACK_CHECK, p, UG_LOG, and ug::bridge::UGTypeInfo().
Referenced by ug::bridge::CompletionFunction().
|
static |
GetMemberFunctionCompletitions gets completion of the word in p, based on the classname which is before p, and puts matching completions in matches.
buf | the buffer to complete |
len | the length of buf |
matches | put your matches here |
sniplen | how much of buf we use (for example, completing "ex" to "example" is 2, completing "examp" to "example" is 5) |
References ug::bridge::Registry::get_class(), ug::bridge::IExportedClass::get_const_method(), ug::bridge::IExportedClass::get_method(), ug::bridge::GetClassNames(), ug::script::GetDefaultLuaState(), ug::bridge::GetUGRegistry(), LUA_STACK_CHECK, name, ug::bridge::ExportedFunctionBase::name(), ug::bridge::IExportedClass::num_const_methods(), ug::bridge::IExportedClass::num_methods(), p, and UG_ASSERT.
Referenced by ug::bridge::CompletionFunction().
|
static |
GetMemberFunctionInfo if buf is something like "instance:function(", we print the function info (like "void class::function(number a, number b)")
References ug::bridge::FunctionInfo(), ug::bridge::Registry::get_class(), ug::bridge::IExportedClass::get_const_method(), ug::bridge::IExportedClass::get_method(), ug::bridge::GetClassNames(), ug::script::GetDefaultLuaState(), ug::bridge::GetUGRegistry(), LUA_STACK_CHECK, name, ug::bridge::ExportedFunctionBase::name(), ug::bridge::IExportedClass::num_const_methods(), ug::bridge::IExportedClass::num_methods(), p, print(), printf(), and UG_ASSERT.
Referenced by ug::bridge::CompletionFunction().
|
static |
GetNamespaceCompletitions gets completion of the word in p, e.g. for math.pi (with '.') and puts matching completions in matches.
buf | the buffer to complete |
len | the length of buf |
matches | put your matches here |
sniplen | how much of buf we use (for example, completing "ex" to "example" is 2, completing "examp" to "example" is 5) |
References ug::script::GetDefaultLuaState(), ug::bridge::GetLuaNamespace(), LUA_STACK_CHECK, name, p, UG_ASSERT, UG_LOG, and ug::bridge::UGTypeInfo().
Referenced by ug::bridge::CompletionFunction().
|
static |
GetOtherCompletitions puts in matches completitions of user-provided strings like "quit", "continue" etc.
buf | the buffer to complete |
len | the length of buf |
matches | put your matches here |
sniplen | how much of buf we use (for example, completing "ex" to "example" is 2, completing "examp" to "example" is 5) |
use pOtherCompletitions and iOtherCompletitionsLength to set an array with user-provided completition strings.
References ug::bridge::iOtherCompletitionsLength, p, and ug::bridge::pOtherCompletitions.
Referenced by ug::bridge::CompletionFunction().
size_t ug::bridge::GetPathCompletitions | ( | char * | buf, |
int | len, | ||
std::vector< string > & | matches, | ||
size_t & | sniplen | ||
) |
GetPathCompletitions puts in matches completitions of path in buf if possible
buf | the buffer to complete |
len | the length of buf |
matches | put your matches here |
sniplen | how much of buf we use (for example, completing "ex" to "example" is 2, completing "examp" to "example" is 5) |
References p.
Referenced by ug::bridge::CompletionFunction().
void quit_all_mpi_procs_in_parallel | ( | ) |
References pcl::Abort(), errSymb, pcl::NumProcs(), and UG_LOG.
Referenced by ugshell_main().
void ug::bridge::SetOtherCompletions | ( | const char ** | otherCompletions, |
int | nr | ||
) |
References ug::bridge::iOtherCompletitionsLength, and ug::bridge::pOtherCompletitions.
Referenced by ug::bridge::DebugShell(), and ug::bridge::RunShell().
void ug_check_registry | ( | bool & | errorOccurred | ) |
void ug_init_bridge | ( | bool & | errorOccurred | ) |
References ug::UGError::get_file(), ug::UGError::get_line(), ug::UGError::get_msg(), ug::bridge::InitBridge(), ug::UGError::num_msg(), UG_ERR_LOG, and UG_LOG.
Referenced by ugshell_main().
void ug_init_luashell | ( | int | argc, |
char * | argv[] | ||
) |
References ug::script::GetDefaultLuaState(), ug::bridge::InitShell(), ug::script::RegisterStdLUAFunctions(), ug::script::SetLuaDebugIDs(), and ug::script::SetLuaUGArgs().
Referenced by ugshell_main().
void ug_init_path | ( | char * | argv[], |
bool & | errorOccurred | ||
) |
References ug::UGError::get_file(), ug::UGError::get_line(), ug::UGError::get_msg(), ug::InitPaths(), LOG, ug::UGError::num_msg(), UG_ERR_LOG, and UG_LOG.
Referenced by ugshell_main().
void ug_init_plugins | ( | bool & | errorOccurred | ) |
References ug::UGError::get_file(), ug::UGError::get_line(), ug::UGError::get_msg(), ug::UGError::num_msg(), UG_ERR_LOG, UG_LOG, and ug::UGInitPlugins().
Referenced by ugshell_main().
bool ugshell_get_call_command | ( | int | argc, |
char * | argv[], | ||
std::string & | callCommand | ||
) |
References ug::GetParamIndex().
Referenced by ugshell_main().
int ugshell_main | ( | int | argc, |
char * | argv[] | ||
) |
References ug::UGProfileNode::CheckForTooSmallNodes(), ug::LogAssistant::enable_file_output(), ug::LogAssistant::enable_terminal_output(), ug::EnableMemTracker(), errSymb, ug::FindParam(), ug::UGError::get_file(), ug::UGError::get_line(), ug::UGError::get_msg(), ug::GetLogAssistant(), ug::GetParamIndex(), pcl::Init(), ug::script::LoadUGScript_Parallel(), LOG, ug::UGError::num_msg(), pcl::NumProcs(), ug::ParamToInt(), ug::ParamToString(), ug::script::ParseAndExecuteBuffer(), PROFILE_BEGIN, PROFILE_END, PROFILE_FUNC, quit_all_mpi_procs_in_parallel(), ug::bridge::RunShell(), ug::LogAssistant::set_output_process(), ug::SetAppsPath(), ug::SetPluginPath(), ug::SetRootPath(), ug::SetScriptPath(), ug_check_registry(), ug_init_bridge(), ug_init_luashell(), ug_init_path(), ug_init_plugins(), UG_LOG, ug::UGFinalize(), ug::UGOutputProfileStatsOnExit(), ugshell_get_call_command(), and ugshell_print_header().
Referenced by main().
void ugshell_print_header | ( | ) |
References append(), ug::AppendSpacesToString(), LOG, ug::UGBuildHost(), ug::UGCompileDate(), ug::UGGetVersionString(), and ug::UGGitRevision().
Referenced by ugshell_main().
|
static |
Referenced by quit_all_mpi_procs_in_parallel(), and ugshell_main().