Returns 1 if successful; 0 if fails. */
int
-mac_to_unix_pathname (const char *mfn, char *ufn, int ufnbuflen)
+mac_to_posix_pathname (const char *mfn, char *ufn, int ufnbuflen)
{
const char *p, *q, *pe;
above in algorithm. */
int
-unix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
+posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
{
const char *p, *q, *pe;
char expanded_pathname[MAXPATHLEN+1];
char mac_pathname[MAXPATHLEN+1];
CInfoPBRec cipb;
- if (unix_to_mac_pathname (path, mac_pathname, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (path, mac_pathname, MAXPATHLEN+1) == 0)
return -1;
c2pstr (mac_pathname);
if (find_true_pathname (dirname, true_pathname, MAXPATHLEN+1) == -1)
return -1;
- if (unix_to_mac_pathname (true_pathname, mac_pathname, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (true_pathname, mac_pathname, MAXPATHLEN+1) == 0)
return -1;
c2pstr (mac_pathname);
HFileParam hfpb;
char mac_pathname[MAXPATHLEN+1];
- if (unix_to_mac_pathname (dirname, mac_pathname, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (dirname, mac_pathname, MAXPATHLEN+1) == 0)
return -1;
c2pstr (mac_pathname);
else
strcpy (fully_resolved_name, true_pathname);
- if (!unix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
return -1;
c2pstr (mac_pathname);
else
strcpy (fully_resolved_name, true_pathname);
- if (!unix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
return -1;
c2pstr (mac_pathname);
else
strcpy (fully_resolved_name, true_pathname);
- if (!unix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
return -1;
else
{
if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1)
return -1;
- if (!unix_to_mac_pathname (true_pathname, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (true_pathname, mac_pathname, MAXPATHLEN+1))
return -1;
else
{
else
strcpy (fully_resolved_name, true_pathname);
- if (!unix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
return -1;
else
return unlink (mac_pathname);
if (strcmp (fully_resolved_old_name, true_new_pathname) == 0)
return 0;
- if (!unix_to_mac_pathname (fully_resolved_old_name,
+ if (!posix_to_mac_pathname (fully_resolved_old_name,
mac_old_name,
MAXPATHLEN+1))
return -1;
- if (!unix_to_mac_pathname(true_new_pathname, mac_new_name, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname(true_new_pathname, mac_new_name, MAXPATHLEN+1))
return -1;
/* If a file with new_name already exists, rename deletes the old
else
strcpy (fully_resolved_name, true_pathname);
- if (!unix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
return 0;
else
{
Str255 directory_name, mac_pathname;
CInfoPBRec cipb;
- if (unix_to_mac_pathname (path, mac_sym_link_name, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (path, mac_sym_link_name, MAXPATHLEN+1) == 0)
return -1;
c2pstr (mac_sym_link_name);
return -1;
}
- if (mac_to_unix_pathname (mac_pathname, buf, bufsiz) == 0)
+ if (mac_to_posix_pathname (mac_pathname, buf, bufsiz) == 0)
{
errno = ENOENT;
return -1;
else
return NULL;
- if (!mac_to_unix_pathname (full_path, unix_dir_name, MAXPATHLEN+1))
+ if (!mac_to_posix_pathname (full_path, unix_dir_name, MAXPATHLEN+1))
return NULL;
dir = opendir (unix_dir_name); /* check whether temp directory exists */
if (!path_from_vol_dir_name (full_path, 255, vol_ref_num, dir_id, "\p"))
return NULL;
- if (!mac_to_unix_pathname (full_path, system_folder_unix_name, MAXPATHLEN+1))
+ if (!mac_to_posix_pathname (full_path, system_folder_unix_name, MAXPATHLEN+1))
return NULL;
return system_folder_unix_name;
TargetID targ;
unsigned long ref_con, len;
- if (unix_to_mac_pathname (workdir, macworkdir, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (workdir, macworkdir, MAXPATHLEN+1) == 0)
return -1;
- if (unix_to_mac_pathname (infn, macinfn, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (infn, macinfn, MAXPATHLEN+1) == 0)
return -1;
- if (unix_to_mac_pathname (outfn, macoutfn, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (outfn, macoutfn, MAXPATHLEN+1) == 0)
return -1;
- if (unix_to_mac_pathname (errfn, macerrfn, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (errfn, macerrfn, MAXPATHLEN+1) == 0)
return -1;
paramlen = strlen (macworkdir) + strlen (macinfn) + strlen (macoutfn)
if (strncmp (newargv[0], "~emacs/", 7) == 0)
{
- if (unix_to_mac_pathname (newargv[0], tempmacpathname, MAXPATHLEN+1)
+ if (posix_to_mac_pathname (newargv[0], tempmacpathname, MAXPATHLEN+1)
== 0)
return -1;
}
if (NILP (path))
return -1;
- if (unix_to_mac_pathname (XSTRING (path)->data, tempmacpathname,
+ if (posix_to_mac_pathname (XSTRING (path)->data, tempmacpathname,
MAXPATHLEN+1) == 0)
return -1;
}
}
else
{
- if (unix_to_mac_pathname (argv[0], macappname, MAXPATHLEN+1) == 0)
+ if (posix_to_mac_pathname (argv[0], macappname, MAXPATHLEN+1) == 0)
return -1;
newargv = (char **) alloca (sizeof (char *) * argc);
char tempcmdname[MAXPATHLEN+1], tempmaccmdname[MAXPATHLEN+1];
strncpy (tempcmdname, argv[j], t-argv[j]);
tempcmdname[t-argv[j]] = '\0';
- if (unix_to_mac_pathname (tempcmdname, tempmaccmdname,
+ if (posix_to_mac_pathname (tempcmdname, tempmaccmdname,
MAXPATHLEN+1) == 0)
return -1;
newargv[j] = (char *) alloca (strlen (tempmaccmdname)
else
{
char tempmaccmdname[MAXPATHLEN+1];
- if (unix_to_mac_pathname (argv[j], tempmaccmdname,
+ if (posix_to_mac_pathname (argv[j], tempmaccmdname,
MAXPATHLEN+1) == 0)
return -1;
newargv[j] = (char *) alloca (strlen (tempmaccmdname)+1);
}
/* Handle typical cases: not accessing all mounted volumes. */
- if (!unix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
+ if (!posix_to_mac_pathname (fully_resolved_name, mac_pathname, MAXPATHLEN+1))
return 0;
/* Emacs calls opendir without the trailing '/', Mac needs trailing ':' */
if (path_from_vol_dir_name (mac_pathname, 255, 0, 0, "\p") == 0)
return NULL;
- if (mac_to_unix_pathname (mac_pathname, path, MAXPATHLEN+1) == 0)
+ if (mac_to_posix_pathname (mac_pathname, path, MAXPATHLEN+1) == 0)
return 0;
else
return path;
}
-DEFUN ("mac-filename-to-unix", Fmac_filename_to_unix, Smac_filename_to_unix, 1,
+DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, Smac_file_name_to_posix, 1,
1, 0,
- "Convert Macintosh filename to Unix form.")
+ "Convert Macintosh filename to Posix form.")
(mac_filename)
Lisp_Object mac_filename;
{
- char unix_filename[MAXPATHLEN+1];
+ char posix_filename[MAXPATHLEN+1];
CHECK_STRING (mac_filename, 0);
- if (mac_to_unix_pathname(XSTRING (mac_filename)->data, unix_filename,
+ if (mac_to_posix_pathname (XSTRING (mac_filename)->data, posix_filename,
MAXPATHLEN))
- return build_string (unix_filename);
+ return build_string (posix_filename);
else
return Qnil;
}
-DEFUN ("unix-filename-to-mac", Funix_filename_to_mac, Sunix_filename_to_mac, 1,
+DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, Sposix_file_name_to_mac, 1,
1, 0,
"Convert Unix filename to Mac form.")
- (unix_filename)
- Lisp_Object unix_filename;
+ (posix_filename)
+ Lisp_Object posix_filename;
{
char mac_filename[MAXPATHLEN+1];
- CHECK_STRING (unix_filename, 0);
+ CHECK_STRING (posix_filename, 0);
- if (unix_to_mac_pathname(XSTRING (unix_filename)->data, mac_filename,
+ if (posix_to_mac_pathname (XSTRING (posix_filename)->data, mac_filename,
MAXPATHLEN))
return build_string (mac_filename);
else
defsubr (&Sx_selection_exists_p);
defsubr (&Sdo_applescript);
- defsubr (&Smac_filename_to_unix);
- defsubr (&Sunix_filename_to_mac);
+ defsubr (&Smac_file_name_to_posix);
+ defsubr (&Sposix_file_name_to_mac);
}