// main function int main(void) { //const int argc, const char** argv) { u8 run = 1; // net_init(&ctlnet); net_init(); ui_init(); pages_init(); preset_init(); scene_init(); // TEST: // create some dummy parameters /* net_add_param(0, "unit", 0.0, 1.0, 0); */ /* net_add_param(1, "big", 0.0, 10000.0, 0); */ /* net_add_param(2, "bipolar", -1.0, 1.0, 0); */ while (run != 0) { run = ui_loop(); } scene_deinit(); preset_deinit(); pages_deinit(); ui_deinit(); net_deinit(); return 0; }
/* main: * Entry point. See usage(). */ int main(int argc, char **argv) { pthread_t thread; struct sigaction sa = {}; setlocale(LC_ALL, ""); /* TODO: tidy this up */ /* read command line options and config file */ config_init(); options_set_defaults(); options_read_args(argc, argv); /* If a config was explicitly specified, whinge if it can't be found */ read_config(options.config_file, options.config_file_specified); options_make(); sa.sa_handler = finish; sigaction(SIGINT, &sa, NULL); pthread_mutex_init(&tick_mutex, NULL); packet_init(); init_history(); if (options.no_curses) { tui_init(); } else { ui_init(); } pthread_create(&thread, NULL, (void*)&packet_loop, NULL); /* Keep the starting time (used for timed termination) */ first_timestamp = time(NULL); if (options.no_curses) { if (options.timed_output) { while(!foad) { sleep(1); } } else { tui_loop(); } } else { ui_loop(); } pthread_cancel(thread); ui_finish(); return 0; }
int main(int argc, char **argv) { #ifdef LINUX_TEST_FLOAT /* for debuging floating point errors under Linux */ __setfpucw(0x1372); #endif Toggle(); return ui_loop(argc, argv, "mech"); }
int main(int argc, char** argv) { //do some initialisations random_init(); ui_init(); map_current = mkmap(80, 35); create_testmap(map_current); ui_isrunning = 1; ui_loop(); ui_suspend(); printf(":)\n"); return 0; }
int main(int argc, const char** argv) { const char* filenames[4096]; // command line params yc_parser* parser = yc_init_parser(argc, argv, "view images"); yc_parse_argsa(parser, "image", "image filename", 0, true, filenames, 4096); yc_done_parser(parser); // loading images view_img* imgs; int nimgs = load_images(filenames, &imgs); // start ui loop ui_loop(nimgs, imgs); // done return EXIT_SUCCESS; }
int main(int argc, const char** argv) { // command line yc_parser* parser = yc_init_parser(argc, argv, "view meshes"); float amb = yc_parse_optf(parser, "--ambient", 0, "ambient factor", 0); bool camera_lights = yc_parse_optb(parser, "--camera_lights", "-c", "enable camera lights", false); int camera = yc_parse_opti(parser, "--camera", "-C", "camera", 0); bool no_ui = yc_parse_optb(parser, "--no-ui", 0, "runs offline", false); float aspect = yc_parse_optf(parser, "--aspect", "-a", "image aspect", 16.0f / 9.0f); float dt = yc_parse_optf(parser, "--delta_time", "-dt", "delta time", 1 / 60.0f); int res = yc_parse_opti(parser, "--resolution", "-r", "image resolution", 720); const char* imfilename = yc_parse_opts(parser, "--output", "-o", "image filename", "out.png"); const char* filename = yc_parse_args(parser, "scene", "scene filename", 0, true); yc_done_parser(parser); // load scene yo_scene* scene = load_scene(filename); scene->cameras[camera].width = aspect * scene->cameras[camera].height; // init rigid simulation yb_scene* scene_bvh; ysr_scene* rigid_scene = make_rigid_scene(scene, &scene_bvh); // start ui_loop(filename, imfilename, scene, rigid_scene, dt, (int)round(res * aspect), res, camera_lights, amb, no_ui); // done // TODO: clean bvh ysr_free_scene(rigid_scene); yo_free_scene(scene); return EXIT_SUCCESS; }
/* main: * Entry point. See usage(). */ int main(int argc, char **argv) { pthread_t thread; struct sigaction sa = {}; setlocale(LC_ALL, ""); /* TODO: tidy this up */ /* read command line options and config file */ config_init(); options_set_defaults(); options_read_args(argc, argv); /* If a config was explicitly specified, whinge if it can't be found */ read_config(options.config_file, options.config_file_specified); options_make(); sa.sa_handler = finish; sigaction(SIGINT, &sa, NULL); pthread_mutex_init(&tick_mutex, NULL); packet_init(); init_history(); ui_init(); pthread_create(&thread, NULL, (void*)&packet_loop, NULL); ui_loop(); //pthread_cancel(thread); // bionic c have no pthread_cancel, by dove ui_finish(); return 0; }
int main(int argc, char **argv) { pthread_t thread; struct sigaction sa = {}; time_t timer_log;//time_t就是long int 类 struct tm *tblock =NULL;/*定义一个变量*/ #if 1 if(daemon(0, 0) < 0) { perror("error daemon...\n"); exit(1); } #endif setlocale(LC_ALL, ""); #if 1 //FILE *fp_log; /*定义一个文件指针*/ int i_log; fp_log=fopen("/var/log/iftopd.log", "a+"); if(fp_log==NULL) /*判断文件是否打开成功*/ printf("File open error"); /*提示打开不成功*/ else { //time_t timer_log;//time_t就是long int 类 //struct tm *tblock =NULL; timer_log = time(NULL);//这一句也可以改成time(&timer); tblock = localtime(&timer_log); fprintf(fp_log,"start iftop time is: %s\n",asctime(tblock)); } #endif /* TODO: tidy this up */ /* read command line options and config file */ config_init(); options_set_defaults(); options_read_args(argc, argv); /* If a config was explicitly specified, whinge if it can't be found */ read_config(options.config_file, options.config_file_specified); options_make(); /* 修正参数 */ correction_parameter(); sa.sa_handler = finish; sigaction(SIGINT, &sa, NULL); pthread_mutex_init(&tick_mutex, NULL); packet_init(); init_history(); if (options.no_curses) { tui_init(); } else { ui_init(); } pthread_create(&thread, NULL, (void*)&packet_loop, NULL); /* Keep the starting time (used for timed termination) */ first_timestamp = time(NULL); if (options.no_curses) { if (options.timed_output) { while(!foad) { sleep(1); } } else { tui_loop(); } } else { ui_loop(); } pthread_cancel(thread); #if 1 #if 1 fprintf(fp_log," interface***** = %s \n",options.interface); fprintf(fp_log," speed_second_time = %d \n",options.speed_second_time); fprintf(fp_log," num_lines = %d \n",options.num_lines); #endif #if 1 if( NULL != fp_log) { time(&timer_log); tblock = localtime(&timer_log); fprintf(fp_log,"close iftop time is: %s\n",asctime(tblock)); } #endif i_log = fclose(fp_log); /*关闭打开的文件*/ if(i_log!=0) /*判断文件是否关闭成功*/ printf("File close error"); /*提示关闭 失败提示*/ #endif ui_finish(); return 0; }
int WINAPI WinMain(HINSTANCE h,HINSTANCE hprev,LPSTR cmdline,int n){ debug_init(LOG_FILE); uk_log("windows build: %s",BUILD); int full_throttle=0; nCmdShow=n; hinstance=h; symbol_mode=LOAD; // FIXME temporary debug shit #else int main(int argc,char *argv[]){ debug_init(LOG_FILE); conf_init(CONFIG_PATH,veta_symbolsloaded); uk_log("build: %s",BUILD); int full_throttle=0; symbol_mode=LOAD; symbol_file=SYMBOLS_FILE; for(int i=1;i<argc;i++){ if(!strcmp("--dump-symbols",argv[i])){ symbol_mode=DUMP; i++; if(i>=argc) usage(argv[0]); symbol_file=argv[i]; uk_log("Dumping to %s\n",symbol_file); }else if(!strcmp("--load-symbols",argv[i])){ symbol_mode=LOAD; i++; if(i>=argc) usage(argv[0]); symbol_file=argv[i]; }else if(!strcmp("--zoom",argv[i])){ selection_mode=ZOOM; }else if(!strcmp("--highlight",argv[i])){ selection_mode=HIGHLIGHT; }else if(!strcmp("--graphicsopt",argv[i])){ full_throttle=1; }else{ usage(argv[0]); } } #endif // Set up callbacks ui_onevent(veta_handleevent); ui_onclick(ui2_handle_click); ui_onrelease(ui2_handle_release); ui_haskeymap(veta_symbolsloaded); ui_render(veta_render); int x,y; conf_read_position(&x,&y); ui_init(conf_get_int("width",WIDTH),conf_get_int("height",HEIGHT),x,y); if(!symbolsloaded){ fprintf(stderr,"Failed to load symbols\n"); exit(1); } // Set up low level graphics and load the keymap // ui_init(WIDTH,HEIGHT,st->x,st->y); ui2_init(); ui2_add_widgets(); ui_loop(full_throttle); return 1; }
int main(int argc, char **argv) { return ui_loop(argc, argv, "texobj"); }