Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
c06bdc15
Commit
c06bdc15
authored
Nov 18, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check if a given command exists.
parent
d662e7ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
src/base/cmd/cmd.h
+1
-0
src/base/cmd/cmdApi.c
+16
-0
No files found.
src/base/cmd/cmd.h
View file @
c06bdc15
...
...
@@ -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 ========================================================*/
...
...
src/base/cmd/cmdApi.c
View file @
c06bdc15
...
...
@@ -44,6 +44,22 @@ ABC_NAMESPACE_IMPL_START
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
)
{
const
char
*
key
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment