Index: trunk/src/librnd/core/compat_fs.c =================================================================== --- trunk/src/librnd/core/compat_fs.c (revision 30939) +++ trunk/src/librnd/core/compat_fs.c (revision 30940) @@ -56,7 +56,7 @@ #include -char *pcb_get_wd(char *path) +char *rnd_get_wd(char *path) { #if defined(RND_HAVE_GETCWD) return getcwd(path, PCB_PATH_MAX); @@ -87,7 +87,7 @@ } #undef MKDIR -int pcb_file_readable(const char *path) +int rnd_file_readable(const char *path) { FILE *f; f = pcb_fopen(NULL, path, "r"); @@ -98,7 +98,7 @@ return 0; } -int pcb_spawnvp(const char **argv) +int rnd_spawnvp(const char **argv) { #if defined(RND_USE_SPAWNVP) int result = _spawnvp(_P_WAIT, argv[0], (const char *const *) argv); @@ -137,17 +137,17 @@ * the returned string is made up of the directory plus the name * variable. For example: * - * pcb_tempfile_name_new("myfile") might return + * rnd_tempfile_name_new("myfile") might return * "/var/tmp/pcb.123456/myfile". * * If mkdtemp() is not available then 'name' is ignored and the * insecure tmpnam() function is used. * - * Files/names created with pcb_tempfile_name_new() should be unlinked + * Files/names created with rnd_tempfile_name_new() should be unlinked * with tempfile_unlink to make sure the temporary directory is also * removed when mkdtemp() is used. */ -char *pcb_tempfile_name_new(const char *name) +char *rnd_tempfile_name_new(const char *name) { char *tmpfile = NULL; @@ -193,7 +193,7 @@ mytmpdir = (char *) malloc(sizeof(char) * (strlen(tmpdir) + 1 + strlen(TEMPLATE) + 1)); if (mytmpdir == NULL) { - fprintf(stderr, "pcb_tempfile_name_new(): malloc failed()\n"); + fprintf(stderr, "rnd_tempfile_name_new(): malloc failed()\n"); exit(1); } @@ -202,7 +202,7 @@ (void) strcat(mytmpdir, RND_DIR_SEPARATOR_S); (void) strcat(mytmpdir, TEMPLATE); if (mkdtemp(mytmpdir) == NULL) { - fprintf(stderr, "pcb_spawnvp(): mkdtemp (\"%s\") failed\n", mytmpdir); + fprintf(stderr, "rnd_spawnvp(): mkdtemp (\"%s\") failed\n", mytmpdir); free(mytmpdir); return NULL; } @@ -236,7 +236,7 @@ /* If we have mkdtemp() then our temp file lives in a temporary directory and * we need to remove that directory too. */ -int pcb_tempfile_unlink(char *name) +int rnd_tempfile_unlink(char *name) { #ifdef DEBUG /* SDB says: Want to keep old temp files for examination when debugging */ @@ -272,8 +272,8 @@ } else { - fprintf(stderr, "pcb_tempfile_unlink(): Unable to determine temp directory name from the temp file\n"); - fprintf(stderr, "pcb_tempfile_unlink(): \"%s\"\n", name); + fprintf(stderr, "rnd_tempfile_unlink(): Unable to determine temp directory name from the temp file\n"); + fprintf(stderr, "rnd_tempfile_unlink(): \"%s\"\n", name); rc2 = -1; } @@ -330,7 +330,7 @@ return st.st_mtime; } -int pcb_is_path_abs(const char *fn) +int rnd_is_path_abs(const char *fn) { #ifdef __WIN32__ /* full path with drive, e.g. c:\foo */ Index: trunk/src/librnd/core/compat_fs.h =================================================================== --- trunk/src/librnd/core/compat_fs.h (revision 30939) +++ trunk/src/librnd/core/compat_fs.h (revision 30940) @@ -1,20 +1,20 @@ /* Returns pointer to current working directory. If 'path' is not NULL, then the current working directory is copied to the array pointed to by 'path' */ -char *pcb_get_wd(char *path); +char *rnd_get_wd(char *path); /* alternative to system() for proper argument passing */ -int pcb_spawnvp(const char **argv); +int rnd_spawnvp(const char **argv); /* Return 1 if path is a file that can be opened for read */ -int pcb_file_readable(const char *path); +int rnd_file_readable(const char *path); /* Creates a new temporary file name. Warning: race condition: doesn't create the file! */ -char *pcb_tempfile_name_new(const char *name); +char *rnd_tempfile_name_new(const char *name); /* remove temporary file and _also_ free the memory for name * (this fact is a little confusing) */ -int pcb_tempfile_unlink(char *name); +int rnd_tempfile_unlink(char *name); /* Return non-zero if fn is an absolute path */ -int pcb_is_path_abs(const char *fn); +int rnd_is_path_abs(const char *fn); Index: trunk/src/librnd/core/conf.c =================================================================== --- trunk/src/librnd/core/conf.c (revision 30939) +++ trunk/src/librnd/core/conf.c (revision 30940) @@ -285,7 +285,7 @@ for (e = htsi_first(&conf_files); e; e = htsi_next(&conf_files, e)) { strcpy(fn, e->key); - if (pcb_file_readable(path)) { + if (rnd_file_readable(path)) { lht_doc_t *d = conf_load_plug_file(path, 0); if (d != NULL) { int res = conf_merge_plug(d, role, path); Index: trunk/src/librnd/core/safe_fs.c =================================================================== --- trunk/src/librnd/core/safe_fs.c (revision 30939) +++ trunk/src/librnd/core/safe_fs.c (revision 30940) @@ -340,7 +340,7 @@ if (real_fn == NULL) return NULL; - if (pcb_is_path_abs(fn)) { + if (rnd_is_path_abs(fn)) { res = pcb_fopen(hidlib, real_fn, mode); if ((res != NULL) && (full_path != NULL)) *full_path = real_fn; Index: trunk/src/librnd/pcb_compat.h =================================================================== --- trunk/src/librnd/pcb_compat.h (revision 30939) +++ trunk/src/librnd/pcb_compat.h (revision 30940) @@ -193,3 +193,9 @@ #define PCB_BOOLEAN_EXPR RND_BOOLEAN_EXPR #define PCB_LIKELY RND_LIKELY #define PCB_UNLIKELY RND_UNLIKELY +#define pcb_get_wd rnd_get_wd +#define pcb_spawnvp rnd_spawnvp +#define pcb_file_readable rnd_file_readable +#define pcb_tempfile_name_new rnd_tempfile_name_new +#define pcb_tempfile_unlink rnd_tempfile_unlink +#define pcb_is_path_abs rnd_is_path_abs Index: trunk/src/plug_import.c =================================================================== --- trunk/src/plug_import.c (revision 30939) +++ trunk/src/plug_import.c (revision 30940) @@ -105,7 +105,7 @@ { pcb_plug_import_t *plug; - if (!pcb_file_readable(filename)) { + if (!rnd_file_readable(filename)) { rnd_message(PCB_MSG_ERROR, "Error: can't find a suitable netlist parser for %s - might be related: can't open %s for reading\n", filename, filename); return 1; } Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 30939) +++ trunk/src/plug_io.c (revision 30940) @@ -901,7 +901,7 @@ /* for askovr, do not make a backup copy - if the user explicitly says overwrite, just overwrite */ if (!askovr) - overwrite = pcb_file_readable(Filename); + overwrite = rnd_file_readable(Filename); if (overwrite) { int len = strlen(Filename); Index: trunk/src_plugins/dialogs/dlg_loadsave.c =================================================================== --- trunk/src_plugins/dialogs/dlg_loadsave.c (revision 30939) +++ trunk/src_plugins/dialogs/dlg_loadsave.c (revision 30940) @@ -48,7 +48,7 @@ static char *dup_cwd(void) { char tmp[PCB_PATH_MAX + 1]; - return pcb_strdup(pcb_get_wd(tmp)); + return pcb_strdup(rnd_get_wd(tmp)); } const char pcb_acts_Load[] = "Load()\n" "Load(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert)"; Index: trunk/src_plugins/export_oldconn/oldconn.c =================================================================== --- trunk/src_plugins/export_oldconn/oldconn.c (revision 30939) +++ trunk/src_plugins/export_oldconn/oldconn.c (revision 30940) @@ -242,7 +242,7 @@ char message[PCB_PATH_MAX + 80]; int response; - if (pcb_file_readable(Filename)) { + if (rnd_file_readable(Filename)) { sprintf(message, "File '%s' exists, use anyway?", Filename); response = pcb_hid_message_box(&PCB->hidlib, "warning", "Overwrite file", message, "cancel", 0, "ok", 1, NULL); if (response != 1) Index: trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c =================================================================== --- trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 30939) +++ trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 30940) @@ -243,7 +243,7 @@ return; /* pwd is lost during daemonisation */ - if (!pcb_is_path_abs(PCB->hidlib.filename)) + if (!rnd_is_path_abs(PCB->hidlib.filename)) fn = pcb_strdup_printf("%s%c%s", fuse_cwd, RND_DIR_SEPARATOR_C, PCB->hidlib.filename); if (pcb_save_pcb(fn, NULL) != 0) { @@ -259,7 +259,7 @@ { static struct fuse_operations oper; - pcb_get_wd(fuse_cwd); + rnd_get_wd(fuse_cwd); oper.readdir = pcb_fuse_readdir; oper.open = pcb_fuse_open; Index: trunk/src_plugins/extedit/extedit.c =================================================================== --- trunk/src_plugins/extedit/extedit.c (revision 30939) +++ trunk/src_plugins/extedit/extedit.c (revision 30940) @@ -249,8 +249,8 @@ } } - tmp_fn = pcb_tempfile_name_new("extedit"); - tmp_cfg_fn = pcb_tempfile_name_new("extedit_cfg"); + tmp_fn = rnd_tempfile_name_new("extedit"); + tmp_cfg_fn = rnd_tempfile_name_new("extedit_cfg"); if ((tmp_fn == NULL) || (tmp_cfg_fn == NULL)) { rnd_message(PCB_MSG_ERROR, "Failed to create temporary file\n"); ret = 1; @@ -327,9 +327,9 @@ quit1:; if (tmp_fn != NULL) - pcb_tempfile_unlink(tmp_fn); + rnd_tempfile_unlink(tmp_fn); if (tmp_cfg_fn != NULL) - pcb_tempfile_unlink(tmp_cfg_fn); + rnd_tempfile_unlink(tmp_cfg_fn); quit0:; pcb_buffer_set_number(obn); RND_ACT_IRES(ret); Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 30939) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 30940) @@ -126,7 +126,7 @@ /* Cache old dir, then cd into subdir because stat is given relative file names. */ memset(olddir, 0, sizeof olddir); - if (pcb_get_wd(olddir) == NULL) { + if (rnd_get_wd(olddir) == NULL) { rnd_message(PCB_MSG_ERROR, "fp_fs_list(): Could not determine initial working directory\n"); return 0; } @@ -142,7 +142,7 @@ /* Determine subdir's abs path */ - if (pcb_get_wd(new_subdir) == NULL) { + if (rnd_get_wd(new_subdir) == NULL) { rnd_message(PCB_MSG_ERROR, "fp_fs_list(): Could not determine new working directory\n"); if (chdir(olddir)) pcb_chdir_error_message(olddir); @@ -331,7 +331,7 @@ char path[PCB_PATH_MAX + 1]; fp_search_t ctx; - if (pcb_is_path_abs(basename)) + if (rnd_is_path_abs(basename)) return pcb_strdup(basename); ctx.target = basename; @@ -415,7 +415,7 @@ #endif /*fprintf(stderr, " cmd=%s\n", cmd);*/ /* Make a copy of the output of the parametric so rewind() can be called on it */ - fctx->field[F_TMPNAME].p = pcb_tempfile_name_new("pcb-rnd-pfp"); + fctx->field[F_TMPNAME].p = rnd_tempfile_name_new("pcb-rnd-pfp"); f = pcb_fopen(&PCB->hidlib, (char *)fctx->field[F_TMPNAME].p, "wb+"); if (f != NULL) { char buff[4096]; @@ -445,7 +445,7 @@ { fclose(f); if (fctx->field[F_TMPNAME].p != NULL) - pcb_tempfile_unlink((char *)fctx->field[F_TMPNAME].p); + rnd_tempfile_unlink((char *)fctx->field[F_TMPNAME].p); } Index: trunk/src_plugins/import_gnetlist/import_gnetlist.c =================================================================== --- trunk/src_plugins/import_gnetlist/import_gnetlist.c (revision 30939) +++ trunk/src_plugins/import_gnetlist/import_gnetlist.c (revision 30940) @@ -88,7 +88,7 @@ char **cmd; int n, res, verbose; fgw_arg_t rs; - char *tmpfn = pcb_tempfile_name_new("gnetlist_output"); + char *tmpfn = rnd_tempfile_name_new("gnetlist_output"); PCB_IMPORT_SCH_VERBOSE(verbose); @@ -118,7 +118,7 @@ rnd_message(PCB_MSG_DEBUG, "\n"); } - res = pcb_spawnvp((const char **)cmd); + res = rnd_spawnvp((const char **)cmd); if (res == 0) { if (verbose) rnd_message(PCB_MSG_DEBUG, "pcb_gnetlist: about to run pcb_act_ExecuteFile, file = %s\n", tmpfn); Index: trunk/src_plugins/import_ltspice/ltspice.c =================================================================== --- trunk/src_plugins/import_ltspice/ltspice.c (revision 30939) +++ trunk/src_plugins/import_ltspice/ltspice.c (revision 30940) @@ -330,7 +330,7 @@ return 0; /* only pure netlist import is supported */ gen_filenames(args[0], &fname_net, &fname_asc); - if (!pcb_file_readable(fname_net)) + if (!rnd_file_readable(fname_net)) goto quit; f = pcb_fopen(&PCB->hidlib, fname_asc, "r"); Index: trunk/src_plugins/import_net_cmd/import_net_cmd.c =================================================================== --- trunk/src_plugins/import_net_cmd/import_net_cmd.c (revision 30939) +++ trunk/src_plugins/import_net_cmd/import_net_cmd.c (revision 30940) @@ -67,7 +67,7 @@ return -1; } if ((outfn[0] == '-') && (outfn[1] == '\0')) { - tmpfn = pcb_tempfile_name_new("net_cmd_output"); + tmpfn = rnd_tempfile_name_new("net_cmd_output"); outfn = tmpfn; } @@ -83,7 +83,7 @@ pcb_import_netlist(&PCB->hidlib, outfn); } if (tmpfn != NULL) - pcb_tempfile_unlink(tmpfn); + rnd_tempfile_unlink(tmpfn); return res; } Index: trunk/src_plugins/import_sch2/import_sch_dlg.c =================================================================== --- trunk/src_plugins/import_sch2/import_sch_dlg.c (revision 30939) +++ trunk/src_plugins/import_sch2/import_sch_dlg.c (revision 30940) @@ -204,7 +204,7 @@ return; if (*cwd == '\0') - pcb_get_wd(cwd); + rnd_get_wd(cwd); name = pcb_gui->fileselect(pcb_gui, "Import schematics", "Import netlist and footprints from schematics", cwd, NULL, NULL, "schematics", PCB_HID_FSD_MAY_NOT_EXIST, NULL); if (name == NULL) Index: trunk/src_plugins/lib_gtk_common/glue_common.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_common.c (revision 30939) +++ trunk/src_plugins/lib_gtk_common/glue_common.c (revision 30940) @@ -59,7 +59,7 @@ for(s = cache; *s != '\0'; s++) if (*s == '\\') *s = '/'; - if (!pcb_file_readable(cache)) { + if (!rnd_file_readable(cache)) { cmd = pcb_concat(pcb_w32_bindir, "\\gdk-pixbuf-query-loaders --update-cache", NULL); fprintf(stderr, "pcb-rnd: updating gdk loader cache: '%s'...\n", cache); system(cmd); Index: trunk/src_plugins/order_pcbway/pcbway.c =================================================================== --- trunk/src_plugins/order_pcbway/pcbway.c (revision 30939) +++ trunk/src_plugins/order_pcbway/pcbway.c (revision 30940) @@ -458,7 +458,7 @@ pcbway_dlg2fields(octx, form); - tmpfn = pcb_tempfile_name_new("pcbway_quote.xml"); + tmpfn = rnd_tempfile_name_new("pcbway_quote.xml"); if (tmpfn == NULL) { rnd_message(PCB_MSG_ERROR, "order_pcbway: can't get temp file name\n"); return; @@ -466,7 +466,7 @@ fx = pcb_fopen(&PCB->hidlib, tmpfn, "w"); if (fx == NULL) { - pcb_tempfile_unlink(tmpfn); + rnd_tempfile_unlink(tmpfn); rnd_message(PCB_MSG_ERROR, "order_pcbway: can't open temp file\n"); return; } @@ -522,7 +522,7 @@ pcbway_present_quote(octx, respfn); err:; - pcb_tempfile_unlink(tmpfn); + rnd_tempfile_unlink(tmpfn); } Index: trunk/src_plugins/script/live_script.c =================================================================== --- trunk/src_plugins/script/live_script.c (revision 30939) +++ trunk/src_plugins/script/live_script.c (revision 30940) @@ -287,10 +287,10 @@ int res = 0; long numu; - fn = pcb_tempfile_name_new("live_script"); + fn = rnd_tempfile_name_new("live_script"); f = pcb_fopen(hl, fn, "w"); if (f == NULL) { - pcb_tempfile_unlink(fn); + rnd_tempfile_unlink(fn); rnd_message(PCB_MSG_ERROR, "live_script: can't open temp file for write\n"); return -1; } @@ -324,7 +324,7 @@ pcb_gui->invalidate_all(pcb_gui); /* if the script drew anything, get it displayed */ - pcb_tempfile_unlink(fn); + rnd_tempfile_unlink(fn); return res; } Index: trunk/src_plugins/script/perma.c =================================================================== --- trunk/src_plugins/script/perma.c (revision 30939) +++ trunk/src_plugins/script/perma.c (revision 30940) @@ -40,7 +40,7 @@ char spath[PCB_PATH_MAX]; const char *path; - if (!pcb_is_path_abs(path_in)) { + if (!rnd_is_path_abs(path_in)) { path = spath; pcb_snprintf(spath, sizeof(spath), "%s%c%s", dir, RND_DIR_SEPARATOR_C, path_in); } Index: trunk/src_plugins/script/script.c =================================================================== --- trunk/src_plugins/script/script.c (revision 30939) +++ trunk/src_plugins/script/script.c (revision 30940) @@ -392,10 +392,10 @@ char *fn; int res = 0; - fn = pcb_tempfile_name_new("oneliner"); + fn = rnd_tempfile_name_new("oneliner"); f = pcb_fopen(NULL, fn, "w"); if (f == NULL) { - pcb_tempfile_unlink(fn); + rnd_tempfile_unlink(fn); rnd_message(PCB_MSG_ERROR, "script oneliner: can't open temp file for write\n"); return -1; } @@ -411,7 +411,7 @@ } pcb_script_unload("__oneliner", NULL); - pcb_tempfile_unlink(fn); + rnd_tempfile_unlink(fn); return res; } Index: trunk/util/gsch2pcb-rnd/gsch2pcb.c =================================================================== --- trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 30939) +++ trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 30940) @@ -374,7 +374,7 @@ void require_gnetlist_backend(const char *dir, const char *backend) { char *path = pcb_strdup_printf("%s/gnet-%s.scm", dir, backend); - if (!pcb_file_readable(path)) + if (!rnd_file_readable(path)) rnd_message(PCB_MSG_WARNING, "WARNING: %s is not found, gnetlist will probably fail; please check your pcb-rnd installation!\n", path); free(path); } @@ -420,7 +420,7 @@ pcb_conf_update(NULL, -1); /* because of CLI changes */ if (!have_cli_project_file && !have_cli_schematics) { - if (!pcb_file_readable(LOCAL_PROJECT_FILE)) { + if (!rnd_file_readable(LOCAL_PROJECT_FILE)) { rnd_message(PCB_MSG_ERROR, "Don't know what to do: no project or schematics given, no local project file %s found. Try %s --help\n", LOCAL_PROJECT_FILE, argv[0]); exit(1); } Index: trunk/util/gsch2pcb-rnd/method_import.c =================================================================== --- trunk/util/gsch2pcb-rnd/method_import.c (revision 30939) +++ trunk/util/gsch2pcb-rnd/method_import.c (revision 30940) @@ -105,11 +105,11 @@ char *name; name = pcb_concat(conf_g2pr.utils.gsch2pcb_rnd.sch_basename, ".lht", NULL); - res = pcb_file_readable(name); + res = rnd_file_readable(name); free(name); if (!res) { name = pcb_concat(conf_g2pr.utils.gsch2pcb_rnd.sch_basename, ".pcb.lht", NULL); - res = pcb_file_readable(name); + res = rnd_file_readable(name); free(name); } return res;