void UGUI() { int i; UpdatePads(); mainWindow->Draw(); #ifdef HW_RVL for (i = 3; i >= 0; i--) // so that player 1's cursor appears on top! { if (userInput[i].wpad->ir.valid) Menu_DrawImg(userInput[i].wpad->ir.x - 48, userInput[i].wpad->ir.y - 48, 96, 96, pointer[i]->GetImage(), userInput[i].wpad->ir.angle, 1, 1, 255); DoRumble(i); } #endif Menu_Render(); for (i = 0; i < 4; i++) mainWindow->Update(&userInput[i]); if (ExitRequested) { for (i = 0; i <= 255; i += 15) { mainWindow->Draw(); Menu_DrawRectangle(0, 0, screenwidth, screenheight, (GXColor) { 0, 0, 0, i }, 1); Menu_Render(); } ExitApp(); } }
int GetHexNum(register int digits) { register unsigned int v = 0; register char c; while (isxdigit(*FilePtr)) { if (!digits) { Error(Error_Skip, "Hex value too int !"); ExitApp(1); } c = tolower(*FilePtr++); v <<= 4; if (isdigit(c)) v += c - (unsigned char) '0'; else v += c - (unsigned char) 'a' + 10; digits--; } return (int) v; }
void Medications::createActions() { addaction = new QAction("Add Medications", this); connect(addaction, SIGNAL(triggered()), this, SLOT(addMedication())); editaction = new QAction("Edit Medications", this); connect(editaction, SIGNAL(triggered()),this, SLOT(editMedication())); deleteaction = new QAction("Delete Medications", this); connect(deleteaction, SIGNAL(triggered()),this,SLOT(deleteMedication())); aboutapp = new QAction("About Icey", this); connect(aboutapp, SIGNAL(triggered()),this,SLOT(AboutApp())); exitapp = new QAction("Exit", this); connect(exitapp, SIGNAL(triggered()),this,SLOT(ExitApp())); qm = new QMenu(this); qm->addAction(addaction); qm->addAction(editaction); qm->addAction(deleteaction); qm->addAction(aboutapp); qm->addAction(exitapp); ui->actionButton->setMenu(qm); }
// static member(s) AIClientApp::AIClientApp(const std::vector<std::string>& args) : m_player_name(""), m_max_aggression(0) { if (args.size() < 2) { std::cerr << "The AI client should not be executed directly! Run freeorion to start the game."; ExitApp(1); } // read command line args m_player_name = args.at(1); if (args.size() >=3) { m_max_aggression = boost::lexical_cast<int>(args.at(2)); } // Force the log file if requested. if (GetOptionsDB().Get<std::string>("log-file").empty()) { const std::string AICLIENT_LOG_FILENAME((GetUserDataDir() / (m_player_name + ".log")).string()); GetOptionsDB().Set("log-file", AICLIENT_LOG_FILENAME); } // Force the log threshold if requested. auto force_log_level = GetOptionsDB().Get<std::string>("log-level"); if (!force_log_level.empty()) OverrideAllLoggersThresholds(to_LogLevel(force_log_level)); InitLoggingSystem(GetOptionsDB().Get<std::string>("log-file"), "AI"); InitLoggingOptionsDBSystem(); InfoLogger() << FreeOrionVersionString(); DebugLogger() << PlayerName() + " ai client initialized."; }
void NeedToken(char *token) { if (!Token(token)) { Error(Error_Skip, "Expected '%s'",token); ExitApp(1); } }
void Sys_BackToLoader(void) { ExitApp(); if (hbcStubAvailable()) exit(0); // Channel Version SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); }
void FGDump::SetHostfileName(char* szFile) { if (strlen(lpszSourceFile) != 0) { Log.ReportError(CRITICAL, "Source file already specified: did you mistakenly use -f *AND* -H?\n"); ExitApp(1); } strncpy(lpszSourceFile, (const char*)szFile, MAX_PATH); }
virtual void Message( byte msgtype, char const *mapname ) { if ( !m_bPhoneHome ) return; if ( !m_pSocket ) return; switch ( msgtype ) { default: break; case PHONE_MSG_ENGINESTART: if ( !RequestSessionId( m_uSessionID ) ) { ExitApp(); } // Note we always return here!!! return; case PHONE_MSG_ENGINEEND: break; case PHONE_MSG_MAPSTART: { if ( m_bLevelStarted ) { return; } m_bLevelStarted = true; // Tracker 22394: Don't send map start/finish when building reslists... if ( CommandLine()->FindParm( "-makereslists" ) ) { return; } } break; case PHONE_MSG_MAPEND: { if ( !m_bLevelStarted ) { return; } m_bLevelStarted = false; // Tracker 22394: Don't send map start/finish when building reslists... if ( CommandLine()->FindParm( "-makereslists" ) ) { return; } } break; } SendSessionMessage( msgtype, mapname ); }
MBEG #else int main( int argc, char* argv[] ) #endif { int cacheControl = -1; if ( argc == 1 ) { printf( "usage: clock [cache_control_in_sec]\n" ); cacheControl = 1800; } else if ( argc > 2 ) { printf( "usage: clock [cache_control_in_sec]\n" ); exit( 0 ); } else if (sscanf(argv[1], "%i", &cacheControl) != 1) { printf( "Invalid CACHE-CONTROL value.\n" ); exit( 0 ); } printf( "Using CACHE-CONTROL value: %d sec\n", cacheControl ); if (!InitApp( cacheControl )) { fprintf(stderr, "Couldn't create this clock device !!\n"); exit(0); } #if !defined(TENGINE) kbinit(); #endif int ch = 0; do { #if !defined(TENGINE) if (0 < kbhit()) { ch = getchar(); ch = toupper( ch ); } else mupnp_wait(1000); #else mupnp_wait(1000); #endif upnp_clock_device_update(clockDev); } while( ch != 'Q'); #if !defined(TENGINE) kbexit(); #endif ExitApp(); return(0); }
/* virtual */ void Hdx_UnitTestWindow::OnKeyRelease(int key) { switch (key) { case 'q': ExitApp(); return; } _unitTest->KeyRelease(key); }
void AutotestingSystem::ForceQuit(const String & errorMessage) { Logger::Error("AutotestingSystem::ForceQuit %s",errorMessage.c_str()); AutotestingDB::Instance()->CloseConnection(); ExitApp(); exit(0); }
void SkipQuote(char qToken) { char token; token = *FilePtr++; if (token != qToken) { printf("Expected '%c'",qToken); ExitApp(1); } while (1) { token = *FilePtr; if (token == 0) { printf("Expected '%c'",qToken); ExitApp(1); } if (token == qToken) break; if (token == '\\') { token = *FilePtr++; } FilePtr++; } FilePtr++; //SkipWhiteSpace(); return; }
void assign(EVAL *Part1) /* MAHandle assignments (=) */ { // EVAL Part2; logor(Part1); GetOper(); if (IsOper("=")) { SkipOper(); Error(Error_Skip, "'=' is not implemented yet"); ExitApp(1); } }
void Sys_LoadHBC(void) { ExitApp(); WII_Initialize(); // Try launching all known HBC titles in reversed released order WII_LaunchTitle(HBC_LULZ); WII_LaunchTitle(HBC_1_0_7); WII_LaunchTitle(HBC_JODI); WII_LaunchTitle(HBC_HAXX); //Back to system menu if all fails SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); }
void Sys_LoadMenu(void) { ExitApp(); // Priiloader shutup if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_PRIILOADER_OVERRIDE)) { *(u32 *)0x8132fffb = 0x50756e65; *(u32 *)0x817feff0 = 0x50756e65; // priiloader 0.8 beta 4+ DCFlushRange((u32 *)0x8132fffb, 4); DCFlushRange((u32 *)0x817feff0, 4); } /* Return to the Wii system menu */ SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); }
void AutotestingSystem::OnTestsFinished() { Logger::Debug("AutotestingSystem::OnTestsFinished"); // Mark last step as SUCCESS OnStepFinished(); if (deviceId != "not-initialized") { AutotestingDB::Instance()->WriteState(deviceId, "finished"); } // Mark test as SUCCESS AutotestingDB::Instance()->Log("INFO", "Test finished."); ExitApp(); }
/** * Callback sur les mises à jours */ void UpdateCallback() { // Procédure de fin if(_exitRequest || glutGet(GLUT_WINDOW_FORMAT_ID) == 0 ){ ExitApp(); } else { // Mise à jour _room->Update(); _montre->Update(); _time->Update(); _camera->Update(); _scenario->Update(); glutPostRedisplay(); } }
static void * UpdateGUI (void *arg) { int i; while(1) { if(guiHalt) { LWP_SuspendThread(guithread); } else { UpdatePads(); mainWindow->Draw(); #ifdef HW_RVL for(i=3; i >= 0; i--) // so that player 1's cursor appears on top! { if(userInput[i].wpad->ir.valid) Menu_DrawImg(userInput[i].wpad->ir.x-48, userInput[i].wpad->ir.y-48, 96, 96, pointer[i]->GetImage(), userInput[i].wpad->ir.angle, 1, 1, 255); DoRumble(i); } #endif Menu_Render(); for(i=0; i < 4; i++) mainWindow->Update(&userInput[i]); if(ExitRequested) { for(i = 0; i < 255; i += 15) { mainWindow->Draw(); Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, i},1); Menu_Render(); } ExitApp(); } } } return NULL; }
int Configure::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: on_appsettingsconfigButton_clicked(); break; case 1: on_medicationconfigButton_clicked(); break; case 2: on_contactconfigButton_clicked(); break; case 3: on_conditionconfigButton_clicked(); break; case 4: on_allergyconfigButton_clicked(); break; case 5: on_exitButton_clicked(); break; case 6: on_bioconfigButton_clicked(); break; case 7: AboutApp(); break; case 8: ExitApp(); break; case 9: on_insuranceconfigButton_clicked(); break; default: ; } _id -= 10; } return _id; }
void AutotestingSystem::OnError(const String & errorMessage) { Logger::Error("AutotestingSystem::OnError %s",errorMessage.c_str()); if (isDB) { AutotestingDB::Instance()->Log("ERROR", errorMessage); //SaveTestStepLogEntryToDB("ERROR", GetCurrentTimeString(), errorMessage); MakeScreenShot(); SaveScreenShotNameToDB(); if (deviceId != "not-initialized") { AutotestingDB::Instance()->WriteState(deviceId, "error"); } } ExitApp(); }
int GetDecNum(int digits) { register unsigned int v = 0; DigitCount = 0; while (isdigit(*FilePtr)) { if (!digits) { Error(Error_Skip, "Decimal value too int !"); ExitApp(1); } v = (v * 10) + (*FilePtr++ - 0x30); digits--; DigitCount++; } return (int) v; }
int InsuranceConfig::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: on_optionButton_clicked(); break; case 1: on_cancelButton_clicked(); break; case 2: saveInsurance(); break; case 3: loadInsurance(); break; case 4: createActions(); break; case 5: AboutApp(); break; case 6: ExitApp(); break; case 7: { QString _r = defaultText((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3])),(*reinterpret_cast< QString(*)>(_a[4]))); if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; } break; default: ; } _id -= 8; } return _id; }
bool RebootApp(void) { // be sure to use current settings as arguments editMetaArguments(); #ifdef FULLCHANNEL ExitApp(); WII_Initialize(); return !(WII_LaunchTitle(TITLE_ID(0x00010001, 0x554c4e52)) < 0); #else // Load meta.xml arguments char filepath[255]; HomebrewXML MetaXML; snprintf(filepath, sizeof(filepath), "%s/meta.xml", Settings.update_path); MetaXML.LoadHomebrewXMLData(filepath); u8 *buffer = NULL; u32 filesize = 0; snprintf(filepath, sizeof(filepath), "%s/boot.dol", Settings.update_path); LoadFileToMem(filepath, &buffer, &filesize); if(!buffer) { return false; } FreeHomebrewBuffer(); CopyHomebrewMemory(buffer, 0, filesize); AddBootArgument(filepath); for(u32 i = 0; i < MetaXML.GetArguments().size(); ++i) { AddBootArgument(MetaXML.GetArguments().at(i).c_str()); } return !(BootHomebrewFromMem() <0); #endif }
static void _Sys_Shutdown(int SHUTDOWN_MODE) { ExitApp(); /* Poweroff console */ if ((CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE && SHUTDOWN_MODE != ShutdownToStandby) || SHUTDOWN_MODE == ShutdownToIdle) { s32 ret; /* Set LED mode */ ret = CONF_GetIdleLedMode(); if (ret >= 0 && ret <= 2) STM_SetLedMode(ret); /* Shutdown to idle */ STM_ShutdownToIdle(); } else { /* Shutdown to standby */ STM_ShutdownToStandby(); } }
extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow) { Shortcut_Init(); TaLocale_LoadCorrespondingModule (hInst); osi_InitTraceOption(); osi_LogEvent0("AFSCreds Main command line",pCmdLine); fs_utils_InitMountRoot(); if (InitApp (pCmdLine)) { MSG msg; while (GetMessage (&msg, NULL, 0, 0) > 0) { PumpMessage (&msg); } ExitApp(); } Shortcut_Exit(); return 0; }
void SkipPair(char LToken,char RToken) { int Count; char token; //char *StPos = FilePtr; token = *FilePtr++; if (token != LToken) { printf("Expected '%c'",LToken); ExitApp(1); } Count = 1; while (1) { token = *FilePtr; if (token == 0) { printf("Expected '%c'",RToken); ExitApp(1); } if (token == LToken) Count++; if (token == RToken) { --Count; if (Count == 0) break; } if (token == '(' && LToken != '(') { SkipPair('(',')'); continue; } if (token == '\'') { SkipQuote(token); continue; } if (token == '"') { SkipQuote(token); continue; } FilePtr++; SkipWhiteSpace(); } FilePtr++; return; }
void * FileLoadMalloc(char * name, long * SizeLoadMalloc) { long handle; long size1, size2; unsigned char * adr; retry: handle = FileOpenRead(name); if (!handle) { char str[256]; strcpy(str, name); int mb; mb = ShowError("FileLoadMalloc", str, 4); switch (mb) { case IDABORT: ExitApp(1); break; case IDRETRY: goto retry; break; case IDIGNORE: if (SizeLoadMalloc != NULL) *SizeLoadMalloc = 0; return(NULL); break; } } FileSeek(handle, 0, FILE_SEEK_END); size1 = FileSizeHandle(handle); adr = (unsigned char *)malloc(size1); if (!adr) { int mb; mb = ShowError("FileLoadMalloc", name, 4); switch (mb) { case IDABORT: ExitApp(1); break; case IDRETRY: FileCloseRead(handle); goto retry; break; case IDIGNORE: FileCloseRead(handle); if (SizeLoadMalloc != NULL) *SizeLoadMalloc = 0; return(0); break; } } FileSeek(handle, 0, FILE_SEEK_START); size2 = FileRead(handle, adr, size1); FileCloseRead(handle); if (size1 != size2) { free(adr); int mb; mb = ShowError("FileLoadMalloc", name, 4); switch (mb) { case IDABORT: ExitApp(1); break; case IDRETRY: goto retry; break; case IDIGNORE: if (SizeLoadMalloc != NULL) *SizeLoadMalloc = 0; return(0); break; } } if (SizeLoadMalloc != NULL) *SizeLoadMalloc = size1; return(adr); }
void Sys_Reboot(void) { /* Restart console */ ExitApp(); STM_RebootSystem(); }
int access(const char *pathname, int mode) { ExitApp(); return 1; }
/*** Miscellaneous Functions ***/ void S9xExit() { ExitApp(); }