Remove old multichanfactory

r1964 | dcl | 2007-05-15 13:14:25 +1000 (Tue, 15 May 2007) | 2 lines
This commit is contained in:
Douglas Clowes
2007-05-15 13:14:25 +10:00
parent 27d849ea23
commit 1ea715020a

View File

@@ -865,68 +865,6 @@ int AsyncQueueFactory(SConnection *pCon, SicsInterp *pSics,
return 1;
}
int MultiChanFactory(SConnection *pCon, SicsInterp *pSics,
void *pData, int argc, char *argv[])
{
pAsyncQueue pNew = NULL;
int iRet, status;
char pError[256];
if(argc < 3)
{
SCWrite(pCon,"ERROR: insufficient no of arguments to AsyncQueueFactory",
eError);
return 0;
}
/* try to find an existing queue with this name */
pNew = (pAsyncQueue) FindCommandData(pServ->pSics, argv[1], "AsyncQueue");
if (pNew != NULL) {
char line[132];
snprintf(line, 132, "ERROR: AsyncQueue '%s' already exists", argv[1]);
SCWrite(pCon, line, eError);
return 1;
}
/*
create data structure and open port
*/
if (argc > 3)
pNew = AQ_Create(argv[2], argv[3]);
else
pNew = AQ_Create(argv[2], NULL) ;
if(!pNew)
{
SCWrite(pCon,"ERROR: failed to create AsyncQueue in AsyncQueueFactory",eError);
return 0;
}
if (pNew->queue_name)
free(pNew->queue_name);
pNew->queue_name = strdup(argv[1]);
status = AQ_Init(pNew);
if(status != 1)
{
sprintf(pError,"ERROR: failed to connect to %s at port %d",
pNew->pHost, pNew->iPort);
SCWrite(pCon,pError,eError);
}
/*
create the command
*/
iRet = AddCommand(pSics, argv[1], AsyncQueueAction, AQ_Kill, pNew);
if(!iRet)
{
sprintf(pError,"ERROR: duplicate command %s not created", argv[1]);
SCWrite(pCon,pError,eError);
AQ_Kill(pNew);
return 0;
}
return 1;
}
/*
* \brief make a AsyncQueue from a named rs232 controller
*