diff --git a/ofac.c b/ofac.c index 0576da22..2f6d6ee9 100644 --- a/ofac.c +++ b/ofac.c @@ -127,6 +127,7 @@ static void InitIniCommands(SicsInterp * pInter) PCMD("wait", UserWait); PCMD("yield", UserYield); PCMD("checksum", CheckSum); + PCMD("loguserinfo", LogUserInfoWrapper); /* startup commands in alphabetic order */ SCMD("allowexec", AllowExec); diff --git a/sicsutil.c b/sicsutil.c index c18f6686..dea1e3a7 100644 --- a/sicsutil.c +++ b/sicsutil.c @@ -1,4 +1,4 @@ -/** + /** * Some general functions for SICS. Most part is moved from ofac.c * * copyright: see file COPYRIGHT @@ -15,6 +15,7 @@ #include "sicsdata.h" #include "SCinter.h" #include "sicshipadaba.h" +#include "sicsget.h" static char *aCode[] = { "internal", @@ -140,4 +141,30 @@ int CheckSum(SConnection * pCon, SicsInterp * pSics, void *pData, SCWrite(pCon,"ERROR: object type not recognized", eError); return 0; } +/*-----------------------------------------------------------------------------*/ +void LogUserInfo(void *data) +{ + hdbValue user, proposal; + SConnection *pCon = (SConnection *)data; + + if(data == NULL){ + return; + } + user = MakeHdbText(strdup("Martina Notconfigured")); + proposal = MakeHdbText(strdup("Unproposed")); + + sget("user",&user); + sget("proposalid",&proposal); + SCPrintf(pCon,eLog,"WARNING: Saving data for %s, proposal %s", user.v.text, proposal.v.text); + ReleaseHdbValue(&user); + ReleaseHdbValue(&proposal); + +} +/*--------------------------------------------------------------------------*/ +int LogUserInfoWrapper(SConnection * pCon, SicsInterp * pSics, void *pData, + int argc, char *argv[]) +{ + LogUserInfo(pCon); + return 1; +} diff --git a/sicsutil.h b/sicsutil.h index bbc50b27..26fe8ca3 100644 --- a/sicsutil.h +++ b/sicsutil.h @@ -24,3 +24,4 @@ unsigned short fletcher16( char *data, size_t len); +void LogUserInfo(void *pCon); diff --git a/stdscan.c b/stdscan.c index 5689b077..f4e98423 100644 --- a/stdscan.c +++ b/stdscan.c @@ -579,6 +579,7 @@ int prepareDataFile(pScanData self) } snprintf(pBueffel, 511, "Writing data file: %s ...", pPtr); SCWrite(self->pCon, pBueffel, eLog); + LogUserInfo(self->pCon); strcpy(self->pFile, pPtr); free(pPtr); return 1;