EPICS Base 7.0.8.0
|
C and C++ defintions of functions for IOC shell programming. More...
Go to the source code of this file.
Classes | |
union | iocshArgBuf |
struct | iocshVarDef |
struct | iocshArg |
struct | iocshFuncDef |
struct | iocshCmdDef |
Macros | |
#define | IOCSH_STATIC_FUNC static EPICS_ALWAYS_INLINE |
#define | IOCSHFUNCDEF_HAS_USAGE |
Typedefs | |
typedef void(* | iocshCallFunc) (const iocshArgBuf *argBuf) |
Enumerations | |
enum | iocshArgType { iocshArgInt , iocshArgDouble , iocshArgString , iocshArgPdbbase , iocshArgArgv , iocshArgPersistentString , iocshArgStringRecord , iocshArgStringPath } |
Functions | |
LIBCOM_API void epicsStdCall | iocshRegister (const iocshFuncDef *piocshFuncDef, iocshCallFunc func) |
This function is used to register a command with the IOC shell. | |
LIBCOM_API void epicsStdCall | iocshRegisterVariable (const iocshVarDef *piocshVarDef) |
LIBCOM_API const iocshCmdDef *epicsStdCall | iocshFindCommand (const char *name) EPICS_DEPRECATED |
Returns a struct of type iocshCmdDef whose element values are determined by the name parameter. This function calls the function registryFind, defined in Registry.h. | |
LIBCOM_API const iocshVarDef *epicsStdCall | iocshFindVariable (const char *name) |
Returns a struct of type iocshVarDef whose element values are determined by the name parameter. This function calls the function registryFind, defined in Registry.h. | |
LIBCOM_API void epicsStdCall | iocshFree (void) |
Frees all memory allocated to registered commands and variables. | |
LIBCOM_API int epicsStdCall | iocsh (const char *pathname) |
This function is used to execute IOC shell commands from a file. | |
LIBCOM_API int epicsStdCall | iocshCmd (const char *cmd) |
This function is used to exectute a single IOC shell command. | |
LIBCOM_API int epicsStdCall | iocshLoad (const char *pathname, const char *macros) |
Read and evaluate IOC shell commands from the given file. A list of macros can be supplied as a parameter. These macros are treated as environment variables during exectution of the file's commands. | |
LIBCOM_API int epicsStdCall | iocshRun (const char *cmd, const char *macros) |
Evaluate a single IOC shell command. A list of macros can be supplied as a parameter. These macros are treated as environment variables during exectution of the command. | |
LIBCOM_API int | iocshSetError (int err) |
Signal error from an IOC shell function. | |
LIBCOM_API void epicsStdCall | iocshEnvClear (const char *name) |
Unsets macro values. | |
Variables | |
LIBCOM_API struct dbBase ** | iocshPpdbbase |
The iocsh API provides an interface for running commands in the shell of the IOC, as well as registering commands and variables for use in the shell. It consists of 4 functions for the former and 2 functions for the latter.
Definition in file iocsh.h.
This typedef lists the values that can be used as argument data types when building the piocshFuncDef parameter of iocshRegister().
LIBCOM_API void epicsStdCall iocshRegister | ( | const iocshFuncDef * | piocshFuncDef, |
iocshCallFunc | func | ||
) |
piocshFuncDef | A pointer to a data structure that describes the command and its arguments. |
func | A pointer to a function which is called by iocsh() when the command is encountered. |
LIBCOM_API void epicsStdCall iocshRegisterVariable | ( | const iocshVarDef * | piocshVarDef | ) |
piocshVarDef |
LIBCOM_API const iocshCmdDef *epicsStdCall iocshFindCommand | ( | const char * | name | ) |
name |
LIBCOM_API const iocshVarDef *epicsStdCall iocshFindVariable | ( | const char * | name | ) |
name |
Commands are read from the file until and exit command is encountered or the end-of-file character is reached.
pathname | A string that represents the path to a file from which commands are read. |
Equivalent to:
cmd | A string that represents the command to be executed. |
Equivalent to:
pathname | A string that represents the path to a file from which commands are read. |
macros | NULL or a comma separated list of macro definitions. eg. "VAR1=x,VAR2=y" |
cmd | Command string. eg. "echo \"something or other\"" |
macros | NULL or a comma separated list of macro definitions. eg. "VAR1=x,VAR2=y" |
err | 0 - success (no op), !=0 - error |