这篇教程C++ util_concat函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中util_concat函数的典型用法代码示例。如果您正苦于以下问题:C++ util_concat函数的具体用法?C++ util_concat怎么用?C++ util_concat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了util_concat函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: archdep_boot_pathchar *archdep_default_sysfile_pathlist(const char *emu_id){ static char *default_path; if (default_path == NULL) { const char *boot_path = archdep_boot_path(); default_path = util_concat(boot_path, "//", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING, boot_path, "//DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING, boot_path, "//PRINTER", NULL); } return default_path;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:14,
示例2: archdep_expand_path/* return malloc'd version of full pathname of orig_name */int archdep_expand_path(char **return_path, const char *orig_name){ /* Unix version. */ if (*orig_name == '/') { *return_path = lib_stralloc(orig_name); } else { static char *cwd; cwd = ioutil_current_dir(); *return_path = util_concat(cwd, "/", orig_name, NULL); lib_free(cwd); } return 0;}
开发者ID:kleopatra999,项目名称:VICE-2,代码行数:15,
示例3: util_concatFILE *archdep_mkstemp_fd(char **filename, const char *mode){ char *tmp; FILE *fd; if (getenv("temp")) { tmp = util_concat(getenv("temp"), tmpnam(NULL), NULL); } else if (getenv("tmp")) { tmp = util_concat(getenv("tmp"), tmpnam(NULL), NULL); } else { tmp = lib_stralloc(tmpnam(NULL)); } fd = fopen(tmp, mode); if (fd == NULL) { return NULL; } *filename = tmp; return fd;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:23,
示例4: _splitpathchar *archdep_program_name(void){ static char *name = NULL; if (!name) { char drive[_MAX_DRIVE]; char dir[_MAX_DIR]; char fname[_MAX_FNAME+_MAX_EXT]; char ext[_MAX_EXT]; _splitpath(argv0, drive, dir, fname, ext); name = util_concat(fname, ext, NULL); } return name;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:14,
示例5: digimax_cmdline_options_initint digimax_cmdline_options_init(void){ char *temp1, *temp2; if (cmdline_register_options(cmdline_options) < 0) { return -1; } if (machine_class == VICE_MACHINE_VIC20) { temp1 = util_gen_hex_address_list(0x9800, 0x9900, 0x20); temp2 = util_gen_hex_address_list(0x9c00, 0x9d00, 0x20); digimax_address_list = util_concat(". (", temp1, "/", temp2, ")", NULL); lib_free(temp2); } else { temp1 = util_gen_hex_address_list(0xde00, 0xe000, 0x20); digimax_address_list = util_concat(". (0xDD00: Userport/", temp1, ")", NULL); } lib_free(temp1); base_cmdline_options[0].description = digimax_address_list; return cmdline_register_options(base_cmdline_options);}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:23,
示例6: translate_textchar *cmdline_options_get_description(int counter){ if (options[counter].use_description_id == USE_DESCRIPTION_ID) { return translate_text(options[counter].description_trans); } else if (options[counter].use_description_id == USE_DESCRIPTION_COMBO) { if (options[counter].combined_string) { lib_free(options[counter].combined_string); } options[counter].combined_string = util_concat(translate_text(options[counter].description_trans), options[counter].description, NULL); return options[counter].combined_string; } else { return (char *)_(options[counter].description); }}
开发者ID:Yifei0727,项目名称:emu-ex-plus-alpha,代码行数:14,
示例7: ioutil_count_dir_items/* NOTE: even when _DIRENT_HAVE_D_TYPE is defined, d_type may still be returned as DT_UNKNOWN - in that case we must fall back to using stat instead. */static int ioutil_count_dir_items(const char *path){ DIR *dirp; struct dirent *dp;/* #ifndef _DIRENT_HAVE_D_TYPE */ unsigned int len, isdir; char *filename; int retval;/* #endif */ dirs_amount = 0; files_amount = 0; dirp = opendir(path); if (dirp == NULL) { return -1; } dp = readdir(dirp); while (dp != NULL) {#ifdef _DIRENT_HAVE_D_TYPE if (dp->d_type != DT_UNKNOWN) { if (dp->d_type == DT_DIR) { dirs_amount++; } else { files_amount++; } dp = readdir(dirp); } else {#endif filename = util_concat(path, FSDEV_DIR_SEP_STR, dp->d_name, NULL); retval = ioutil_stat(filename, &len, &isdir); if (retval == 0) { if (isdir) { dirs_amount++; } else { files_amount++; } } dp = readdir(dirp); lib_free(filename);#ifdef _DIRENT_HAVE_D_TYPE }#endif } closedir(dirp); return 0;}
开发者ID:Nikolaj64,项目名称:emu-ex-plus-alpha,代码行数:54,
示例8: ui_exitvoid ui_exit(void){ ui_button_t b; int value1, value2; char *s = util_concat(_("Exit "), (machine_class != VICE_MACHINE_VSID) ? machine_name : "SID", _(" emulator"), NULL);#ifdef HAVE_FULLSCREEN fullscreen_suspend(1);#endif resources_get_int("ConfirmOnExit", &value1); resources_get_int("SaveResourcesOnExit", &value2); b = UI_BUTTON_YES; if ((value1) && (!value2)) { b = ui_ask_yesno(s, _("Do you really want to exit?")); } if (b == UI_BUTTON_YES) { if (value2) { b = UI_BUTTON_YES; if (value1) { b = ui_ask_confirmation(s, _("Save the current settings?")); } if (b == UI_BUTTON_YES) { if (resources_save(NULL) < 0) { ui_error(_("Cannot save settings.")); b = UI_BUTTON_CANCEL; } } } if (b != UI_BUTTON_CANCEL) { /* ui_autorepeat_on(); */ ui_restore_mouse();#ifdef HAVE_FULLSCREEN fullscreen_suspend(0);#endif ui_dispatch_events(); lib_free(s);#ifdef USE_UI_THREADS dthread_shutdown();#endif exit(0); }; } lib_free(s); vsync_suspend_speed_eval();}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:49,
示例9: archdep_expand_path/* return malloced version of full pathname of filename */int archdep_expand_path(char **return_path, const char *filename){ if (filename[0] == '//' || filename[1] == ':') { *return_path = lib_stralloc(filename); } else { char *p = (char *)malloc(512); while (getcwd(p, 512) == NULL) { return 0; } *return_path = util_concat(p, "//", filename, NULL); lib_free(p); } return 0;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:16,
示例10: UI_CALLBACKstatic UI_CALLBACK(openGL_set_desktoprefresh){ char *enter_refresh_rate = util_concat(_("Enter refresh rate"), " (Hz): ", NULL); char *refresh_rate = util_concat(_("Refresh rate"), ": ", NULL); if (!CHECK_MENUS) { float f; char *buf = lib_calloc(sizeof(char), 10); sprintf(buf, "%.0f", openGL_get_canvas_refreshrate()); ui_input_string(refresh_rate, enter_refresh_rate, buf, 10); f = (float) strtol(buf, NULL, 10); openGL_set_canvas_refreshrate(f); lib_free(buf); lib_free(enter_refresh_rate); lib_free(refresh_rate); } else { if (openGL_available(0) && openGL_sync_enabled()) { ui_menu_set_sensitive(w, 1); } else { ui_menu_set_sensitive(w, 0); } }}
开发者ID:markjreed,项目名称:vice-emu,代码行数:24,
示例11: archdep_user_config_path/** /brief Construct filename for quickload/quicksave snapshots * * /return filename for the quickload/save file, heap-allocated by VICE, so * free after use with lib_free() */static char *quicksnap_filename(void){ char *fname; const char *mname; char *cfg; mname = machine_class == VICE_MACHINE_C64SC ? "c64sc" : machine_name; cfg = archdep_user_config_path(); fname = util_concat(cfg, "/", mname, ".vsf", NULL);#if 0 lib_free(cfg);#endif debug_gtk3("quicksnap_filename = %s.", fname); return fname;}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:20,
示例12: ioutil_filldirstatic void ioutil_filldir(const char *path, ioutil_name_table_t *dirs, ioutil_name_table_t *files){ DIR *dirp = NULL; struct dirent *dp = NULL; int dir_count = 0; int file_count = 0;/* #ifndef _DIRENT_HAVE_D_TYPE */ unsigned int len, isdir; char *filename; int retval;/* #endif */ dirp = opendir(path); dp = readdir(dirp); while (dp != NULL) {#ifdef _DIRENT_HAVE_D_TYPE if (dp->d_type != DT_UNKNOWN) { if (dp->d_type == DT_DIR) { dirs[dir_count].name = lib_stralloc(dp->d_name); dir_count++; } else { files[file_count].name = lib_stralloc(dp->d_name); file_count++; } dp = readdir(dirp); } else {#endif filename = util_concat(path, FSDEV_DIR_SEP_STR, dp->d_name, NULL); retval = ioutil_stat(filename, &len, &isdir); if (retval == 0) { if (isdir) { dirs[dir_count].name = lib_stralloc(dp->d_name); dir_count++; } else { files[file_count].name = lib_stralloc(dp->d_name); file_count++; } } dp = readdir(dirp); lib_free(filename);#ifdef _DIRENT_HAVE_D_TYPE }#endif } closedir(dirp);}
开发者ID:Nikolaj64,项目名称:emu-ex-plus-alpha,代码行数:48,
示例13: cart_game_dynmenustatic void cart_game_dynmenu(HMENU menu){ cartridge_info_t *cart_info = cartridge_get_info_list(); int i; char *name; DeleteMenu(menu, 0, MF_BYPOSITION); for (i = 0; cart_info[i].name; ++i) { if (cart_info[i].flags == CARTRIDGE_GROUP_GAME) { name = util_concat(cart_info[i].name, " ", translate_text(IDS_IMAGE), "...", NULL); AppendMenu(menu, MF_STRING, current_dyn_id++, name); lib_free(name); } }}
开发者ID:kleopatra999,项目名称:VICE-2,代码行数:16,
示例14: unamechar *platform_get_sco_runtime_os(void){ int retval = 0; struct utsname name; FILE *infile; int amount = 0; int i = 0; char *tempfile = NULL; char *tempsystem = NULL; if (!got_os) { buffer[0] = 0; retval = uname(&name); if (!retval) { sprintf(buffer, "%s", name.version); } else { tempfile = archdep_tmpnam(); tempsystem = util_concat("uname -v >", tempfile, NULL); system(tempsystem); infile = fopen(tempfile, "rb"); if (infile) { amount = fread(buffer, 1, 80, infile); if (amount) { while (buffer[i] != '/n') { i++; } buffer[i] = 0; } fclose(infile); } unlink(tempfile); lib_free(tempfile); lib_free(tempsystem); } if (buffer[0] == '2') { sprintf(platform_os, "SCO Unix v4.x"); } else if (buffer[0] == '5' || buffer[0] == '6') { sprintf(platform_os, "SCO Openserver %s", buffer); } else if (buffer[0] == '7') { sprintf(platform_os, "SCO Unixware %s", buffer); } else { sprintf(platform_os, "SCO Unix"); } got_os = 1; } return platform_os;}
开发者ID:Yifei0727,项目名称:emu-ex-plus-alpha,代码行数:47,
示例15: lib_strallocrawfile_info_t *rawfile_open(const char *file_name, const char *path, unsigned int command){ rawfile_info_t *info; char *complete; FILE *fd; const char *mode = NULL; if (path == NULL) complete = lib_stralloc(file_name); else complete = util_concat(path, FSDEV_DIR_SEP_STR, file_name, NULL); switch (command) { case FILEIO_COMMAND_READ: mode = MODE_READ; break; case FILEIO_COMMAND_WRITE: mode = MODE_WRITE; break; case FILEIO_COMMAND_APPEND: mode = MODE_APPEND; break; case FILEIO_COMMAND_APPEND_READ: mode = MODE_APPEND_READ_WRITE; break; default: return NULL; } fd = fopen(complete, mode); if (fd == NULL) { lib_free(complete); return NULL; } info = lib_malloc(sizeof(rawfile_info_t)); info->fd = fd; util_fname_split(complete, &(info->path), &(info->name)); info->read_only = 0; lib_free(complete); return info;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:47,
示例16: UI_MENU_CALLBACKstatic UI_MENU_CALLBACK(about_callback){ int active = 1; int i; int j; char *tmp; if (activated) { sdl_ui_clear(); i = 0; sdl_ui_print_center("VICE", i++); sdl_ui_print_center("Versatile Commodore Emulator", i++);#ifdef USE_SVN_REVISION sdl_ui_print_center("Version " VERSION " rev " VICE_SVN_REV_STRING, i);#else sdl_ui_print_center("Version " VERSION, i);#endif i++;#ifdef USE_SDLUI2 sdl_ui_print_center("SDL2", i++);#else sdl_ui_print_center("SDL", i++);#endif i++; sdl_ui_print_center("The VICE Team", i++); for (j = 0; core_team[j].name; j++) { tmp = util_concat("(C) ", core_team[j].years, " ", core_team[j].name, NULL); sdl_ui_print_center(tmp, i++); lib_free(tmp); } sdl_ui_refresh(); while (active) { switch (sdl_ui_menu_poll_input()) { case MENU_ACTION_CANCEL: case MENU_ACTION_EXIT: case MENU_ACTION_SELECT: active = 0; break; default: SDL_Delay(10); break; } } } return NULL;}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:47,
示例17: ui_aboutvoid ui_about(void){ APTR gui = GroupObject, End; int i = 0; static const char *authors_start[] = { "VICE", "", "Versatile Commodore Emulator", "",#ifdef USE_SVN_REVISION "Version " VERSION "rev " VICE_SVN_REV_STRING " (" PLATFORM_CPU " " PLATFORM_OS " " PLATFORM_COMPILER ")",#else "Version " VERSION " (" PLATFORM_CPU " " PLATFORM_OS " " PLATFORM_COMPILER ")",#endif "", "The VICE Team", NULL}; static const char *authors_end[] = { "", "Official VICE homepage:", "http://vice-emu.sourceforge.net/", NULL}; char *tmp = NULL; for (i = 0; authors_start[i] != NULL; i++) { if (i <= 5) { /* centered */ DoMethod(gui, OM_ADDMEMBER, CLabel(authors_start[i])); } else { DoMethod(gui, OM_ADDMEMBER, LLabel(authors_start[i])); } } for (i = 0; core_team[i].name; i++) { tmp = util_concat("Copyright /xa9 ", core_team[i].years, " ", core_team[i].name, NULL); DoMethod(gui, OM_ADDMEMBER, LLabel(tmp)); lib_free(tmp); } for (i = 0; authors_end[i] != NULL; i++) { DoMethod(gui, OM_ADDMEMBER, LLabel(authors_end[i])); } mui_show_dialog(gui, translate_text(IDS_ABOUT), NULL);}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:46,
示例18: uidata_get_pixbuf/** /brief Get a pixbuf from the GResource blob * * /param name virtual path to the file * * /return pixbuf or `NULL` on error */GdkPixbuf * uidata_get_pixbuf(const char *name){ GdkPixbuf *buf; GError *err = NULL; char *path; path = util_concat(UIDATA_ROOT_PATH, "/", name, NULL); debug_gtk3("attempting to load resource '%s'.", path); buf = gdk_pixbuf_new_from_resource(path, &err); lib_free(path); if (buf == NULL) { debug_gtk3("failed: %s.", err->message); /* TODO: log error */ g_clear_error(&err); } return buf;}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:23,
示例19: debug_create_new_filestatic void debug_create_new_file(void){ char *filename, *st; const char *directory; debug_close_file(); resources_get_string("EventSnapshotDir", &directory); st = lib_msprintf("debug%06d", debug_file_current); filename = util_concat(directory, st, FSDEV_EXT_SEP_STR, "log", NULL); lib_free(st); debug_file = fopen(filename, MODE_WRITE_TEXT); lib_free(filename);}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:17,
示例20: archdep_home_path/* create the default directory where prefs, fliplist, autostart images etc are stored a pointer to the resulting path is returned, and it should be freed by the caller. */static char *archdep_make_default_pref_path(int create){ char *path; if (archdep_pref_path == NULL) { const char *home; home = archdep_home_path(); path = util_concat(home, "/.vice", NULL); } else { path = lib_stralloc(archdep_pref_path); } if(create) { if (access(path, F_OK)) { mkdir(path, S_IRWXU); } } return path;}
开发者ID:kleopatra999,项目名称:VICE-2,代码行数:19,
示例21: archdep_search_pathstatic int archdep_search_path(const char *name, char *pBuf, int lBuf){ const int flags = SEARCH_CUR_DIRECTORY|SEARCH_IGNORENETERRS; char *path = ""; /* PATH environment variable */ char *pgmName = util_concat(name, ".exe", NULL); // Search the program in the path DosScanEnv("PATH", &path); if (DosSearchPath(flags, path, pgmName, pBuf, lBuf)) { return -1; } lib_free(pgmName); return 0;}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:17,
示例22: archdep_default_loggerint archdep_default_logger(const char *lvl, const char *txt){ // // This is used if archdep_open_default_log_file returns NULL //#ifndef __X1541__ char *text = util_concat(lvl, txt, NULL); WinSendMsg(hwndLog, WM_INSERT, text, FALSE); lib_free(text);#endif if (fLog) { fprintf(fLog, "%s%s/n", lvl, txt); } return 0;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:18,
示例23: lib_mallocDIR *opendir(const char *path){ DIR *dir; TCHAR *st_filter; dir = lib_malloc(sizeof(DIR)); dir->filter = util_concat(path, "//*", NULL); st_filter = system_mbstowcs_alloc(dir->filter); dir->handle = FindFirstFile(st_filter, &dir->find_data); system_mbstowcs_free(st_filter); if (dir->handle == INVALID_HANDLE_VALUE) { return NULL; } dir->first_passed = 0; return dir;}
开发者ID:lakizoli,项目名称:vice-2.4-android,代码行数:18,
示例24: rawfile_removeunsigned int rawfile_remove(const char *src_name, const char *path){ char *complete_src; int rc; if (path == NULL) complete_src = lib_stralloc(src_name); else complete_src = util_concat(path, FSDEV_DIR_SEP_STR, src_name, NULL); rc = ioutil_remove(complete_src); lib_free(complete_src); if (rc < 0) return FILEIO_FILE_NOT_FOUND; return FILEIO_FILE_SCRATCHED;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:19,
示例25: archdep_search_pathint archdep_search_path(const char *name, char *pBuf, int lBuf){ const int flags = SEARCH_CUR_DIRECTORY|SEARCH_IGNORENETERRS; char *path = ""; /* PATH environment variable */ char *pgmName = util_concat(name, ".exe", NULL); // Search the program in the path if (DosScanEnv("PATH", &path)) { log_warning(archlog, "Environment variable PATH not found."); } if (DosSearchPath(flags, path, pgmName, pBuf, lBuf)) { log_error(archlog, "File /"%s/" not found.", pgmName); return -1; } lib_free(pgmName); return 0;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:19,
示例26: util_concatFILE *archdep_open_default_log_file(void){ if (run_from_wb) { char *fname; FILE *f; fname = util_concat(archdep_boot_path(), "vice.log", NULL); f = fopen(fname, MODE_WRITE_TEXT); lib_free(fname); if (f == NULL) { return stdout; } return f; } else { return stdout; }}
开发者ID:r-type,项目名称:vice-libretro,代码行数:20,
示例27: server_helpintserver_help(int sock, int argc, char **argv){ server_function_t *func; char buffer[RECV_BUFFER]; if (strncmp(argv[0], "help", 4)) { server_reply(sock, "Unknown command"); } server_reply(sock, "HELP:"); for (func = server_functions; func->sf_name; ++func) { util_concat(buffer, sizeof buffer, func->sf_name, "/t", func->sf_help, NULL); server_reply(sock, buffer); } return 1;}
开发者ID:badzong,项目名称:mopher,代码行数:20,
注:本文中的util_concat函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ util_err函数代码示例 C++ util_calloc函数代码示例 |