//***************************************************************************** // //! bootmain //! //! \param None //! //! \return uint8 //! //! \brief : all the board peripherals will be initialized here . // debug console will also be initialized for debugging info. // //***************************************************************************** void bootMain() { //int status; //void (*p)(void); // // Board Initialization . // gpio_init(); #ifdef RUN_APP misc_init_r(); //currently blank. #endif //init drivers. // init_SYSLeds(); // DispatcherUARTConfigure(); // init_console(); // init_wifiDriver(); turnLedOn(SYSLED1); //to indicate that we are active and initiated WLAN successfully #ifdef RUN_APP misc_init_s(); //currently blank. #endif //unsolicicted_events_timer_init(); // not required in the newer service packs of cc3000. //__bis_SR_register(GIE); #ifdef RUN_APP appMain(); #else systest_app(); #endif while(1) { //__bis_SR_register(LPM2_bits + GIE); toggleLed(SYSLED1); __no_operation(); __delay_cycles(12000000); #ifdef SERVICE_PACK_OLDER_THAN_ //hci_unsolicited_event_handler(); // ---- will call the function -------> CC3000_AsyncEventCallback() { CC3000.c} #endif //status=wlan_ioctl_statusget(); } }
int main(int argc, char*argv[]) { Gtk::Main appMain(argc, argv); TestMW tt; tt.show(); Gtk::Main::run(); return 0; }
/****************************************************************************** * main ******************************************************************************/ Int main(Int argc, Char *argv[]) { Args args = DEFAULT_ARGS; /* Parse the arguments given to the app */ parseArgs(argc, argv, &args); appMain(&args); return 0; }
Common::Error Sword25Engine::run() { // Engine initialisation Common::Error error = appStart(); if (error.getCode() != Common::kNoError) { appEnd(); return error; } // Run the game bool runSuccess = appMain(); // Engine de-initialisation bool deinitSuccess = appEnd(); return (runSuccess && deinitSuccess) ? Common::kNoError : Common::kUnknownError; }
//---------------------------------------------------------- // Main entry point //---------------------------------------------------------- int main(void) { initSystem(); // ------------------------------------------ #ifdef USE_THREADS MESSAGE("Using threads"); // never returns startThreads(appMain, systemMain); // if we're here, something went wrong ASSERT(!"systemMain returned?!"); // ------------------------------------------ #else ENABLE_INTS(); #ifdef USE_PROTOTHREADS startProtoSched(); #else MESSAGE("Not using threads"); appMain(); #endif // // Do not allow to return from this function. The reason: // GCC 4.5+ disables interrupts after completion of main() function, // but MansOS applications may want to return from appMain() // and do all the "real work" in interrupt handlers. // Therefore, interrupts must be kept enabled. // for (;;) {} #endif // USE_THREADS return 0; }
int main( int argc, char *argv[] ) { QApplication appMain(argc, argv); QString filtersList; filtersList += "My File Type(*.mft);;"; filtersList += "All Files (*.*);;"; QString defaultFile( "mypath/new_file.mft"); QString selectedFilter; // selectedFilter = "My File Type(*.mft);;"; // no segmentation fault #ifdef __APPLE__ qDebug() << "apple" ; #endif QString selectedFile = QFileDialog::getSaveFileName( NULL, "Save File Dialog", defaultFile, filtersList,new QString("My File Type(*.mft);;")); qDebug() << selectedFile; return appMain.exec(); }
// === CODE === int main(int argc, char *argv[], char **envp) { int i; int appArgc; char **appArgv; char *appPath = NULL; int (*appMain)(int, char *[], char **); void *base; int rv; gEnvP = envp; Request_Preinit(); // int syscall_handle = -1; for( i = 1; i < argc; i ++ ) { if(strcmp(argv[i], "--key") == 0) { giSyscall_ClientID = atoi(argv[++i]); continue ; } if(strcmp(argv[i], "--socket") == 0) { gSocket = atoi(argv[++i]); continue ; } if(strcmp(argv[i], "--binary") == 0) { appPath = argv[++i]; continue ; } if(strcmp(argv[i], "--open") == 0) { if( acess__SysOpen(argv[++i], 6) == -1 ) { // Read/Write fprintf(stderr, "Unable to open '%s'\n", argv[i]); exit(1); } continue ; } if( strcmp(argv[i], "--trace") == 0 ) { gbSyscallDebugEnabled = 1; continue ; } if( argv[i][0] != '-' ) break; } if( i >= argc ) { fprintf(stderr, "Usage: ld-acess <executable> [arguments ...]\n" "\n" "--key\t(internal) used to pass the system call handle when run with execve\n" "--binary\tLoad a local binary directly\n" "--open\tOpen a file before executing\n" ); return 1; } if( !appPath ) appPath = argv[i]; appArgc = argc - i; appArgv = &argv[i]; // printf("Exectutable Path: '%s'\n", appPath); // printf("Executable argc = %i\n", appArgc); base = Binary_Load(appPath, (uintptr_t*)&appMain); printf("[DEBUG %i] base = %p\n", giSyscall_ClientID, base); if( !base ) { *((char*)NULL) = 0; return 127; } printf("==============================\n"); printf("[DEBUG %i] %i ", giSyscall_ClientID, appArgc); for(i = 0; i < appArgc; i ++) printf("\"%s\" ", appArgv[i]); printf("\n"); printf("[DEBUG %i] appMain = %p\n", giSyscall_ClientID, appMain); // CallUser(appMain, appArgc, appArgv, envp); rv = appMain(appArgc, appArgv, envp); acess__exit(rv); return rv; }
static VOID CALLBACK application_cb(LPVOID user) { exit(appMain(realargc, realargv)); }