- Fixed conflicts in ascon.c
- Supressed superfluous message from fmess - Expanded multicounter to deal with threshold commands nicely - Fixed an an issue with an uninitialized dummy connection in nserver - Many changes to simidex to make it work in a more reliable way. - Added hdbfactory path alias targetpath - Extended frame to deal with sinqhttp HM
This commit is contained in:
36
macro.c
36
macro.c
@@ -1062,3 +1062,39 @@ 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, "EROOR: out of memory in capture", eError);
|
||||
return 0;
|
||||
}
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user