First commit towards replacing pCon-> with someFunc(pCon)

This is accompanied with the removal of dead code in conman.c and else
This commit is contained in:
2016-10-31 08:33:36 +01:00
parent fd5451e8fd
commit 0e2605b570
21 changed files with 171 additions and 433 deletions

View File

@ -118,14 +118,6 @@ void KillStatus(void *pData)
/*--------------------------------------------------------------------------*/
void SetStatus(Status eNew)
{
/* if (!fixed) {
if (eCode == eNew) {
return;
}
eCode = eNew;
InvokeCallBack(pCall, VALUECHANGE, NULL);
}
*/
/*
This now only manages the userWait status
*/
@ -141,12 +133,7 @@ void SetStatus(Status eNew)
/*----------------------------------------------------------------------*/
void SetStatusFixed(Status eNew)
{
// if (eCode == eNew) {
// return;
// }
// eCode = eNew;
// InvokeCallBack(pCall, VALUECHANGE, NULL);
// fixed = 1;
/* pass */
}
/*----------------------------------------------------------------------*/
@ -309,57 +296,6 @@ int ResetStatus(SConnection * pCon, SicsInterp * pSics, void *pData,
return 1;
}
/* ===================== Control Connection Management ====================*/
static SConnection *pOwner = NULL;
void SetControl(SConnection * pCon)
{
pOwner = pCon;
}
/*--------------------------------------------------------------------------*/
int IsControl(SConnection * pCon)
{
if (pCon == pOwner) {
return 1;
} else {
return 0;
}
}
/*--------------------------------------------------------------------------*/
SConnection *GetControl(void)
{
return pOwner;
}
/*--------------------------------------------------------------------------*/
int RedirectControl(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[])
{
assert(pCon);
assert(pSics);
/* check user Rights */
if (!SCMatchRights(pCon, usUser)) {
SCWrite(pCon,
"You have NO, I repeat NO, Privilege to grab a control connection",
eError);
return 0;
}
/* check if the connection is dead at all */
if (pCon->sockHandle < 0) {
SCWrite(pCon,
"GOTCHA!!! Control still lives! You CANNOT grab it! FUCK OFF",
eError);
return 0;
}
/* now the wizardry */
pOwner->sockHandle = pCon->sockHandle;
return 1;
}
/*----------------------------------------------------------------------------
Message pipe based new status calculation code
------------------------------------------------------------------------------*/