Push the server and option code down to reduce dependency loops

This commit is contained in:
Douglas Clowes
2014-04-03 16:46:43 +11:00
parent a557cf577a
commit 93276478f5
5 changed files with 36 additions and 34 deletions

View File

@ -44,13 +44,19 @@ int ServerSetupInterrupt(int iPort, pNetRead pNet, pTaskMan pTasker);
configures a port for listening for interrupts
*/
extern void StopExit(void); /* in SICSmain.c */
extern int openDevexecLog(); /* in devexec.c */
extern int NetWatchTask(void *pData); /* in nwatch.c */
/* ========================= Less dreadful file statics =================== */
/*------------------------------------------------------------------------*/
static void StopExit(void)
{
if (pServ) {
StopServer(pServ);
}
}
#define DEFAULTINIFILE "servo.tcl"
#define DEFAULTSTATUSFILE "sicsstat.tcl"
#define INIT(F) { void F(void); F(); }
@ -510,3 +516,23 @@ int ServerIsStarting(pServer self)
{
return self->pReader == NULL;
}
pServer pServ = NULL;
/*--------------------------------------------------------------------------*/
SicsInterp *GetInterpreter(void)
{
return pServ->pSics;
}
/*--------------------------------------------------------------------------*/
pExeList GetExecutor(void)
{
return pServ->pExecutor;
}
/*-------------------------------------------------------------------------*/
pTaskMan GetTasker(void)
{
return pServ->pTasker;
}