#include <stdio.h>
#include "compilerDependencies.h"
#include "libComAPI.h"
Go to the source code of this file.
#define IOCSHFUNCDEF_HAS_USAGE |
typedef void(* iocshCallFunc) (const iocshArgBuf *argBuf) |
Enumerator |
---|
iocshArgInt |
|
iocshArgDouble |
|
iocshArgString |
|
iocshArgPdbbase |
|
iocshArgArgv |
|
iocshArgPersistentString |
|
Definition at line 30 of file iocsh.h.
LIBCOM_API int epicsStdCall iocsh |
( |
const char * |
pathname | ) |
|
shorthand for
1 iocshLoad(pathname, NULL)
Definition at line 1011 of file iocsh.cpp.
int epicsStdCall iocshLoad(const char *pathname, const char *macros)
LIBCOM_API int epicsStdCall iocshCmd |
( |
const char * |
cmd | ) |
|
shorthand for
Definition at line 1017 of file iocsh.cpp.
int epicsStdCall iocshRun(const char *cmd, const char *macros)
LIBCOM_API void epicsStdCall iocshEnvClear |
( |
const char * |
name | ) |
|
Definition at line 1054 of file iocsh.cpp.
1058 if (iocshContextId) {
1061 if (context !=
NULL) {
LIBCOM_API void *epicsStdCall epicsThreadPrivateGet(epicsThreadPrivateId)
long epicsStdCall macPutValue(MAC_HANDLE *handle, const char *name, const char *value)
Sets the value of a specific macro.
LIBCOM_API const iocshCmdDef* epicsStdCall iocshFindCommand |
( |
const char * |
name | ) |
|
Definition at line 154 of file iocsh.cpp.
LIBCOM_API void *epicsStdCall registryFind(void *registryID, const char *name)
LIBCOM_API const iocshVarDef* epicsStdCall iocshFindVariable |
( |
const char * |
name | ) |
|
Definition at line 222 of file iocsh.cpp.
225 return temp ? temp->
pVarDef : 0;
LIBCOM_API void *epicsStdCall registryFind(void *registryID, const char *name)
iocshVarDef const * pVarDef
LIBCOM_API void epicsStdCall iocshFree |
( |
void |
| ) |
|
Definition at line 231 of file iocsh.cpp.
237 for (pc = iocshCommandHead ; pc !=
NULL ; ) {
242 for (pv = iocshVariableHead ; pv !=
NULL ; ) {
247 iocshCommandHead =
NULL;
248 iocshVariableHead =
NULL;
struct iocshVariable * next
struct iocshCommand * next
LIBCOM_API int epicsStdCall iocshLoad |
( |
const char * |
pathname, |
|
|
const char * |
macros |
|
) |
| |
Read and evaluate IOC shell commands from the given file.
- Parameters
-
pathname | Path to script file |
macros | NULL or a comma seperated list of macro definitions. eg. "VAR1=x,VAR2=y" |
- Returns
- 0 on success, non-zero on error
Definition at line 1023 of file iocsh.cpp.
1027 return iocshBody(pathname,
NULL, macros);
LIBCOM_API void epicsStdCall epicsEnvSet(const char *name, const char *value)
Set an environment variable's value.
Definition at line 111 of file iocsh.cpp.
118 for (l =
NULL, p = iocshCommandHead ; p !=
NULL ; l = p, p = p->
next) {
119 i = strcmp (piocshFuncDef->
name, p->def.pFuncDef->name);
121 p->def.pFuncDef = piocshFuncDef;
138 n->
next = iocshCommandHead;
139 iocshCommandHead = n;
LIBCOM_API int epicsStdCall registryAdd(void *registryID, const char *name, void *data)
iocshFuncDef const * pFuncDef
struct iocshCommand * next
LIBCOM_API void * callocMustSucceed(size_t count, size_t size, const char *msg)
A calloc() that never returns NULL.
int errlogPrintf(const char *pFormat,...)
LIBCOM_API void epicsStdCall iocshRegisterVariable |
( |
const iocshVarDef * |
piocshVarDef | ) |
|
Definition at line 167 of file iocsh.cpp.
174 while ((piocshVarDef !=
NULL)
176 && (*piocshVarDef->
name !=
'\0')) {
177 if (iocshVariableHead ==
NULL)
180 for (l =
NULL, p = iocshVariableHead ; p !=
NULL ; l = p, p = p->
next) {
181 i = strcmp (piocshVarDef->
name, p->pVarDef->name);
183 if (p->pVarDef != piocshVarDef) {
184 errlogPrintf(
"Warning: iocshRegisterVariable redefining %s.\n",
186 p->pVarDef = piocshVarDef;
196 "iocshRegisterVariable");
200 errlogPrintf(
"iocshRegisterVariable failed to add %s.\n",
205 n->
next = iocshVariableHead;
206 iocshVariableHead = n;
LIBCOM_API int epicsStdCall registryAdd(void *registryID, const char *name, void *data)
void epicsStdCall iocshRegister(const iocshFuncDef *piocshFuncDef, iocshCallFunc func)
struct iocshVariable * next
LIBCOM_API void * callocMustSucceed(size_t count, size_t size, const char *msg)
A calloc() that never returns NULL.
int errlogPrintf(const char *pFormat,...)
iocshVarDef const * pVarDef
LIBCOM_API int epicsStdCall iocshRun |
( |
const char * |
cmd, |
|
|
const char * |
macros |
|
) |
| |
Evaluate a single IOC shell command
- Parameters
-
cmd | Command string. eg. "echo \"something or other""
\param macros NULL or a comma seperated list of macro definitions. eg. "VAR1=x,VAR2=y" |
- Returns
- 0 on success, non-zero on error
Definition at line 1031 of file iocsh.cpp.
1035 return iocshBody(
NULL, cmd, macros);
LIBCOM_API int iocshSetError |
( |
int |
err | ) |
|
Signal error from an IOC shell function.
- Parameters
-
err | 0 - success (no op), !=0 - error |
- Returns
- The err argument value.
Definition at line 536 of file iocsh.cpp.
539 if (err && iocshContextId) {
LIBCOM_API void *epicsStdCall epicsThreadPrivateGet(epicsThreadPrivateId)
LIBCOM_API struct dbBase** iocshPpdbbase |