summaryrefslogtreecommitdiffstats
path: root/src/base/cmd/cmdApi.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2010-11-01 01:35:04 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2010-11-01 01:35:04 -0700
commit6130e39b18b5f53902e4eab14f6d5cdde5219563 (patch)
tree0db0628479a1b750e9af1f66cb8379ebd0913d31 /src/base/cmd/cmdApi.c
parentf0e77f6797c0504b0da25a56152b707d3357f386 (diff)
downloadabc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.gz
abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.bz2
abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.zip
initial commit of public abc
Diffstat (limited to 'src/base/cmd/cmdApi.c')
-rw-r--r--src/base/cmd/cmdApi.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/base/cmd/cmdApi.c b/src/base/cmd/cmdApi.c
index ae1949a6..40c1dbf9 100644
--- a/src/base/cmd/cmdApi.c
+++ b/src/base/cmd/cmdApi.c
@@ -18,9 +18,12 @@
***********************************************************************/
+#include "abc.h"
#include "mainInt.h"
#include "cmdInt.h"
-#include "abc.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -41,9 +44,10 @@
SeeAlso []
***********************************************************************/
-void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFunc, int fChanges )
+void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges )
{
- char * key, * value;
+ const char * key;
+ char * value;
Abc_Command * pCommand;
int fStatus;
@@ -61,7 +65,7 @@ void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFu
pCommand->sGroup = Extra_UtilStrsav( sGroup );
pCommand->pFunc = pFunc;
pCommand->fChange = fChanges;
- fStatus = st_insert( pAbc->tCommands, sName, (char *)pCommand );
+ fStatus = st_insert( pAbc->tCommands, pCommand->sName, (char *)pCommand );
assert( !fStatus ); // the command should not be in the table
}
@@ -76,10 +80,11 @@ void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFu
SeeAlso []
***********************************************************************/
-int Cmd_CommandExecute( Abc_Frame_t * pAbc, char * sCommand )
+int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand )
{
int fStatus = 0, argc, loop;
- char * sCommandNext, **argv;
+ const char * sCommandNext;
+ char **argv;
if ( !pAbc->fAutoexac )
Cmd_HistoryAddCommand(pAbc, sCommand);
@@ -102,3 +107,5 @@ int Cmd_CommandExecute( Abc_Frame_t * pAbc, char * sCommand )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+