/*----------------------------------------------------------------------+*/ SPC_fd_to_connector(SPC_Channel_Ptr channel, int fd) /*----------------------------------------------------------------------+*/ { if(Stdout(channel) == fd) return(STDOUT); if(Stdin(channel) == fd) return(STDIN); if(Stderr(channel) == fd) return(STDERR); return(ERROR); }
retCode setupDebugChannels() { if (debuggerPort > 0 && debugInChnnl == Null) { if (debuggerListener == Null) { debuggerListener = listeningPort("star-debug", debuggerPort); showPkgFile = True; retCode ret = acceptConnection(debuggerListener, utf8Encoding, &debugInChnnl, &debugOutChnnl); if (ret != Ok) { syserr("fatal problem in establishing debugger connection"); } return ret; } } else if (debugInChnnl == Null) { debugInChnnl = Stdin(); debugOutChnnl = Stdout(); return Ok; } return Error; }
void CCmdPlay::DoRunL() { if (iMaxVolume) { // we use DevSound to get the max volume, as CMdaAudioRecorderUtility // always returns 0 until we have opened a file. CMMFDevSound* devSound = CMMFDevSound::NewL(); TInt maxVol = devSound->MaxVolume(); TBool cons = Stdout().AttachedToConsole(); if (cons) Printf(_L("Maximum volume: ")); Printf(_L("%d"), maxVol); if (cons) Printf(_L("\r\n")); delete devSound; } else { if (!iArguments.IsPresent(0)) { PrintError(KErrArgument, _L("No filename specified")); DisplayHelp(); Complete(KErrArgument); return; } iPlayer->GetReady(iFile, iVerbose); if (iOptions.IsPresent(&iPriority) || iOptions.IsPresent(&iPreference)) { iPlayer->SetPriority(iPriority, iPreference); } if (iOptions.IsPresent(&iVolume)) { iPlayer->SetVolume(iVolume); } CActiveScheduler::Start(); User::LeaveIfError(iPlayer->Error()); } }
void CCmdCifTest::TestCifL(CCommandInfoFile* aCif) { iCurrentCif = aCif; if (iVerbose) Printf(_L("Checking %S\r\n"), &aCif->CifFileName()); const TDesC& scriptData = aCif->SmokeTest(); if (scriptData.Length() == 0) { if (iVerbose) Printf(_L("Cif has no smoketest section\r\n")); TestCompleted(KErrNone); return; } iEnvForScript = CEnvironment::NewL(Env()); iEnvForScript->SetL(_L("Error"), _L("fshell -e 'echo \"Test failed, env is:\" && env && error'")); iEnvForScript->SetL(_L("Quiet"), _L(">/dev/null")); iEnvForScript->SetL(_L("Silent"), _L("2>&1 >/dev/null")); iEnvForScript->Remove(_L("Verbose")); // In case it's ended up in our parent env if (iVerbose) iEnvForScript->SetL(_L("Verbose"), 1); iFileName.Copy(aCif->CifFileName()); iFileName.Append(_L(":smoke-test")); TParsePtrC parse(iFileName); iEnvForScript->SetL(KScriptName, parse.NameAndExt()); iEnvForScript->SetL(KScriptPath, parse.DriveAndPath()); iEnvForScript->SetL(_L("0"), iFileName); iParser = CParser::NewL(CParser::EExportLineNumbers, scriptData, IoSession(), Stdin(), Stdout(), Stderr(), *iEnvForScript, gShell->CommandFactory(), this, aCif->GetSmokeTestStartingLineNumber()); iParser->Start(); }
void CCmdPlay::ConstructL() { BaseConstructL(); iPlayer = CMmfPlayer::NewL(Stdout()); }