- moved IFServerOption to ifile.c

- moved PWSicsUser to passwd.c
- moved back InitObjectCommands to ofac.c
This commit is contained in:
zolliker
2010-01-28 08:39:21 +00:00
parent 492bed4ba7
commit 969b35d1d7
4 changed files with 136 additions and 9 deletions

28
ifile.c
View File

@ -43,6 +43,7 @@
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <sics.h>
#include "ifile.h"
/*====================== Locals ============================================*/
@ -208,6 +209,33 @@ void IFDeleteOptions(IPair * pList)
}
}
/*----------------------- Server options creation -------------------------*/
int IFServerOption(SConnection * pCon, SicsInterp * pSics,
void *pData, int argc, char *argv[])
{
char pBueffel[512];
assert(pSics);
assert(pCon);
/* check authorisation */
if (!SCMatchRights(pCon, usMugger)) {
SCWrite(pCon, "Insufficient privilege to set options", eError);
return 0;
}
/* test if sufficient arguments */
if (argc < 3) {
snprintf(pBueffel,sizeof(pBueffel)-1, "Syntax: %s name value ", argv[0]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
/* just do it */
pSICSOptions = IFAddOption(pSICSOptions, argv[1], argv[2]);
return 1;
}
/*===========================================================================
Testcode: Define MAIN to activate it. Needs a file test.txt
as input