const char* CScutLuaLan::Get(const char *group, const char *key) { if (m_curLan.empty()) { ScutLog("current language is empty"); return ""; } LANINFO_MAP::iterator it = m_mapLanInfo.find(m_curLan); if (it == m_mapLanInfo.end()) { ScutLog("cann't find language %s", m_curLan.c_str()); return ""; } assert(it->second != NULL); if (NULL == it->second) { return ""; } if (NULL == it->second->pIni) { load_ini(m_curLan.c_str()); } return it->second->pIni->Get(group, key, ""); }
static void assure_windows_ready(void) { bool ok = FALSE; DBG_MEM(memout<<" file " <<__FILE__<<" line "<<__LINE__<< checkmem2<<endl); DBG_INI(dout<<"file "<<__FILE__<<" line "<<__LINE__<<" settings.numlock_on = "<<settings.numlock_on<<endl); settings_loaded = load_ini(); DBG_INI(dout<<"file "<<__FILE__<<" line "<<__LINE__<<" settings.numlock_on = "<<settings.numlock_on<<endl); // if(settings_loaded == FALSE) DBG_INI(dout<<"edit.cpp line "<<__LINE__<<" shell_command.s = °"<<settings.shell_command.s<<"°"<<endl); // checkmem("EDIT.C line 150"); help_loaded = load_help(); // checkmem("EDIT.C line 152"); if (!Screen.iscolor()) { /* color card and color monitor */ setting_defaultcolors(0); } DBG_INI(dout<<"file "<<__FILE__<<" line "<<__LINE__<<" settings.numlock_on = "<<settings.numlock_on<<endl); ok = keybd_setup(); if(!ok) err_exit("Failed to setup Keyboard", 23); // status_setup(); my_new_scrap(); DBG_INI(dout<<"edit.cpp line "<<__LINE__<<" shell_command.s = °"<<settings.shell_command.s<<"°"<<endl); DBG_MEM(memout<<" file " <<__FILE__<<" line "<<__LINE__<<checkmem2 <<endl); }
int main(int argc, char* argv[]) { script_init(); load_ini(); engine_init(); // includes ttf init too vid_init(); dump_lua(); game_loop(); engine_shutdown(); script_shutdown(); return 0; }
layer_interface * qtvplugin_grid::load_initial_plugin(QString strSLibPath,viewer_interface * ptrviewer) { //!In this instance, we will see how to create a new instance for each ptrviewer qtvplugin_grid * instance = 0; //!1.Check whether there is already a instance for ptrviewer( viewer_interface) mutex_instances.lock(); if (map_instances.empty()==true) { map_instances[ptrviewer] = this; instance = this; } else if (map_instances.contains(ptrviewer)==false) { //Create a new instance for ptrviewer instance = new qtvplugin_grid; map_instances[ptrviewer] = instance; } else instance = map_instances[ptrviewer]; mutex_instances.unlock(); //!2.if the instance correspones to this, do init operations. if (instance==this) { QFileInfo info(strSLibPath); m_SLLibName = info.completeBaseName(); m_SLLibPath = strSLibPath; m_pVi = ptrviewer; mutex_instances.lock(); m_nInstance = ++count_instances[m_SLLibName]; mutex_instances.unlock(); loadTranslation(); load_ini(); } //!3.if the instance not correspones to this, call the instances' load_initial_plugin instead. else { layer_interface * ret = instance->load_initial_plugin(strSLibPath,ptrviewer); assert(ret==instance); } return instance; }
SquealConfig *squeal_config_init(const char *file) { SquealConfig *config = (SquealConfig *) malloc(sizeof(SquealConfig)); if (config == NULL) { fprintf(stderr, "squeal_config_init: unable to allocate config"); exit(EXIT_FAILURE); } FILE *fp = fopen(file, "r"); if (fp == NULL) { fprintf(stderr, "squeal_config_init: config file %s specified is not readable or does not exist", file); exit(EXIT_FAILURE); } config->file = squeal_string_init(file, sizeof(file)); load_ini(fp, &config); fclose(fp); return config; }
int main(int argc, char *argv[]) { section *s; if(argc < 3){ fprintf(stderr,"usage: %s <inifile> <bootfile>\n",argv[0]); return 1; } if((argc > 3) && !strcmp(argv[3],"-floppy")){ make_floppy = 1; } if(s = load_ini(argv[1])){ makeboot(s,argv[2]); } else { fprintf(stderr,"error: can't read %s\n",argv[1]); } return 0; }
C_RESULT ardrone_tool_init_custom(void) { ardrone_application_default_config.navdata_options = NAVDATA_OPTION_FULL_MASK /*& ~(NAVDATA_OPTION_MASK(NAVDATA_TRACKERS_SEND_TAG) | NAVDATA_OPTION_MASK(NAVDATA_VISION_OF_TAG) | NAVDATA_OPTION_MASK(NAVDATA_VISION_PERF_TAG) | NAVDATA_OPTION_MASK(NAVDATA_VISION_TAG))*/; if (IS_ARDRONE2) { ardrone_application_default_config.video_codec = H264_360P_CODEC; } else { ardrone_application_default_config.video_codec = UVLC_CODEC; } ardrone_application_default_config.bitrate_ctrl_mode = 1; /// Init specific code for application ardrone_navdata_handler_table[NAVDATA_IHM_PROCESS_INDEX].data = &cfg; // Add inputs //ardrone_tool_input_add( &gamepad ); /*ardrone_tool_input_add( &radioGP ); ardrone_tool_input_add( &ps3pad ); ardrone_tool_input_add( &joystick ); ardrone_tool_input_add( &wiimote_device );*/ load_ini(); printf("Default control : %s (0x%08x, %s)\n", default_control->name, default_control->serial, default_control->filename); ardrone_tool_input_add(&control_device); cfg.default_control = default_control; cfg.devices = devices; #ifdef USE_ARDRONE_VICON START_THREAD(vicon, &cfg); #endif // USE_ARDRONE_VICON START_THREAD(ihm, &cfg); #ifdef RAW_CAPTURE START_THREAD(raw_capture, &cfg); #endif START_THREAD(remote_console, &cfg); /************************ VIDEO STAGE CONFIG ******************************/ #define NB_NAVIGATION_POST_STAGES 10 uint8_t post_stages_index = 0; //Alloc structs specific_parameters_t * params = (specific_parameters_t *)vp_os_calloc(1,sizeof(specific_parameters_t)); specific_stages_t * navigation_pre_stages = (specific_stages_t*)vp_os_calloc(1, sizeof(specific_stages_t)); specific_stages_t * navigation_post_stages = (specific_stages_t*)vp_os_calloc(1, sizeof(specific_stages_t)); vp_api_picture_t * in_picture = (vp_api_picture_t*) vp_os_calloc(1, sizeof(vp_api_picture_t)); vp_api_picture_t * out_picture = (vp_api_picture_t*) vp_os_calloc(1, sizeof(vp_api_picture_t)); in_picture->width = STREAM_WIDTH; in_picture->height = STREAM_HEIGHT; out_picture->framerate = 20; out_picture->format = PIX_FMT_RGB24; out_picture->width = STREAM_WIDTH; out_picture->height = STREAM_HEIGHT; out_picture->y_buf = vp_os_malloc( STREAM_WIDTH * STREAM_HEIGHT * 3 ); out_picture->cr_buf = NULL; out_picture->cb_buf = NULL; out_picture->y_line_size = STREAM_WIDTH * 3; out_picture->cb_line_size = 0; out_picture->cr_line_size = 0; //Alloc the lists navigation_pre_stages->stages_list = NULL; navigation_post_stages->stages_list = (vp_api_io_stage_t*)vp_os_calloc(NB_NAVIGATION_POST_STAGES,sizeof(vp_api_io_stage_t)); //Fill the POST-stages------------------------------------------------------ vp_os_memset(&vlat, 0, sizeof( vlat )); vlat.state = 0; vlat.last_decoded_frame_info = (void*)&vec; navigation_post_stages->stages_list[post_stages_index].name = "(latency estimator)"; navigation_post_stages->stages_list[post_stages_index].type = VP_API_FILTER_DECODER; navigation_post_stages->stages_list[post_stages_index].cfg = (void*)&vlat; navigation_post_stages->stages_list[post_stages_index++].funcs = vp_stages_latency_estimation_funcs; #ifdef RECORD_RAW_VIDEO vp_os_memset(&vrc, 0, sizeof( vrc )); #warning Recording RAW video option enabled in Navigation. vrc.stage = 3; #warning We have to get the stage number an other way vp_os_memset(&vrc, 0, sizeof(vrc)); navigation_post_stages->stages_list[post_stages_index].name = "(raw video recorder)"; navigation_post_stages->stages_list[post_stages_index].type = VP_API_FILTER_DECODER; navigation_post_stages->stages_list[post_stages_index].cfg = (void*)&vrc; navigation_post_stages->stages_list[post_stages_index++].funcs = video_recorder_funcs; #endif // RECORD_RAW_VIDEO #if defined(FFMPEG_SUPPORT) && defined(RECORD_FFMPEG_VIDEO) #warning Recording FFMPEG (reencoding)video option enabled in Navigation. vp_os_memset(&ffmpeg_vrc, 0, sizeof(ffmpeg_vrc)); ffmpeg_vrc.numframes = &vec.controller.num_frames; ffmpeg_vrc.stage = pipeline.nb_stages; navigation_post_stages->stages_list[post_stages_index].name = "(ffmpeg recorder)"; navigation_post_stages->stages_list[post_stages_index].type = VP_API_FILTER_DECODER; navigation_post_stages->stages_list[post_stages_index].cfg = (void*)&ffmpeg_vrc; navigation_post_stages->stages_list[post_stages_index++].funcs = video_ffmpeg_recorder_funcs; #endif vp_os_memset(&draw_trackers_cfg, 0, sizeof( draw_trackers_funcs )); draw_trackers_cfg.last_decoded_frame_info = (void*)&vec; navigation_post_stages->stages_list[post_stages_index].type = VP_API_FILTER_DECODER; navigation_post_stages->stages_list[post_stages_index].cfg = (void*)&draw_trackers_cfg; navigation_post_stages->stages_list[post_stages_index++].funcs = draw_trackers_funcs; vp_os_memset(>kconf, 0, sizeof( gtkconf )); gtkconf.rowstride = out_picture->width * 3; gtkconf.last_decoded_frame_info = (void*)&vec; gtkconf.desired_display_width = 0; /* auto */ gtkconf.desired_display_height = 0; /* auto */ gtkconf.gdk_interpolation_mode = 0; /* fastest */ navigation_post_stages->stages_list[post_stages_index].name = "(Gtk display)"; navigation_post_stages->stages_list[post_stages_index].type = VP_API_OUTPUT_SDL; navigation_post_stages->stages_list[post_stages_index].cfg = (void*)>kconf; navigation_post_stages->stages_list[post_stages_index++].funcs = vp_stages_output_gtk_funcs; //Define the list of stages size navigation_pre_stages->length = 0; navigation_post_stages->length = post_stages_index; params->in_pic = in_picture; params->out_pic = out_picture; params->pre_processing_stages_list = navigation_pre_stages; params->post_processing_stages_list = navigation_post_stages; params->needSetPriority = 0; params->priority = 0; START_THREAD(video_stage, params); video_stage_init(); if (2 <= ARDRONE_VERSION ()) { START_THREAD (video_recorder, NULL); video_recorder_init (); } else { printf ("Don't start ... version is %d\n", ARDRONE_VERSION ()); } /************************ END OF VIDEO STAGE CONFIG ***********************/ #ifdef PC_USE_POLARIS START_THREAD(polaris, &cfg); #endif // PC_USE_POLARIS #ifdef USE_TABLE_PILOTAGE START_THREAD(novadem, (void*) ("/dev/ttyUSB0")); #endif // USE_TABLE_PILOTAGE return C_OK; }
int main(int argc, char **argv) { char *file = NULL; section *s; if(argc < 2){ usage: fprintf(stderr,"usage: %s [--littleendian (default)] [--bigendian ] [ --strip-binary <binary ] [ --strip-debug] [ --sparc | -s ] [ <inifile> ... ] -o <bootfile>\n",argv[0]); return 1; } argc--; argv++; while(argc){ if(!strcmp(*argv,"--sparc")) { make_sparcboot = 1; } else if(!strcmp(*argv, "--bigendian")) { target_endian = BE; } else if(!strcmp(*argv,"-o")) { argc--; argv++; if(argc) { file = *argv; } else { goto usage; } } else if(!strcmp(*argv, "--strip-binary")) { argc--; argv++; if(argc) { strip_binary = *argv; } else { goto usage; } } else if(!strcmp(*argv, "--strip-debug")) { strip_debug = 1; } else { if(load_ini(*argv) == NULL) { fprintf(stderr,"warning: cannot load '%s'\n",*argv); } } argc--; argv++; } if((argc > 3) && !strcmp(argv[3],"-sparc")){ make_sparcboot = 1; } if(!file){ fprintf(stderr,"error: no output specified\n"); goto usage; } if(!first){ fprintf(stderr,"error: no data to write?!\n"); goto usage; } makeboot(first,file); return 0; }