您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ui_init函数代码示例

51自学网 2021-06-03 09:06:56
  C++
这篇教程C++ ui_init函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ui_init函数的典型用法代码示例。如果您正苦于以下问题:C++ ui_init函数的具体用法?C++ ui_init怎么用?C++ ui_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ui_init函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ui_usb_mode_change

void ui_usb_mode_change(bool b_host_mode){	ui_init();}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:4,


示例2: main

intmain(int argc, char **argv) {	if (strcmp(basename(argv[0]), "recovery") != 0)	{	    if (strstr(argv[0], "flash_image") != NULL)	        return flash_image_main(argc, argv);	    if (strstr(argv[0], "volume") != NULL)	        return volume_main(argc, argv);	    if (strstr(argv[0], "edify") != NULL)	        return edify_main(argc, argv);	    if (strstr(argv[0], "dump_image") != NULL)	        return dump_image_main(argc, argv);	    if (strstr(argv[0], "erase_image") != NULL)	        return erase_image_main(argc, argv);	    if (strstr(argv[0], "mkyaffs2image") != NULL)	        return mkyaffs2image_main(argc, argv);	    if (strstr(argv[0], "unyaffs") != NULL)	        return unyaffs_main(argc, argv);        if (strstr(argv[0], "nandroid"))            return nandroid_main(argc, argv);        if (strstr(argv[0], "reboot"))            return reboot_main(argc, argv);#ifdef BOARD_RECOVERY_HANDLES_MOUNT        if (strstr(argv[0], "mount") && argc == 2 && !strstr(argv[0], "umount"))        {            load_volume_table();            return ensure_path_mounted(argv[1]);        }#endif        if (strstr(argv[0], "poweroff")){            return reboot_main(argc, argv);        }        if (strstr(argv[0], "setprop"))            return setprop_main(argc, argv);		return busybox_driver(argc, argv);	}    __system("/sbin/postrecoveryboot.sh");    int is_user_initiated_recovery = 0;    time_t start = time(NULL);    // If these fail, there's not really anywhere to complain...    freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);    freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);    printf("Starting recovery on %s", ctime(&start));    ui_init();    ui_print(EXPAND(RECOVERY_VERSION)"/n");    load_volume_table();    process_volumes();    LOGI("Processing arguments./n");    get_args(&argc, &argv);    int previous_runs = 0;    const char *send_intent = NULL;    const char *update_package = NULL;    const char *encrypted_fs_mode = NULL;    int wipe_data = 0, wipe_cache = 0;    int toggle_secure_fs = 0;    encrypted_fs_info encrypted_fs_data;    LOGI("Checking arguments./n");    int arg;    while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {        switch (arg) {        case 'p': previous_runs = atoi(optarg); break;        case 's': send_intent = optarg; break;        case 'u': update_package = optarg; break;        case 'w': #ifndef BOARD_RECOVERY_ALWAYS_WIPES		wipe_data = wipe_cache = 1;#endif		break;        case 'c': wipe_cache = 1; break;        case 'e': encrypted_fs_mode = optarg; toggle_secure_fs = 1; break;        case 't': ui_show_text(1); break;        case '?':            LOGE("Invalid command argument/n");            continue;        }    }    LOGI("device_recovery_start()/n");    device_recovery_start();    printf("Command:");    for (arg = 0; arg < argc; arg++) {        printf(" /"%s/"", argv[arg]);    }    printf("/n");    if (update_package) {        // For backwards compatibility on the cache partition only, if        // we're given an old 'root' path "CACHE:foo", change it to        // "/cache/foo".        if (strncmp(update_package, "CACHE:", 6) == 0) {            int len = strlen(update_package) + 10;            char* modified_path = malloc(len);            strlcpy(modified_path, "/cache/", len);            strlcat(modified_path, update_package+6, len);//.........这里部分代码省略.........
开发者ID:MiniCM4BCM21553,项目名称:BlackReactorRecovery,代码行数:101,


示例3: ui_usb_mode_change

void ui_usb_mode_change(bool b_host_mode){    UNUSED(b_host_mode);    ui_init();}
开发者ID:Dewb,项目名称:mod,代码行数:5,


示例4: main

intmain(int argc, char **argv) {    time_t start = time(NULL);    // If these fail, there's not really anywhere to complain...    freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);    freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);    printf("Starting recovery on %s", ctime(&start));    device_ui_init(&ui_parameters);    ui_init();    ui_set_background(BACKGROUND_ICON_INSTALLING);    load_volume_table();    get_args(&argc, &argv);    int previous_runs = 0;    const char *send_intent = NULL;    const char *update_package = NULL;    int wipe_data = 0, wipe_cache = 0;    //check delta update first    handle_deltaupdate_status();    int arg;    while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {        switch (arg) {        case 'p': previous_runs = atoi(optarg); break;        case 's': send_intent = optarg; break;        case 'u': update_package = optarg; break;        case 'w': wipe_data = wipe_cache = 1; break;        case 'c': wipe_cache = 1; break;        case 't': ui_show_text(1); break;        case '?':            LOGE("Invalid command argument/n");            continue;        }    }    device_recovery_start();    printf("Command:");    for (arg = 0; arg < argc; arg++) {        printf(" /"%s/"", argv[arg]);    }    printf("/n");    if (update_package) {        // For backwards compatibility on the cache partition only, if        // we're given an old 'root' path "CACHE:foo", change it to        // "/cache/foo".        if (strncmp(update_package, "CACHE:", 6) == 0) {            int len = strlen(update_package) + 10;            char* modified_path = malloc(len);            strlcpy(modified_path, "/cache/", len);            strlcat(modified_path, update_package+6, len);            printf("(replacing path /"%s/" with /"%s/")/n",                   update_package, modified_path);            update_package = modified_path;        }    }    printf("/n");    property_list(print_property, NULL);    printf("/n");    int status = INSTALL_SUCCESS;    if (update_package != NULL) {        status = install_package(update_package, &wipe_cache, TEMPORARY_INSTALL_FILE);        if (status == INSTALL_SUCCESS && wipe_cache) {            if (erase_volume("/cache")) {                LOGE("Cache wipe (requested by package) failed.");            }        }        if (status != INSTALL_SUCCESS) ui_print("Installation aborted./n");    } else if (wipe_data) {        if (device_wipe_data()) status = INSTALL_ERROR;        if (erase_volume("/data")) status = INSTALL_ERROR;        if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR;        if (status != INSTALL_SUCCESS) ui_print("Data wipe failed./n");    } else if (wipe_cache) {        if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR;        if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed./n");    } else {        status = INSTALL_ERROR;  // No command specified    }    if (status != INSTALL_SUCCESS) ui_set_background(BACKGROUND_ICON_ERROR);    if (status != INSTALL_SUCCESS || ui_text_visible()) {        prompt_and_wait();    }    // Otherwise, get ready to boot the main system...    finish_recovery(send_intent);    ui_print("Rebooting.../n");    android_reboot(ANDROID_RB_RESTART, 0, 0);    return EXIT_SUCCESS;}
开发者ID:ebmajor,项目名称:msm7627a_2038_recovery,代码行数:98,


示例5: main

int main(int argc, char *argv[]){   /*    * Alloc the global structures    * We can access these structs via the macro in ec_globals.h    */           globals_alloc();     GBL_PROGRAM = strdup(EC_PROGRAM);   GBL_VERSION = strdup(EC_VERSION);   SAFE_CALLOC(GBL_DEBUG_FILE, strlen(EC_PROGRAM) + strlen("-") + strlen(EC_VERSION) + strlen("_debug.log") + 1, sizeof(char));   sprintf(GBL_DEBUG_FILE, "%s-%s_debug.log", GBL_PROGRAM, EC_VERSION);      DEBUG_INIT();   DEBUG_MSG("main -- here we go !!");   /* initialize the filter mutex */   filter_init_mutex();      /* register the main thread as "init" */   ec_thread_register(EC_PTHREAD_SELF, "init", "initialization phase");      /* activate the signal handler */   signal_handler();      /* ettercap copyright */   fprintf(stdout, "/n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s/n/n",          GBL_PROGRAM, GBL_VERSION, EC_COPYRIGHT, EC_AUTHORS);      /* getopt related parsing...  */   parse_options(argc, argv);   /* check the date */   time_check();   /* load the configuration file */   load_conf();     /*     * get the list of available interfaces     *     * this function will not return if the -I option was    * specified on command line. it will instead print the    * list and exit    */   capture_getifs();      /* initialize the user interface */   ui_init();      /* initialize the network subsystem */   network_init();      /*     * always disable the kernel ip forwarding (except when reading from file).    * the forwarding will be done by ettercap.    */   if(!GBL_OPTIONS->read && !GBL_OPTIONS->unoffensive && !GBL_OPTIONS->only_mitm) {      disable_ip_forward();	#ifdef OS_LINUX      if (!GBL_OPTIONS->read)      	disable_interface_offload();#endif      /* binds ports and set redirect for ssl wrapper */      if(GBL_SNIFF->type == SM_UNIFIED && GBL_OPTIONS->ssl_mitm)         ssl_wrap_init();   }      /*     * drop root privileges     * we have already opened the sockets with high privileges    * we don't need anymore root privs.    */   drop_privs();/***** !! NO PRIVS AFTER THIS POINT !! *****/   /* load all the plugins */   plugin_load_all();   /* print how many dissectors were loaded */   conf_dissectors();      /* load the mac-fingerprints */   manuf_init();   /* load the tcp-fingerprints */   fingerprint_init();      /* load the services names */   services_init();      /* load http known fileds for user/pass */   http_fields_init();#ifdef HAVE_EC_LUA   /* Initialize lua */   ec_lua_init();//.........这里部分代码省略.........
开发者ID:Nuc1eoN,项目名称:ettercap,代码行数:101,


示例6: fileio_init

void running_machine::start(){	/* initialize basic can't-fail systems here */	fileio_init(this);	config_init(this);	input_init(this);	output_init(this);	state_init(this);	state_save_allow_registration(this, true);	palette_init(this);	render_init(this);	ui_init(this);	generic_machine_init(this);	generic_video_init(this);	generic_sound_init(this);	/* initialize the timers and allocate a soft_reset timer	   this must be done before cpu_init so that CPU's can allocate timers */	timer_init(this);	m_soft_reset_timer = timer_alloc(this, static_soft_reset, NULL);	/* init the osd layer */	osd_init(this);	/* initialize the base time (needed for doing record/playback) */	time(&m_base_time);	/* initialize the input system and input ports for the game	   this must be done before memory_init in order to allow specifying	   callbacks based on input port tags */	time_t newbase = input_port_init(this, m_game.ipt);	if (newbase != 0)		m_base_time = newbase;	/* intialize UI input */	ui_input_init(this);	/* initialize the streams engine before the sound devices start */	streams_init(this);	/* first load ROMs, then populate memory, and finally initialize CPUs	   these operations must proceed in this order */	rom_init(this);	memory_init(this);	watchdog_init(this);	/* allocate the gfx elements prior to device initialization */	gfx_init(this);	/* initialize natural keyboard support */	inputx_init(this);	/* initialize image devices */	image_init(this);	/* start up the devices */	m_devicelist.start_all();	/* call the game driver's init function	   this is where decryption is done and memory maps are altered	   so this location in the init order is important */	ui_set_startup_text(this, "Initializing...", true);	if (m_game.driver_init != NULL)		(*m_game.driver_init)(this);	/* finish image devices init process */	image_postdevice_init(this);	/* start the video and audio hardware */	video_init(this);	tilemap_init(this);	crosshair_init(this);	sound_init(this);	/* initialize the debugger */	if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)		debugger_init(this);	/* call the driver's _START callbacks */	if (m_config.m_machine_start != NULL)		(*m_config.m_machine_start)(this);	if (m_config.m_sound_start != NULL)		(*m_config.m_sound_start)(this);	if (m_config.m_video_start != NULL)		(*m_config.m_video_start)(this);	/* set up the cheat engine */    	cheat_init(this);	/* set up the hiscore engine */        hiscore_init(this);	/* disallow save state registrations starting here */	state_save_allow_registration(this, false);}
开发者ID:libretro,项目名称:mame2010-libretro,代码行数:95,


示例7: main_init

static void main_init(void){	/* add our icon path in case we aren't installed in the system prefix */	gchar *path;#ifdef G_OS_WIN32	gchar *install_dir = win32_get_installation_dir();	path = g_build_filename(install_dir, "share", "icons", NULL);	g_free(install_dir);#else	path = g_build_filename(GEANY_DATADIR, "icons", NULL);#endif	gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), path);	g_free(path);	/* inits */	ui_init_stock_items();	ui_init_builder();	main_widgets.window				= NULL;	app->project			= NULL;	ui_widgets.open_fontsel		= NULL;	ui_widgets.open_colorsel	= NULL;	ui_widgets.prefs_dialog		= NULL;	main_status.main_window_realized = FALSE;	file_prefs.tab_order_ltr		= FALSE;	file_prefs.tab_order_beside		= FALSE;	main_status.quitting			= FALSE;	ignore_callback	= FALSE;	app->tm_workspace		= tm_get_workspace();	ui_prefs.recent_queue				= g_queue_new();	ui_prefs.recent_projects_queue		= g_queue_new();	main_status.opening_session_files	= FALSE;	main_widgets.window = create_window1();	/* add recent projects to the Project menu */	ui_widgets.recent_projects_menuitem = ui_lookup_widget(main_widgets.window, "recent_projects1");	ui_widgets.recent_projects_menu_menubar = gtk_menu_new();	gtk_menu_item_set_submenu(GTK_MENU_ITEM(ui_widgets.recent_projects_menuitem),							ui_widgets.recent_projects_menu_menubar);	/* store important pointers for later reference */	main_widgets.toolbar = toolbar_init();	main_widgets.sidebar_notebook = ui_lookup_widget(main_widgets.window, "notebook3");	main_widgets.notebook = ui_lookup_widget(main_widgets.window, "notebook1");	main_widgets.editor_menu = create_edit_menu1();	main_widgets.tools_menu = ui_lookup_widget(main_widgets.window, "tools1_menu");	main_widgets.message_window_notebook = ui_lookup_widget(main_widgets.window, "notebook_info");	main_widgets.project_menu = ui_lookup_widget(main_widgets.window, "menu_project1_menu");	ui_widgets.toolbar_menu = create_toolbar_popup_menu1();	ui_init();	/* set widget names for matching with .gtkrc-2.0 */	gtk_widget_set_name(main_widgets.window, "GeanyMainWindow");	gtk_widget_set_name(ui_widgets.toolbar_menu, "GeanyToolbarMenu");	gtk_widget_set_name(main_widgets.editor_menu, "GeanyEditMenu");	gtk_widget_set_name(ui_lookup_widget(main_widgets.window, "menubar1"), "GeanyMenubar");	gtk_widget_set_name(main_widgets.toolbar, "GeanyToolbar");	gtk_window_set_default_size(GTK_WINDOW(main_widgets.window),		GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT);}
开发者ID:P-Ruiz,项目名称:geany,代码行数:64,


示例8: corange_init

void corange_init(const char* core_assets_path) {    /* Attach signal handlers */  signal(SIGABRT, corange_signal);  signal(SIGFPE, corange_signal);  signal(SIGILL, corange_signal);  signal(SIGINT, corange_signal);  signal(SIGSEGV, corange_signal);  signal(SIGTERM, corange_signal);    logout = fopen("output.log", "w");    at_error(corange_error);  at_warning(corange_warning);  at_debug(corange_debug);    /* Starting Corange */  debug("Starting Corange...");    /* Graphics Manager */  debug("Creating Graphics Manager...");  graphics_init();    /* Audio Manager */  debug("Creating Audio Manager...");  audio_init();    /* Joystick Manager */  debug("Creating Joystick Manager...");  joystick_init();    /* Network Manager */  debug("Creating Network Manager...");  net_init();    /* Asset Manager */  debug("Creating Asset Manager...");  debug("Core Assets At '%s' ...", core_assets_path);  asset_init();  asset_add_path_variable(P("$CORANGE"), P(core_assets_path));    asset_handler(renderable, "bmf", bmf_load_file, renderable_delete);  asset_handler(renderable, "obj", obj_load_file, renderable_delete);  asset_handler(renderable, "smd", smd_load_file, renderable_delete);  asset_handler(renderable, "ply", ply_load_file, renderable_delete);  asset_handler(skeleton, "skl", skl_load_file, skeleton_delete);  asset_handler(animation, "ani", ani_load_file, animation_delete);  asset_handler(cmesh, "col", col_load_file, cmesh_delete);  asset_handler(terrain, "raw", raw_load_file, terrain_delete);    asset_handler(texture, "bmp", bmp_load_file, texture_delete);  asset_handler(texture, "tga", tga_load_file, texture_delete);  asset_handler(texture, "dds", dds_load_file, texture_delete);  asset_handler(texture, "lut", lut_load_file, texture_delete);  asset_handler(texture, "acv", acv_load_file, texture_delete);    asset_handler(shader, "vs" , vs_load_file, shader_delete);  asset_handler(shader, "fs" , fs_load_file, shader_delete);  asset_handler(shader, "gs" , gs_load_file, shader_delete);  asset_handler(shader, "tcs" , tcs_load_file, shader_delete);  asset_handler(shader, "tes" , tes_load_file, shader_delete);    asset_handler(config, "cfg", cfg_load_file, config_delete);  asset_handler(lang, "lang", lang_load_file, lang_delete);  asset_handler(font, "fnt", font_load_file, font_delete);  asset_handler(material, "mat", mat_load_file, material_delete);  asset_handler(effect, "effect" , effect_load_file, effect_delete);    asset_handler(sound, "wav", wav_load_file, sound_delete);  asset_handler(music, "ogg", ogg_load_file, music_delete);  asset_handler(music, "mp3", mp3_load_file, music_delete);    /* Entity Manager */  debug("Creating Entity Manager...");    entity_init();    entity_handler(static_object, static_object_new, static_object_delete);  entity_handler(animated_object, animated_object_new, animated_object_delete);  entity_handler(physics_object, physics_object_new, physics_object_delete);  entity_handler(instance_object, instance_object_new, instance_object_delete);    entity_handler(camera, camera_new, camera_delete);  entity_handler(light, light_new, light_delete);  entity_handler(landscape, landscape_new, landscape_delete);  entity_handler(particles, particles_new, particles_delete);    /* UI Manager */  debug("Creating UI Manager...");    ui_init();    ui_handler(ui_rectangle, ui_rectangle_new, ui_rectangle_delete, ui_rectangle_event, ui_rectangle_update, ui_rectangle_render);  ui_handler(ui_text, ui_text_new, ui_text_delete, ui_text_event, ui_text_update, ui_text_render);  ui_handler(ui_spinner, ui_spinner_new, ui_spinner_delete, ui_spinner_event, ui_spinner_update, ui_spinner_render);  ui_handler(ui_button, ui_button_new, ui_button_delete, ui_button_event, ui_button_update, ui_button_render);  ui_handler(ui_textbox, ui_textbox_new, ui_textbox_delete, ui_textbox_event, ui_textbox_update, ui_textbox_render);  ui_handler(ui_browser, ui_browser_new, ui_browser_delete, ui_browser_event, ui_browser_update, ui_browser_render);//.........这里部分代码省略.........
开发者ID:ghosthamlet,项目名称:Corange,代码行数:101,


示例9: main

intmain(int argc, char **argv) {	if (strstr(argv[0], "recovery") == NULL)	{	    if (strstr(argv[0], "flash_image") != NULL)	        return flash_image_main(argc, argv);	    if (strstr(argv[0], "dump_image") != NULL)	        return dump_image_main(argc, argv);	    if (strstr(argv[0], "erase_image") != NULL)	        return erase_image_main(argc, argv);	    if (strstr(argv[0], "mkyaffs2image") != NULL)	        return mkyaffs2image_main(argc, argv);	    if (strstr(argv[0], "unyaffs") != NULL)	        return unyaffs_main(argc, argv);        if (strstr(argv[0], "amend"))            return amend_main(argc, argv);        if (strstr(argv[0], "nandroid"))            return nandroid_main(argc, argv);        if (strstr(argv[0], "reboot"))            return reboot_main(argc, argv);        if (strstr(argv[0], "setprop"))            return setprop_main(argc, argv);		return busybox_driver(argc, argv);	}    __system("/sbin/postrecoveryboot.sh");    create_fstab();        int is_user_initiated_recovery = 0;    time_t start = time(NULL);    // If these fail, there's not really anywhere to complain...    freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);    freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);    fprintf(stderr, "Starting recovery on %s", ctime(&start));    ui_init();    ui_print(EXPAND(RECOVERY_VERSION)"/n");#ifdef BOARD_GOAPK_DEFY    ui_print(EXPAND(RECOVERY_VERSION_GOAPK)"/n");    ui_print(EXPAND(RECOVERY_VERSION_QUN)"/n");#endif    get_args(&argc, &argv);    int previous_runs = 0;    const char *send_intent = NULL;    const char *update_package = NULL;    int wipe_data = 0, wipe_cache = 0;    int arg;    while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {        switch (arg) {        case 'p': previous_runs = atoi(optarg); break;        case 's': send_intent = optarg; break;        case 'u': update_package = optarg; break;        case 'w': wipe_data = wipe_cache = 1; break;        case 'c': wipe_cache = 1; break;        case '?':            LOGE("Invalid command argument/n");            continue;        }    }    device_recovery_start();    fprintf(stderr, "Command:");    for (arg = 0; arg < argc; arg++) {        fprintf(stderr, " /"%s/"", argv[arg]);    }    fprintf(stderr, "/n/n");    property_list(print_property, NULL);    fprintf(stderr, "/n");    int status = INSTALL_SUCCESS;        RecoveryCommandContext ctx = { NULL };    if (register_update_commands(&ctx)) {        LOGE("Can't install update commands/n");    }    if (update_package != NULL) {        if (wipe_data && erase_root("DATA:")) status = INSTALL_ERROR;        status = install_package(update_package);        if (status != INSTALL_SUCCESS) ui_print("Installation aborted./n");    } else if (wipe_data) {        if (device_wipe_data()) status = INSTALL_ERROR;        if (erase_root("DATA:")) status = INSTALL_ERROR;        if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR;        if (status != INSTALL_SUCCESS) ui_print("Data wipe failed./n");    } else if (wipe_cache) {        if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR;        if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed./n");    } else {        LOGI("Checking for extendedcommand.../n");        status = INSTALL_ERROR;  // No command specified        // we are starting up in user initiated recovery here        // let's set up some default options        signature_check_enabled = 0;        script_assert_enabled = 0;        is_user_initiated_recovery = 1;//.........这里部分代码省略.........
开发者ID:bandroidx,项目名称:bravo_recovery,代码行数:101,


示例10: main

intmain(int argc, char *argv[]){	printf("ISAKMP: main : <<<START>>> /n");	fd_set         *rfds, *wfds;	int             n, m;	size_t          mask_size;	struct timeval  tv, *timeout;			// closefrom(STDERR_FILENO + 1);	/*	 * Make sure init() won't alloc fd 0, 1 or 2, as daemon() will close	 * them.	 *//*	for (n = 0; n <= 2; n++) 		if (fcntl(n, F_GETFL, 0) == -1 && errno == EBADF)			(void) open("/dev/null", n ? O_WRONLY : O_RDONLY, 0);*/	/* Log cmd line parsing and initialization errors to stderr.  */	log_to(stderr);	parse_args(argc, argv);	log_init(debug);			/* Open protocols and services databases.  */	setprotoent(1);	setservent(1);	/* Open command fifo */	ui_init();	set_slave_signals();	/* Daemonize before forking unpriv'ed child */	if (!debug)		if (daemon(0, 0))			log_fatal("main: daemon (0, 0) failed");	/* Set timezone before priv'separation */	tzset();		write_pid_file();		/*	if (monitor_init(debug)) {		// The parent, with privileges enters infinite monitor loop.		//monitor_loop(debug);		//exit(0);	// Never reached.  	}*/	/* Child process only from this point on, no privileges left.  */	init(); 		/* If we wanted IKE packet capture to file, initialize it now.  */	if (pcap_file != 0)		log_packet_init(pcap_file);	/* Allocate the file descriptor sets just big enough.  */	// we change here 		//n = getdtablesize();	n = 1000;	mask_size = howmany(n, NFDBITS) * sizeof(fd_mask);		rfds = (fd_set *) malloc(mask_size);	if (!rfds)		log_fatal("main: malloc (%lu) failed",		    (unsigned long)mask_size);	wfds = (fd_set *) malloc(mask_size);	if (!wfds)		log_fatal("main: malloc (%lu) failed",		    (unsigned long)mask_size);	//monitor_init_done();	while (1) {		/* If someone has sent SIGHUP to us, reconfigure.  */		if (sighupped) {			sighupped = 0;			log_print("SIGHUP received");			reinit();		}		/* and if someone sent SIGUSR1, do a state report.  */		if (sigusr1ed) {			sigusr1ed = 0;			log_print("SIGUSR1 received");			report();		}		/*		 * and if someone set 'sigtermed' (SIGTERM, SIGINT or via the		 * UI), this indicates we should start a controlled shutdown		 * of the daemon.		 *		 * Note: Since _one_ message is sent per iteration of this//.........这里部分代码省略.........
开发者ID:mohammadhamad,项目名称:mhhgen,代码行数:101,


示例11: ps_init

/** * Initialize the playstate *  * @return GFraMe error code */static GFraMe_ret ps_init(int isLoading) {    GFraMe_ret rv;    GFraMe_save sv, *pSv;    int map, plX, plY, time;        // Open the configurations    rv = GFraMe_save_bind(&sv, CONFFILE);    GFraMe_assertRet(rv == GFraMe_ret_ok, "Error reading config file", __ret);    pSv = &sv;    // Read the desired fps (for update and drawing)    rv = GFraMe_save_read_int(&sv, "ufps", &_maxUfps);    if (rv != GFraMe_ret_ok)        _maxUfps = GAME_UFPS;    rv = GFraMe_save_read_int(&sv, "dfps", &_maxDfps);    if (rv != GFraMe_ret_ok)        _maxDfps = GAME_DFPS;    rv = GFraMe_save_read_int(&sv, "speedrun", &_ps_isSpeedrun);    if (rv != GFraMe_ret_ok)        _ps_isSpeedrun = 0;    GFraMe_save_close(&sv);    pSv = 0;        if (!isLoading) {        gv_init();                plX = 16;        plY = 184;        map = 0;    }    else {        rv = gv_load(SAVEFILE);        GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to load state", __ret);                plX = gv_getValue(DOOR_X) * 8;        plY = gv_getValue(DOOR_Y) * 8;        map = gv_getValue(MAP);    }    time = gv_getValue(GAME_TIME);    timer_init(time);        if (map >= 20) {        audio_playBoss();    }    else if (map >= 15) {        audio_playTensionGoesUp();    }    else if (map >= 4) {        audio_playMovingOn();    }    else {        audio_playIntro();    }    rv = ui_init();    GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to init ui", __ret);        rv = rg_init();    GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to registry ui", __ret);        rv = map_init(&m);    GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to init map", __ret);        rv = player_init(&p1, ID_PL1, 224, plX, plY);    GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to init player", __ret);        rv = player_init(&p2, ID_PL2, 240, plX, plY);    GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to init player", __ret);        rv = map_loadi(m, map);    GFraMe_assertRet(rv == GFraMe_ret_ok, "Failed to init map", __ret);    signal_init();        _timerTilCredits = 0;    _ps_onOptions = 0;    _ps_text = 0;    switchState = 0;    transition_initFadeOut();    #ifdef DEBUG    _updCalls = 0;    _drwCalls = 0;    _time = 0;    _ltime = 0;#endif        rv = GFraMe_ret_ok;__ret:    if (pSv)        GFraMe_save_close(pSv);        return rv;}
开发者ID:ratalaika,项目名称:big-15,代码行数:98,


示例12: main

intmain(int argc, char **argv) {//    while(1);	time_t start = time(NULL);	// If these fail, there's not really anywhere to complain...	freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);	freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);	//    printf("Starting recovery on %s", ctime(&start));//	printf("............just for aibing debug /n/r");//	while(1);	ui_init();	//    ui_set_background(BACKGROUND_ICON_INSTALLING);	load_volume_table();	get_args(&argc, &argv);	int previous_runs = 0;	const char *send_intent = NULL;	const char *update_package = NULL;	const char *encrypted_fs_mode = NULL;	int wipe_data = 0, wipe_cache = 0;	int toggle_secure_fs = 0;	encrypted_fs_info encrypted_fs_data; 	int arg;	while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {		switch (arg) {			case 'p': previous_runs = atoi(optarg); break;			case 's': send_intent = optarg; break;			case 'u': update_package = optarg; break;			case 'w': wipe_data = wipe_cache = 1; break;			case 'c': wipe_cache = 1; break;			case 'e': encrypted_fs_mode = optarg; toggle_secure_fs = 1; break;			case 't': ui_show_text(1); break;			case '?':				  LOGE("Invalid command argument/n");				  continue;		}	}	//reinit wipe_data and wipe_cache as it will do in clean boot;	wipe_data = wipe_cache = 0;	device_recovery_start();	printf("Aibing test Command:");	for (arg = 0; arg < argc; arg++) {		printf(" /"%s/"", argv[arg]);	}	printf("/n");	if (update_package) {		printf("in update_package run?????/n");		// For backwards compatibility on the cache partition only, if		// we're given an old 'root' path "CACHE:foo", change it to		// "/cache/foo".		if (strncmp(update_package, "CACHE:", 6) == 0) {			int len = strlen(update_package) + 10;			char* modified_path = malloc(len);			strlcpy(modified_path, "/cache/", len);			strlcat(modified_path, update_package+6, len);			printf("(replacing path /"%s/" with /"%s/")/n",					update_package, modified_path);			update_package = modified_path;		}	}	printf("list start/n");	property_list(print_property, NULL);	printf("list end/n");	int status = INSTALL_SUCCESS;	int mcu_status = INSTALL_SUCCESS;	int mpeg_status = INSTALL_SUCCESS;	int overridekey_status = INSTALL_SUCCESS;	int tractor_prop_status = INSTALL_SUCCESS;	int radio_status = INSTALL_SUCCESS;	if (toggle_secure_fs) {		if (strcmp(encrypted_fs_mode,"on") == 0) {			encrypted_fs_data.mode = MODE_ENCRYPTED_FS_ENABLED;			printf("Enabling Encrypted FS./n");		} else if (strcmp(encrypted_fs_mode,"off") == 0) {			encrypted_fs_data.mode = MODE_ENCRYPTED_FS_DISABLED;			printf("Disabling Encrypted FS./n");		} else {			printf("Error: invalid Encrypted FS setting./n");			status = INSTALL_ERROR;		}		// Recovery strategy: if the data partition is damaged, disable encrypted file systems.		// This preventsthe device recycling endlessly in recovery mode.		if ((encrypted_fs_data.mode == MODE_ENCRYPTED_FS_ENABLED) &&				(read_encrypted_fs_info(&encrypted_fs_data))) {			printf("Encrypted FS change aborted, resetting to disabled state./n");			encrypted_fs_data.mode = MODE_ENCRYPTED_FS_DISABLED;		}		if (status != INSTALL_ERROR) {			if (erase_volume("/data")) {				printf("Data wipe failed./n");				status = INSTALL_ERROR;			} else if (erase_volume("/cache")) {				printf("Cache wipe failed./n");				status = INSTALL_ERROR;//.........这里部分代码省略.........
开发者ID:xwliu,项目名称:open-ivi.MX53,代码行数:101,


示例13: a_init_all

//* //* Init All Resources//* void a_init_all(){  //-- Init  ui_init();                        //-- Init Event Handler  ag_init();                        //-- Init Graphic Framebuffer}
开发者ID:Racing1,项目名称:AROMA-Installer,代码行数:8,


示例14: main

intmain(int argc, char **argv){    time_t start = time(NULL);    // If these fail, there's not really anywhere to complain...    freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);    freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);    fprintf(stderr, "Starting recovery on %s", ctime(&start));    ui_init();    ui_print("Android system recovery utility/n");    get_args(&argc, &argv);    int previous_runs = 0;    const char *send_intent = NULL;    const char *update_package = NULL;    int wipe_data = 0, wipe_cache = 0;    int arg;    while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {        switch (arg) {        case 'p': previous_runs = atoi(optarg); break;        case 's': send_intent = optarg; break;        case 'u': update_package = optarg; break;        case 'w': wipe_data = wipe_cache = 1; break;        case 'c': wipe_cache = 1; break;        case '?':            LOGE("Invalid command argument/n");            continue;        }    }    fprintf(stderr, "Command:");    for (arg = 0; arg < argc; arg++) {        fprintf(stderr, " /"%s/"", argv[arg]);    }    fprintf(stderr, "/n/n");    property_list(print_property, NULL);    fprintf(stderr, "/n");#if TEST_AMEND    test_amend();#endif    RecoveryCommandContext ctx = { NULL };    if (register_update_commands(&ctx)) {        LOGE("Can't install update commands/n");    }    int status = INSTALL_SUCCESS;    if (update_package != NULL) {        status = install_package(update_package);        if (status != INSTALL_SUCCESS) ui_print("Installation aborted./n");    } else if (wipe_data || wipe_cache) {        if (wipe_data && erase_root("DATA:")) status = INSTALL_ERROR;        if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR;        if (status != INSTALL_SUCCESS) ui_print("Data wipe failed./n");    } else {        status = INSTALL_ERROR;  // No command specified    }    if (status != INSTALL_SUCCESS) ui_set_background(BACKGROUND_ICON_ERROR);    if (status != INSTALL_SUCCESS || ui_text_visible()) prompt_and_wait();    // If there is a radio image pending, reboot now to install it.    maybe_install_firmware_update(send_intent);    // Otherwise, get ready to boot the main system...    finish_recovery(send_intent);    ui_print("Rebooting.../n");    sync();    reboot(RB_AUTOBOOT);    return EXIT_SUCCESS;}
开发者ID:Jib-BAOSP,项目名称:platform_recovery,代码行数:77,


示例15: main

intmain(int argc, char **argv) {    time_t start = time(NULL);    // If these fail, there's not really anywhere to complain...    freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);    freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);    printf("Starting recovery on %s", ctime(&start));    device_ui_init(&ui_parameters);    ui_init();    ui_set_background(BACKGROUND_ICON_INSTALLING);    load_volume_table();    get_args(&argc, &argv);    int previous_runs = 0;    const char *send_intent = NULL;    const char *update_package = NULL;    const char *update_patch = NULL;	const char *file_copy_from_partition_args = NULL;	const char *copy_custom_files_dir = NULL; //add ainuo	const char *file1_copy_from_partition_args = NULL;    int wipe_data = 0, wipe_cache = 0;    int reboot_to_factorymode = 0;#ifdef RECOVERY_HAS_MEDIA    int wipe_media = 0;#endif /* RECOVERY_HAS_MEDIA */#ifdef RECOVERY_HAS_EFUSE    const char *efuse_version = NULL;	const char *efuse_machine = NULL;					/* add for m6 */    int set_efuse_version = 0;    int set_efuse_ethernet_mac = 0;    int set_efuse_bluetooth_mac = 0;	int set_efuse_machine_id = 0;						/* add for m6 */#ifdef EFUSE_LICENCE_ENABLE    int set_efuse_audio_license = 0;#endif /* EFUSE_LICENCE_ENABLE */#endif /* RECOVERY_HAS_EFUSE */    int arg;    while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {        switch (arg) {        case 'a': copy_custom_files_dir = optarg; break; //add ainuo        case 'p': previous_runs = atoi(optarg); break;        case 's': send_intent = optarg; break;        case 'u': update_package = optarg; break;		case 'x': update_patch = optarg; break;        case 'w': wipe_data = wipe_cache = 1; break;        case 'c': wipe_cache = 1; break;        case 'f': reboot_to_factorymode = 1; break;		case 'z': file_copy_from_partition_args = optarg; break;		case 'y': file1_copy_from_partition_args = optarg; break;#ifdef RECOVERY_HAS_MEDIA        case 'm': wipe_media = 1; break;#endif /* RECOVERY_HAS_MEDIA */        case 't': ui_show_text(1); break;#ifdef RECOVERY_HAS_EFUSE        case 'v': set_efuse_version = 1; efuse_version = optarg; break;        case 'd': set_efuse_ethernet_mac = 1; break;        case 'b': set_efuse_bluetooth_mac = 1; break;		case 'M': set_efuse_machine_id = 1; efuse_machine = optarg; break; 	/* add for m6 */#ifdef EFUSE_LICENCE_ENABLE        case 'l': set_efuse_audio_license = 1; break;#endif /* EFUSE_LICENCE_ENABLE */#endif /* RECOVERY_HAS_EFUSE */        case '?':            LOGE("Invalid command argument/n");            continue;        }    }    device_recovery_start();    printf("Command:");    for (arg = 0; arg < argc; arg++) {        printf(" /"%s/"", argv[arg]);    }    printf("/n");    /**     *  Disable auto reformat, we should *NOT* do this.     *     *  For /media partition, we cannot do it because this will break     *  any file system that's non-FAT.     */#if 0    if (ensure_path_mounted("/data") != 0) {        ui_print("Can't mount 'data', wipe it!/n");        if (erase_volume("/data")) {            ui_print("Data wipe failed./n");        }    }    if (ensure_path_mounted("/cache") != 0) {        ui_print("Can't mount 'cache', wipe it!/n");        if (erase_volume("/cache")) {            ui_print("Cache wipe failed./n");        }    }//.........这里部分代码省略.........
开发者ID:fards,项目名称:ainol_elfii_bootable,代码行数:101,


示例16: main

/*! /brief Main function. Execution starts here. */int main(void){    uint8_t write_data[PATTERN_TEST_LENGTH];    uint8_t read_data[PATTERN_TEST_LENGTH];    uint32_t file_size = 0,remaining_len = 0;;    struct i2c_master_packet tx_buf = {        .address     = SLAVE_ADDRESS,        .data_length = PATTERN_TEST_LENGTH,        .data        = write_data,        .ten_bit_address = false,        .high_speed      = false,        .hs_master_code  = 0x0,    };    struct i2c_master_packet rx_buf = {        .address     = SLAVE_ADDRESS,        .data_length = 1,        .data        = read_data,        .ten_bit_address = false,        .high_speed      = false,        .hs_master_code  = 0x0,    };    uint8_t nb_twi_packets_sent;    uint16_t cdc_rx_size;    irq_initialize_vectors();    cpu_irq_enable();    sleepmgr_init();    system_init();    configure_usart();    ui_init();    ui_powerdown();    udc_start();    printf("Start application/r/n");    while (true) {        if (!b_com_port_opened) {            continue;        }        if (b_cdc_data_rx == true) {            b_cdc_data_rx = false;            cdc_rx_size = udi_cdc_get_nb_received_data();            udi_cdc_read_buf((void *)cdc_data, cdc_rx_size);            if (file_size == 0 && cdc_rx_size == 4) {                MSB0W(file_size) = cdc_data[0];                MSB1W(file_size) = cdc_data[1];                MSB2W(file_size) = cdc_data[2];                MSB3W(file_size) = cdc_data[3];                printf("File size :%ld/r/n",file_size);            }            remaining_len += cdc_rx_size;            if (cdc_rx_size == TARGET_PAGE_SIZE/2) {                if (!b_wait) {                    memcpy((void *)(write_data), (const void *)cdc_data, cdc_rx_size);                    b_wait = true;                    if (file_size + 4 == remaining_len) {                        tx_buf.data_length = TARGET_PAGE_SIZE/2;                        while (i2c_master_write_packet_wait(&i2c_master_instance, &tx_buf) != STATUS_OK) ;                    }                }                else {                    memcpy((void *)(write_data + (TARGET_PAGE_SIZE/2)), (const void *)cdc_data, cdc_rx_size);                    tx_buf.data_length = TARGET_PAGE_SIZE;                    while (i2c_master_write_packet_wait(&i2c_master_instance, &tx_buf) != STATUS_OK) ;                    b_wait = false;                }            } else {                if ((cdc_rx_size) <= PATTERN_TEST_LENGTH) {                    tx_buf.data_length = cdc_rx_size;                    memcpy((void *)(write_data), (const void *)cdc_data, cdc_rx_size);                    while (i2c_master_write_packet_wait(&i2c_master_instance, &tx_buf) != STATUS_OK) ;                } else {                    nb_twi_packets_sent = 0;                    while(cdc_rx_size / PATTERN_TEST_LENGTH) {                        tx_buf.data_length = PATTERN_TEST_LENGTH;                        memcpy((void *)(write_data), (const void *)(&cdc_data[(nb_twi_packets_sent++) * (PATTERN_TEST_LENGTH)]), PATTERN_TEST_LENGTH);                        while (i2c_master_write_packet_wait(&i2c_master_instance, &tx_buf) != STATUS_OK) ;                        cdc_rx_size -= (PATTERN_TEST_LENGTH);                    }                    if(cdc_rx_size) {                        tx_buf.data_length = cdc_rx_size;                        memcpy((void *)(write_data), (const void *)(&cdc_data[(nb_twi_packets_sent) * (PATTERN_TEST_LENGTH)]), cdc_rx_size);                        while (i2c_master_write_packet_wait(&i2c_master_instance, &tx_buf) != STATUS_OK) ;                        cdc_rx_size = 0;                    }                }            }        }        if (i2c_master_read_packet_wait(&i2c_master_instance, &rx_buf) == STATUS_OK) {            udi_cdc_write_buf((const void *)(rx_buf.data),(iram_size_t)read_data[0]);            if (file_size + 4 == remaining_len) {                printf("File transfer successfully, file size:%ld, transefer size :%ld/r/n",file_size,remaining_len-4);//.........这里部分代码省略.........
开发者ID:thegeek82000,项目名称:asf,代码行数:101,


示例17: main

/*! /brief Main function. Execution starts here. */int main(void){	//uint8_t i = 0;	uint16_t temp_crc;	irq_initialize_vectors();	cpu_irq_enable();	// Initialize the sleep manager	sleepmgr_init();	sysclk_init();	board_init();	ui_init();	ui_powerdown();	memories_initialization();	// Initialize LCD	et024006_Init( FOSC0, FOSC0 );	gpio_set_gpio_pin(ET024006DHU_BL_PIN);		//et024006_PrintConsole("Welcome Eric", BLACK, -1);	//clear_lcd	et024006_DrawFilledRect(1, 1, ET024006_WIDTH, ET024006_HEIGHT, BLACK);		// Initialize AES module	aes_task();	// Start TC	tc_task();	Init_System_Status();	// Initialize crc for fast calculations	crcInit();			// Read the stored values from the flash	Load_stored_values();	//i = sizeof(stored_values_t) - sizeof(uint16_t);	temp_crc = crcFast((const uint8_t *)&Stored_values_ram, 192);	//temp_crc1 = crcFast("123456789", 9);	if (temp_crc == Stored_values_ram.block_crc)	{		stSystemStatus.stored_value_crc_status = 1;	}	//Stored_values_ram.salt[5] = 0x4d68ab23;		//Update_stored_values();	// Start USB stack to authorize VBus monitoring	udc_start();	if (!udc_include_vbus_monitoring()) {		// VBUS monitoring is not available on this product		// thereby VBUS has to be considered as present		main_vbus_action(true);	}	// The main loop manages only the power mode	// because the USB management is done by interrupt	while (true)	{		if (main_b_msc_enable)		{			if (!udi_msc_process_trans())			{				sleepmgr_enter_sleep();			}		}		else		{			sleepmgr_enter_sleep();		}		//main_process_mode();	}}
开发者ID:cryptx2,项目名称:cryptx2-firmware,代码行数:77,


示例18: main

intmain(int argc, char **argv){        bool force_ascii = false;        int delay = 500;        int opt;        while ((opt = getopt(argc, argv, "ad:h")) != -1) {                switch (opt) {                case 'a':                        force_ascii = true;                        break;                case 'd':                {                        char *end;                        float val = strtof(optarg, &end);                        if (*end) {                                fprintf(stderr, "Delay argument (-d) requires "                                        "a number/n");                                exit(2);                        }                        delay = 1000 * val;                        break;                }                default:                        fprintf(stderr, "Usage: %s [-a] [-d delay]/n", argv[0]);                        if (opt == 'h') {                                fprintf(stderr,                                        "/n"                                        "Display CPU usage as a bar chart./n"                                        "/n"                                        "Options:/n"                                        "  -a       Use ASCII-only bars (instead of Unicode)/n"                                        "  -d SECS  Specify delay between updates (decimals accepted)/n"                                        "/n"                                        "If your bars look funky, use -a or specify LANG=C./n"                                        "/n"                                        "For kernels prior to 2.6.37, using a small delay on a large system can/n"                                        "induce significant system time overhead./n");                                exit(0);                        }                        exit(2);                }        }        if (optind < argc) {                fprintf(stderr, "Unexpected arguments/n");                exit(2);        }        struct sigaction sa = {                .sa_handler = on_sigint        };        sigaction(SIGINT, &sa, NULL);        cpustats_init();        term_init();        ui_init(force_ascii);        struct cpustats *before = cpustats_alloc(),                *after = cpustats_alloc(),                *delta = cpustats_alloc(),                *prevLayout = cpustats_alloc();        cpustats_read(before);        cpustats_subtract(prevLayout, before, before);        ui_layout(prevLayout);        fflush(stdout);        while (!need_exit) {                // Sleep or take input                struct pollfd pollfd = {                        .fd = 0,                        .events = POLLIN                };                if (poll(&pollfd, 1, delay) < 0 && errno != EINTR)                        epanic("poll failed");                if (pollfd.revents & POLLIN) {                        char ch = 0;                        if (read(0, &ch, 1) < 0)                                epanic("read failed");                        if (ch == 'q')                                break;                }                // Get new statistics                cpustats_read(after);                cpustats_subtract(delta, after, before);                // Recompute the layout if necessary                if (term_check_resize() || !cpustats_sets_equal(delta, prevLayout))                        ui_layout(delta);                // Show the load average                float loadavg[3];                cpustats_loadavg(loadavg);                ui_show_load(loadavg);                if (delta->real) {                        ui_compute_bars(delta);                        ui_show_bars();                }//.........这里部分代码省略.........
开发者ID:aclements,项目名称:cpubars,代码行数:101,


示例19: startClient

void startClient() {	char *logfile = "/sdcard/client.out";	FILE *fp;	  if((fp=freopen("/sdcard/freeciv_out_client.log", "w" ,stdout))==NULL) {	    printf("Cannot open file./n");	    exit(1);	  }	  if((fp=freopen("/sdcard/freeciv_err_client.log", "w" ,stderr))==NULL) {	    printf("Cannot open file./n");	    exit(1);	  }	  setenv ("HOME", "/sdcard/FreeCiv", 0);	  setenv ("USER", "Sparky", 0);	LOGI("Hello JNI");	  log_init(logfile, LOG_DEBUG			  , NULL);	int i, loglevel;	int ui_options = 0;	bool ui_separator = FALSE;	char *option=NULL;	bool user_tileset = FALSE;	  i_am_client(); /* Tell to libfreeciv that we are client */	  /* Ensure that all AIs are initialized to unused state */	  ai_type_iterate(ai) {	    init_ai(ai);	  } ai_type_iterate_end;	init_our_capability();	  (void)user_username(default_user_name, MAX_LEN_NAME);	  if (!is_valid_username(default_user_name)) {	    char buf[sizeof(default_user_name)];	    my_snprintf(buf, sizeof(buf), "_%s", default_user_name);	    if (is_valid_username(buf)) {	      sz_strlcpy(default_user_name, buf);	    } else {	      my_snprintf(default_user_name, sizeof(default_user_name),			  "player%d", myrand(10000));	    }	  }	  game.all_connections = conn_list_new();	  game.est_connections = conn_list_new();	  ui_init();	  fc_init_network();	  init_our_capability();	  chatline_common_init();	  init_player_dlg_common();	  init_themes();	  options_init();	  strcpy(default_sound_plugin_name,"none");	  server_port = 9999;	  sz_strlcpy(server_host, "localhost");	  options_load();	  mysrand(time(NULL));	  helpdata_init();	  boot_help_texts(NULL);	  LOGI("Reading tilespec");	  tilespec_try_read("amplio2", TRUE);	  LOGI("Done reading tilespec");	  overview_size_changed();	  audio_real_init("stdsounds", "none");	  //audio_play_music("music_start", NULL);	  auto_connect = TRUE;	  init_mapcanvas_and_overview();	  /* run gui-specific client */	  ui_main(0, NULL);	  /* termination */	  client_exit();	return;}
开发者ID:teknoa,项目名称:freeciv-android,代码行数:98,


示例20: main

//.........这里部分代码省略.........		STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));	}	if (g_keymapname[0] == 0)	{		if (locale && xkeymap_from_locale(locale))		{			fprintf(stderr, "Autoselected keyboard map %s/n", g_keymapname);		}		else		{			STRNCPY(g_keymapname, "en-us", sizeof(g_keymapname));		}	}	if (locale)		xfree(locale);	if (prompt_password && read_password(password, sizeof(password)))		flags |= RDP_LOGON_AUTO;	if (g_title[0] == 0)	{		strcpy(g_title, "rdesktop - ");		strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - "));	}#ifdef RDP2VNC	rdp2vnc_connect(server, flags, domain, password, shell, directory);	return 0;#else	if (!ui_init())		return 1;#ifdef WITH_RDPSND	if (g_rdpsnd)	{		if (!rdpsnd_init(rdpsnd_optarg))		{			warning("Initializing sound-support failed!/n");		}	}#endif	if (g_lspci_enabled)		lspci_init();	rdpdr_init();	while (run_count < 2 && continue_connect)	/* add support for Session Directory; only reconnect once */	{		if (run_count == 0)		{			if (!rdp_connect(server, flags, domain, password, shell, directory))				return 1;		}		else if (!rdp_reconnect			 (server, flags, domain, password, shell, directory, g_redirect_cookie))			return 1;		/* By setting encryption to False here, we have an encrypted login 		   packet but unencrypted transfer of other packets */		if (!g_packet_encryption)			g_encryption = False;
开发者ID:kmwang,项目名称:rdesktop-1.6.0-km,代码行数:67,


示例21: config_init

void running_machine::start(){	// initialize basic can't-fail systems here	config_init(*this);	m_input = auto_alloc(*this, input_manager(*this));	output_init(*this);	palette_init(*this);	m_render = auto_alloc(*this, render_manager(*this));	generic_machine_init(*this);	generic_sound_init(*this);	// allocate a soft_reset timer	m_soft_reset_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::soft_reset), this));	// init the osd layer	m_osd.init(*this);	// create the video manager	m_video = auto_alloc(*this, video_manager(*this));	ui_init(*this);	// initialize the base time (needed for doing record/playback)	::time(&m_base_time);	// initialize the input system and input ports for the game	// this must be done before memory_init in order to allow specifying	// callbacks based on input port tags	time_t newbase = input_port_init(*this);	if (newbase != 0)		m_base_time = newbase;	// intialize UI input	ui_input_init(*this);	// initialize the streams engine before the sound devices start	m_sound = auto_alloc(*this, sound_manager(*this));	// first load ROMs, then populate memory, and finally initialize CPUs	// these operations must proceed in this order	rom_init(*this);	memory_init(*this);	watchdog_init(*this);	// must happen after memory_init because this relies on generic.spriteram	generic_video_init(*this);	// allocate the gfx elements prior to device initialization	gfx_init(*this);	// initialize natural keyboard support	inputx_init(*this);	// initialize image devices	image_init(*this);	tilemap_init(*this);	crosshair_init(*this);	// initialize the debugger	if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)		debugger_init(*this);	// call the game driver's init function	// this is where decryption is done and memory maps are altered	// so this location in the init order is important	ui_set_startup_text(*this, "Initializing...", true);	// start up the devices	const_cast<device_list &>(devicelist()).start_all();	// if we're coming in with a savegame request, process it now	const char *savegame = options().state();	if (savegame[0] != 0)		schedule_load(savegame);	// if we're in autosave mode, schedule a load	else if (options().autosave() && (m_system.flags & GAME_SUPPORTS_SAVE) != 0)		schedule_load("auto");	// set up the cheat engine	m_cheat = auto_alloc(*this, cheat_manager(*this));	// disallow save state registrations starting here	m_save.allow_registration(false);}
开发者ID:bdidier,项目名称:MAME-OS-X,代码行数:84,


示例22: ui_usb_mode_change

void ui_usb_mode_change(bool b_host_mode){	(void)b_host_mode;	ui_init();}
开发者ID:zhengwang721,项目名称:ASF,代码行数:5,


示例23: main

//.........这里部分代码省略.........	if (g_title[0] == 0)	{		strcpy(g_title, "rdesktop - ");		strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - "));	}#ifdef RDP2VNC	rdp2vnc_connect(server, flags, domain, g_password, shell, directory);	return EX_OK;#else	/* Only startup ctrl functionality is seamless are used for now. */	if (g_use_ctrl && g_seamless_rdp)	{		if (ctrl_init(server, domain, g_username) < 0)		{			error("Failed to initialize ctrl mode.");			exit(1);		}		if (ctrl_is_slave())		{			fprintf(stdout,				"rdesktop in slave mode sending command to master process./n");			if (g_seamless_spawn_cmd[0])				return ctrl_send_command("seamless.spawn", g_seamless_spawn_cmd);			fprintf(stdout, "No command specified to be spawn in seamless mode./n");			return EX_USAGE;		}	}	if (!ui_init())		return EX_OSERR;#ifdef WITH_RDPSND	if (!rdpsnd_init(rdpsnd_optarg))		warning("Initializing sound-support failed!/n");#endif	if (g_lspci_enabled)		lspci_init();	rdpdr_init();	g_reconnect_loop = False;	while (1)	{		rdesktop_reset_state();		if (g_redirect)		{			STRNCPY(domain, g_redirect_domain, sizeof(domain));			xfree(g_username);			g_username = (char *) xmalloc(strlen(g_redirect_username) + 1);			STRNCPY(g_username, g_redirect_username, strlen(g_redirect_username) + 1);			STRNCPY(server, g_redirect_server, sizeof(server));			flags |= RDP_INFO_AUTOLOGON;			fprintf(stderr, "Redirected to %[email
C++ ui_lookup_widget函数代码示例
C++ ui_get_showing_back_button函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。