- Adapted indenation to new agreed upon system
- Added support for second generation scriptcontext based counter
This commit is contained in:
@@ -17,77 +17,77 @@
|
||||
---------------------------------------------------------------------------*/
|
||||
#ifndef DEFINE_ALIAS
|
||||
#define DEFINE_ALIAS
|
||||
#include "conman.h"
|
||||
#include "conman.h"
|
||||
#include "definealias.i"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
char *TranslateAlias(AliasList *pAList, char *pCmd);
|
||||
char *TranslateAlias(AliasList * pAList, char *pCmd);
|
||||
/*
|
||||
translate the command *pCmd
|
||||
- the translation may go through several steps
|
||||
- if no translation is found, the return value is equal to pCmd
|
||||
- no strings are copied
|
||||
- the return value becomes invalid when the corresponding alias is removed
|
||||
- *pCmd must be lowercase
|
||||
*/
|
||||
translate the command *pCmd
|
||||
- the translation may go through several steps
|
||||
- if no translation is found, the return value is equal to pCmd
|
||||
- no strings are copied
|
||||
- the return value becomes invalid when the corresponding alias is removed
|
||||
- *pCmd must be lowercase
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int RemoveAlias(AliasList *pAList, char *pCmd);
|
||||
int RemoveAlias(AliasList * pAList, char *pCmd);
|
||||
/*
|
||||
remove the alias *pCmd
|
||||
- returns 1 when the alias existed, 0 otherwise
|
||||
- *pCmd must be lowercase
|
||||
*/
|
||||
remove the alias *pCmd
|
||||
- returns 1 when the alias existed, 0 otherwise
|
||||
- *pCmd must be lowercase
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void FreeAliasList(AliasList *pAList);
|
||||
void FreeAliasList(AliasList * pAList);
|
||||
/*
|
||||
dispose the alias list
|
||||
*/
|
||||
dispose the alias list
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
char *CreateAlias(AliasList *pAList, char *pName, char *pTranslation);
|
||||
char *CreateAlias(AliasList * pAList, char *pName, char *pTranslation);
|
||||
|
||||
/*
|
||||
create a new alias *pName with the translation *pTranslation
|
||||
create a new alias *pName with the translation *pTranslation
|
||||
|
||||
- the alias *pName must not yet exist
|
||||
- *pTranslation is translated first
|
||||
- recursive definitions are prohibited
|
||||
- *pName and *pTranslation must be lowercase
|
||||
- the alias *pName must not yet exist
|
||||
- *pTranslation is translated first
|
||||
- recursive definitions are prohibited
|
||||
- *pName and *pTranslation must be lowercase
|
||||
|
||||
if the creation is successful, the return value is NULL, otherwise
|
||||
it points to one of the following error messages:
|
||||
if the creation is successful, the return value is NULL, otherwise
|
||||
it points to one of the following error messages:
|
||||
|
||||
"recursive alias not allowed"
|
||||
"alias already exists"
|
||||
"not enough memory to create an alias"
|
||||
"recursive alias not allowed"
|
||||
"alias already exists"
|
||||
"not enough memory to create an alias"
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int DefineAlias(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int DefineAlias(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int argc, char *argv[]);
|
||||
|
||||
/* this command requires manager privileges
|
||||
|
||||
argv[1]: the alias to define
|
||||
- must not be a proper SICS command
|
||||
- if an alias with this name exists already, it is removed first
|
||||
argv[1]: the alias to define
|
||||
- must not be a proper SICS command
|
||||
- if an alias with this name exists already, it is removed first
|
||||
|
||||
argv[2]: the original command
|
||||
- if omitted, the alias is removed
|
||||
- if it is an alias the definiton refers to it's translation
|
||||
- may be an unknown command (probably defined later)
|
||||
argv[2]: the original command
|
||||
- if omitted, the alias is removed
|
||||
- if it is an alias the definiton refers to it's translation
|
||||
- may be an unknown command (probably defined later)
|
||||
|
||||
- AddCommand removes an eventual alias matching the command name
|
||||
- AddCommand removes an eventual alias matching the command name
|
||||
|
||||
- RemoveCommand does not remove it's aliases
|
||||
Trying to use an alias of a removed command leads to the error message
|
||||
"object > ... < NOT found"
|
||||
- RemoveCommand does not remove it's aliases
|
||||
Trying to use an alias of a removed command leads to the error message
|
||||
"object > ... < NOT found"
|
||||
|
||||
- trying to define a recursive alias leads the error message
|
||||
"recursive alias not allowed"
|
||||
*/
|
||||
- trying to define a recursive alias leads the error message
|
||||
"recursive alias not allowed"
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user