void Source::Update() { char msg[1024]; sprintf(msg, "%s:about to execute", SourceName()); Logger::LogEvent(msg); Execute(); sprintf(msg, "%s:done executing", SourceName()); Logger::LogEvent(msg); }
/** * Update triggers execution with logging and error handeling */ void Color::Update() { char msg[128]; sprintf(msg, "%s: about to execute", SourceName()); Logger::LogEvent(msg); try{ Execute(); }catch(DataFlowException& except){ sprintf(msg, "Throwing exception: (%s): %s", SourceName(), except.what()); Logger::LogEvent(msg); throw except; } sprintf(msg, "%s: done executing", SourceName()); Logger::LogEvent(msg); }
void filters::Update() { if(input1 != NULL) { char msg[128]; sprintf(msg, "%s: about to update input1\n", SourceName()); Logger::LogEvent(msg); input1->Update(); sprintf(msg, "%s: done updating input1\n", SourceName()); Logger::LogEvent(msg); } if(input2 != NULL) { char msg[128]; sprintf(msg, "%s: about to update input2\n", SourceName()); Logger::LogEvent(msg); input2->Update(); sprintf(msg, "%s: done updating input2\n", SourceName()); Logger::LogEvent(msg); } char msg[1024]; sprintf(msg, "%s: about to execute\n", SourceName()); Logger::LogEvent(msg); Execute(); sprintf(msg, "%s: done executing\n", SourceName()); Logger::LogEvent(msg); }
void RMDSBridgeSubscription::OnError( mama_status statusCode ) { if (isShutdown_) { // just dont bother with making the callback return; } char * subject = (char*)alloca(1024); sprintf(subject,"%s.%s",SourceName().c_str(), Symbol().c_str()); try { callback_.onError(subscription_, statusCode,0, subject, closure_); } catch (...) { t42log_error("RMDSBridgeSubscription::OnError - caught exception calling mama subscription onError for %s", symbol_.c_str()); } }
void Filter::Update() { updateCount--; if (updateCount <= 0) { char msg[1024]; sprintf(msg, "%s: loop detected, aborting", SourceName()); DataFlowException e(SinkName(), msg); throw e; } char msg[128]; if (snkImg != NULL) { sprintf(msg, "%s: about to update input1", SourceName()); Logger::LogEvent(msg); snkImg->Update(); sprintf(msg, "%s: done updating input1", SourceName()); Logger::LogEvent(msg); } if (snkImg2 != NULL) { sprintf(msg, "%s: about to update input2", SourceName()); Logger::LogEvent(msg); snkImg2->Update(); sprintf(msg, "%s: done updating input2", SourceName()); Logger::LogEvent(msg); } sprintf(msg, "%s: about to execute", SourceName()); Logger::LogEvent(msg); Execute(); sprintf(msg, "%s: done executing", SourceName()); Logger::LogEvent(msg); }
int main (int argc, char *argv[]) { if (!_isterm(1)) ANSI = 0; if (DosCreateMutexSem("\\SEM32\\CONSOLE.RUN", &ConsoleSem, DC_SEM_SHARED, TRUE) != NO_ERROR) { if (DosOpenMutexSem("\\SEM32\\CONSOLE.RUN", &ConsoleSem) != NO_ERROR) Stop(3, NULL); if (DosRequestMutexSem(ConsoleSem, SEM_INDEFINITE_WAIT) != NO_ERROR) Stop(3, NULL); } atexit(ReleaseINI); doInitialize(); ParseCmdLine(getenv("CONSOLE"), OptH, StrH); optCount = 0; cmdLine = CmdLine(argc, argv); ParseCmdLine(cmdLine, OptH, StrH); free(cmdLine); if (!fNewSession && (optCount > 0) && !fQueryCommand) fQuiet = TRUE; doHeader(); if (fQueryCommand) doShowCommand(); if ((fConsoleSize || fSetBorder || (fSetFlash && fFlashWindow)) && fNewSession && (sd.SessionType == SSF_TYPE_WINDOWABLEVIO)) { char *p,*n; int nl = 64; if (progname) nl += strlen(progname); if (progargs) nl += strlen(progargs); p = malloc(nl); sprintf(p, "-s%d,%d ", Console.W, Console.H); if (fSetBorder) sprintf(&p[strlen(p)], "-b%d,%d ", Border.W, Border.H); if (fSetFlash && fFlashWindow) strcat(&p[strlen(p)], "-of "); if (fExplicitSize) sprintf(&p[strlen(p)], "-p,,%d,%d ", ConsolePos.W, ConsolePos.H); if ((sd.PgmControl & SSF_CONTROL_INVISIBLE) == 0) { strcat(&p[strlen(p)], "-ov "); sd.PgmControl |= SSF_CONTROL_INVISIBLE; } if (!progname || !progname[0]) n = getenv("COMSPEC"); else n = progname; sprintf(&p[strlen(p)], "%s ", n); if (progargs) strcat(p, progargs); if (progname) free(progname); progname = SourceName(); progargs = p; } if (!optCount) doHelp(); else { if (fNewSession) doNewSession(); else doSameSession(); } if (!fQuiet) { SetColor(colBLUE, colSAME); printf("À´ Done\n"); SetColor(colCYAN, colSAME); } return 0; }