Added check if a given command exists.

This commit is contained in:
Alan Mishchenko 2014-11-18 13:54:16 -08:00
parent d662e7ff68
commit c06bdc151c
2 changed files with 17 additions and 0 deletions

View File

@ -52,6 +52,7 @@ extern void Cmd_Init( Abc_Frame_t * pAbc );
extern void Cmd_End( Abc_Frame_t * pAbc );
/*=== cmdApi.c ========================================================*/
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 ABC_DLL int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand );
/*=== cmdFlag.c ========================================================*/

View File

@ -33,6 +33,22 @@ ABC_NAMESPACE_IMPL_START
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Cmd_CommandIsDefined( Abc_Frame_t * pAbc, const char * sName )
{
return st__is_member( pAbc->tCommands, sName );
}
/**Function*************************************************************
Synopsis []