Commit c06bdc15 by Alan Mishchenko

Added check if a given command exists.

parent d662e7ff
...@@ -52,6 +52,7 @@ extern void Cmd_Init( Abc_Frame_t * pAbc ); ...@@ -52,6 +52,7 @@ extern void Cmd_Init( Abc_Frame_t * pAbc );
extern void Cmd_End( Abc_Frame_t * pAbc ); extern void Cmd_End( Abc_Frame_t * pAbc );
/*=== cmdApi.c ========================================================*/ /*=== cmdApi.c ========================================================*/
typedef int (*Cmd_CommandFuncType)(Abc_Frame_t*, int, char**); typedef int (*Cmd_CommandFuncType)(Abc_Frame_t*, int, char**);
extern int Cmd_CommandIsDefined( Abc_Frame_t * pAbc, const char * sName );
extern void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges ); extern void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges );
extern ABC_DLL int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand ); extern ABC_DLL int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand );
/*=== cmdFlag.c ========================================================*/ /*=== cmdFlag.c ========================================================*/
......
...@@ -44,6 +44,22 @@ ABC_NAMESPACE_IMPL_START ...@@ -44,6 +44,22 @@ ABC_NAMESPACE_IMPL_START
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Cmd_CommandIsDefined( Abc_Frame_t * pAbc, const char * sName )
{
return st__is_member( pAbc->tCommands, sName );
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges ) void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges )
{ {
const char * key; const char * key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment