Mercurial > emacs
diff mac/src/mac.c @ 38893:bd309345e7ea
2001-08-21 Andrew Choi <akochoi@cse.cuhk.edu.hk>
* src/macterm.c (local_to_global_coord): Comment out.
* src/mac.c (mac-filename-to-unix): Change to
mac-file-name-to-posix.
(unix-filename-to-mac): Change to posix-file-name-to-mac.
(mac_to_unix_pathname): Change to mac_to_posix_pathname.
(unix_to_mac_pathname): Change to posix_to_mac_pathname.
* src/macterm.c (do_ae_open_documents): Change call to
mac_to_unix_pathname to mac_to_posix_pathname.
author | Andrew Choi <akochoi@shaw.ca> |
---|---|
date | Tue, 21 Aug 2001 16:00:33 +0000 |
parents | c04e66e2c50c |
children | 9647ef27680a |
line wrap: on
line diff
--- a/mac/src/mac.c Tue Aug 21 15:59:29 2001 +0000 +++ b/mac/src/mac.c Tue Aug 21 16:00:33 2001 +0000 @@ -91,7 +91,7 @@ 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; @@ -150,7 +150,7 @@ 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]; @@ -280,7 +280,7 @@ 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); @@ -420,7 +420,7 @@ 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); @@ -440,7 +440,7 @@ 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); @@ -480,7 +480,7 @@ 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); @@ -542,7 +542,7 @@ 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); @@ -600,7 +600,7 @@ 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 { @@ -624,7 +624,7 @@ 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 { @@ -656,7 +656,7 @@ 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); @@ -717,12 +717,12 @@ 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 @@ -752,7 +752,7 @@ 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 { @@ -1381,7 +1381,7 @@ 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); @@ -1406,7 +1406,7 @@ 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; @@ -1631,7 +1631,7 @@ 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 */ @@ -1714,7 +1714,7 @@ 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; @@ -1929,13 +1929,13 @@ 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) @@ -1987,7 +1987,7 @@ 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; } @@ -2004,7 +2004,7 @@ 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; } @@ -2012,7 +2012,7 @@ } 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); @@ -2027,7 +2027,7 @@ 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) @@ -2038,7 +2038,7 @@ 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); @@ -2183,7 +2183,7 @@ } /* 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 ':' */ @@ -2343,7 +2343,7 @@ 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; @@ -2486,35 +2486,35 @@ } -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 @@ -2633,6 +2633,6 @@ 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); }