Cleaned up ANSTO code to merge with sinqdev.sics

This is our new RELEASE-4_0 branch which was taken from ansto/93d9a7c
Conflicts:
	.gitignore
	SICSmain.c
	asynnet.c
	confvirtualmot.c
	counter.c
	devexec.c
	drive.c
	event.h
	exebuf.c
	exeman.c
	histmem.c
	interface.h
	motor.c
	motorlist.c
	motorsec.c
	multicounter.c
	napi.c
	napi.h
	napi4.c
	network.c
	nwatch.c
	nxscript.c
	nxxml.c
	nxxml.h
	ofac.c
	reflist.c
	scan.c
	sicshipadaba.c
	sicsobj.c
	site_ansto/docs/Copyright.txt
	site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl
	site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl
	statusfile.c
	tasdrive.c
	tasub.c
	tasub.h
	tasublib.c
	tasublib.h
This commit is contained in:
Ferdi Franceschini
2015-04-23 20:49:26 +10:00
parent c650788a2c
commit 10d29d597c
1336 changed files with 9430 additions and 226646 deletions

View File

@ -290,7 +290,7 @@ static int ProtocolSet(SConnection * pCon, Protocol * pPro, char *pProName)
SCSetWriteFunc(pCon, SCWriteJSON_String);
SCSetWriteFunc(pMaster, SCWriteJSON_String);
break;
case 5:
case 5: /* ACT */
SCSetWriteFunc(pMaster, SCACTWrite);
SCSetWriteFunc(pCon, SCACTWrite);
break;
@ -489,12 +489,15 @@ int SCWriteSycamore(SConnection * pCon, char *pBuffer, int iOut)
return 0;
}
iRet=snprintf(pBueffel,sizeof(pBueffel)-1, "[%d]:%s", pCon->sockHandle, pBuffer);
SICSLogWrite(pBueffel, iOut);
if (iRet >= MAXMSG) {
snprintf(pBueffel,sizeof(pBueffel)-1, "TRUNCATED MESSAGE: message len=%d, MAXMSG=%d",strlen(pBuffer), MAXMSG);
SICSLogWrite(pBueffel, eError);
/* log it for any case */
if (pCon->pSock) {
iRet = pCon->pSock->sockid;
} else {
iRet = 0;
}
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", iRet);
SICSLogWrite(pBueffel, eInternal);
SICSLogWrite(pBuffer, iOut);
/* write to commandlog if user or manager privilege */
if (SCGetRights(pCon) <= usUser) {
@ -686,14 +689,15 @@ int SCWriteJSON_String(SConnection * pCon, char *pBuffer, int iOut)
if (strlen(pBuffer) == 0)
return 1;
if (!SCinMacro(pCon)) {
iRet=snprintf(pBueffel,sizeof(pBueffel)-1, "[%d]:%s", pCon->sockHandle, pBuffer);
SICSLogWrite(pBueffel, iOut);
if (iRet >= MAXMSG) {
snprintf(pBueffel,sizeof(pBueffel)-1, "TRUNCATED MESSAGE: message len=%d, MAXMSG=%d",strlen(pBuffer), MAXMSG);
SICSLogWrite(pBueffel, eError);
}
/* log it for any case */
if (pCon->pSock) {
iRet = pCon->pSock->sockid;
} else {
iRet = 0;
}
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", iRet);
SICSLogWrite(pBueffel, eInternal);
SICSLogWrite(pBuffer, iOut);
/* write to commandlog if user or manager privilege */
if (SCGetRights(pCon) <= usUser) {