- Removed defunct capture command

- Moved some protocolls from sicspsi to kernel as discussed at ANSTO
This commit is contained in:
2015-04-20 09:08:34 +02:00
parent c2f08097da
commit e577d9c313
5 changed files with 889 additions and 42 deletions

41
macro.c
View File

@@ -1095,44 +1095,3 @@ int TransactAction(SConnection * pCon, SicsInterp * pSics, void *pData,
SCWrite(pCon, "TRANSACTIONFINISHED", eLog);
return iRet;
}
/*-----------------------------------------------------------------------------*/
int CaptureAction(SConnection *pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[])
{
SConnection *comCon = NULL;
char buffer[1024];
char *command;
int status;
pDynString reply = NULL;
if (argc < 2) {
SCWrite(pCon, "ERROR: insufficient arguments to capture", eError);
return 0;
}
comCon = SCCopyConnection(pCon);
if (comCon == NULL) {
SCWrite(pCon, "ERROR: out of memory in capture", eError);
return 0;
}
/*
* This line is required to support nested captures
*/
comCon->data = NULL;
memset(buffer, 0, sizeof(buffer));
command = Arg2Tcl(argc - 1, &argv[1], buffer, sizeof buffer);
if (!command) {
SCWrite(pCon, "ERROR: no more memory", eError);
return 0;
}
SCStartBuffering(comCon);
status = InterpExecute(pSics, comCon, command);
if (command != buffer)
free(command);
reply = SCEndBuffering(comCon);
SCWrite(pCon,GetCharArray(reply), eValue);
SCDeleteConnection(comCon);
return status;
}