ENTRYPOINT I ipcConnectNP(A afunc, A aname, A aprotocol) { C *serviceName=getString(aname); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcService *nSrv; InitializeIfNeeded(); ipcWarn(0,"%t ipcConnectN:\n"); if (!serviceName||!protocolSym||!QF(afunc))return -1; AipcHostPortProtocol *ahpp=new AipcHostPortProtocol(serviceName); ahpp->protocol(protocolSym->n); // const C *hostName=ahpp->host(); // I port=ahpp->port(); ipcWarn(0,"%t ipcConnectN: name:%s host:%s port:%d protocol:%s\n", serviceName,ahpp->host(),ahpp->port(),ahpp->protocol()); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nSrv=new pA_Connection(*ahpp,afunc); break; case 1: nSrv=new pRaw_Connection(*ahpp,afunc); break; case 4: nSrv=new pIpc_Connection(*ahpp,afunc); break; case 6: nSrv=new pString_Connection(*ahpp,afunc); break; case 7: nSrv=new pSimple_Connection(*ahpp,afunc); break; default: /* unknown protocol */ Warn("%t ipcConnectN: unknown protocol:%s\n",protocolSym->n); return -1; } return nSrv->handle(); }
ENTRYPOINT I ipcListenNP(A afunc, A aname, A aprotocol) { C *serviceName=getString(aname); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcListener *nLstn; InitializeIfNeeded(); ipcWarn(0,"%t ipcListenN:\n"); if(!serviceName||!QF(afunc))return -1; AipcHostPortProtocol *ahpp=new AipcHostPortProtocol(serviceName); // const C *hostName=ahpp->host(); I port=ahpp->port(); ipcWarn(0,"%t ipcListenN: name:%s port:%d protocol:%s\n",serviceName, port,protocolSym->n); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nLstn=new pA_Listener(*ahpp,afunc); break; case 1: nLstn=new pRaw_Listener(*ahpp,afunc); break; case 4: nLstn=new pIpc_Listener(*ahpp,afunc); break; case 6: nLstn=new pString_Listener(*ahpp,afunc); break; case 7: nLstn=new pSimple_Listener(*ahpp,afunc); break; default: /* unknown protocol */ Warn("%t ipcListenN: unknown protocol:%s\n",protocolSym->n); return -1; } return nLstn->handle(); }
ENTRYPOINT I ipcDebug(I s) { InitializeIfNeeded(); ipcWarn(0,"%t ipcDebug %d\n",s); if (s) ipcSetDebug(0,2); else ipcSetDebug(0,-1); return s; }
ENTRYPOINT int ipcTimer(A afunc, A timeout) { InitializeIfNeeded(); ipcWarn(0,"%t ipcTimer\n"); TimrConnection *nTmr=new TimrConnection(timeout, afunc); return nTmr->handle(); }
bool DriverCrashGuard::Crashed() { InitializeIfNeeded(); // Note, we read mCrashDetected instead of GetStatus(), since in child // processes we're not guaranteed that the prefs have been synced in // time. return mCrashDetected; }
ENTRYPOINT I ipcConnectNHPP(A afunc, A aname, A ahost, I port, A aprotocol) { C *serviceName=getString(aname); C *hostName=getString(ahost); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcService *nSrv; InitializeIfNeeded(); ipcWarn(0,"%t ipcConnectNHPP:\n"); if (!serviceName||!hostName||!protocolSym||!QF(afunc))return -1; ipcWarn(0,"%t ipcConnectNHPP: name:%s host:%s port:%d protocol:%s\n", serviceName,hostName,port,protocolSym->n); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nSrv=new pA_Connection(serviceName,hostName,port,afunc); break; case 1: nSrv=new pRaw_Connection(serviceName,hostName,port,afunc); break; case 2: Warn("%t ipcConnectHPP: unsupported protocol:%s\n",protocolSym->n); return -1; break; case 4: nSrv=new pIpc_Connection(serviceName,hostName,port,afunc); break; case 5: Warn("%t ipcConnectHPP: unsupported protocol:%s\n",protocolSym->n); return -1; break; case 6: nSrv=new pString_Connection(serviceName,hostName,port,afunc); break; case 7: nSrv=new pSimple_Connection(serviceName,hostName,port,afunc); break; default: /* unknown protocol */ Warn("%t ipcConnectHPP: unknown protocol:%s\n",protocolSym->n); return -1; } return nSrv->handle(); }
ENTRYPOINT I ipcSetDebug(I handle_,I val_) { InitializeIfNeeded(); if (0==handle_) ipcWarnFlag=val_; else { AipcService *srvptr=lookupAnyHandle(handle_); if(!srvptr)return -1; if(val_)srvptr->turnDebugOn();else srvptr->turnDebugOff(); if (-1==ipcWarnFlag) ipcWarnFlag=0; } if (ipcWarnFlag>=0) { SetWarnFunc(WarnFunc); MSMessageLog::quietMode(MSFalse); } else { SetWarnFunc(0); MSMessageLog::quietMode(MSTrue); } return val_; }
static AipcService *lookupAnyHandle(int handle_) { InitializeIfNeeded(); return (AipcService *)AipcService::lookup(handle_); }