diff options
| author | YAMAMOTO Mitsuharu | 2006-04-12 08:06:59 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-04-12 08:06:59 +0000 |
| commit | 1fcd1370e2c893b3cf233cea502d285a04cf48ee (patch) | |
| tree | c5f30e3c9c0cd39ab4295762f4bc0e5968aa2b01 /src/mac.c | |
| parent | 4f48f1abea6fe1dddfb95e33fe181233571986b5 (diff) | |
| download | emacs-1fcd1370e2c893b3cf233cea502d285a04cf48ee.tar.gz emacs-1fcd1370e2c893b3cf233cea502d285a04cf48ee.zip | |
(init_process): Remove undef.
(select) [MAC_OSX]: Undefine before including sysselect.h.
(posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]:
Remove functions and prototypes.
(parse_value): Add parentheses around + inside shift.
(path_from_vol_dir_name): Make static.
(get_temp_dir_name): Remove unused variables `cpb' and `dir_name'.
[!MAC_OSX] (get_path_to_system_folder): Likewise.
(Fmac_get_file_creator, Fmac_get_file_type): Remove unused
variable `cCode'.
(Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'.
(Fmac_get_preference): Add explicit braces to avoid ambiguous `else'.
Diffstat (limited to 'src/mac.c')
| -rw-r--r-- | src/mac.c | 54 |
1 files changed, 25 insertions, 29 deletions
| @@ -28,7 +28,9 @@ Boston, MA 02110-1301, USA. */ | |||
| 28 | 28 | ||
| 29 | #include "lisp.h" | 29 | #include "lisp.h" |
| 30 | #include "process.h" | 30 | #include "process.h" |
| 31 | #undef init_process | 31 | #ifdef MAC_OSX |
| 32 | #undef select | ||
| 33 | #endif | ||
| 32 | #include "systime.h" | 34 | #include "systime.h" |
| 33 | #include "sysselect.h" | 35 | #include "sysselect.h" |
| 34 | #include "blockinput.h" | 36 | #include "blockinput.h" |
| @@ -79,8 +81,10 @@ static ComponentInstance as_scripting_component; | |||
| 79 | /* The single script context used for all script executions. */ | 81 | /* The single script context used for all script executions. */ |
| 80 | static OSAID as_script_context; | 82 | static OSAID as_script_context; |
| 81 | 83 | ||
| 84 | #ifndef MAC_OSX | ||
| 82 | static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *)); | 85 | static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *)); |
| 83 | static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int)); | 86 | static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int)); |
| 87 | #endif | ||
| 84 | 88 | ||
| 85 | /* When converting from Mac to Unix pathnames, /'s in folder names are | 89 | /* When converting from Mac to Unix pathnames, /'s in folder names are |
| 86 | converted to :'s. This function, used in copying folder names, | 90 | converted to :'s. This function, used in copying folder names, |
| @@ -1222,7 +1226,7 @@ parse_value (p) | |||
| 1222 | && '0' <= P[1] && P[1] <= '7' | 1226 | && '0' <= P[1] && P[1] <= '7' |
| 1223 | && '0' <= P[2] && P[2] <= '7') | 1227 | && '0' <= P[2] && P[2] <= '7') |
| 1224 | { | 1228 | { |
| 1225 | *q++ = (P[0] - '0' << 6) + (P[1] - '0' << 3) + (P[2] - '0'); | 1229 | *q++ = ((P[0] - '0') << 6) + ((P[1] - '0') << 3) + (P[2] - '0'); |
| 1226 | P += 3; | 1230 | P += 3; |
| 1227 | } | 1231 | } |
| 1228 | else | 1232 | else |
| @@ -2789,7 +2793,7 @@ link (const char *name1, const char *name2) | |||
| 2789 | /* Determine the path name of the file specified by VREFNUM, DIRID, | 2793 | /* Determine the path name of the file specified by VREFNUM, DIRID, |
| 2790 | and NAME and place that in the buffer PATH of length | 2794 | and NAME and place that in the buffer PATH of length |
| 2791 | MAXPATHLEN. */ | 2795 | MAXPATHLEN. */ |
| 2792 | int | 2796 | static int |
| 2793 | path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num, | 2797 | path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num, |
| 2794 | long dir_id, ConstStr255Param name) | 2798 | long dir_id, ConstStr255Param name) |
| 2795 | { | 2799 | { |
| @@ -2834,6 +2838,8 @@ path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num, | |||
| 2834 | } | 2838 | } |
| 2835 | 2839 | ||
| 2836 | 2840 | ||
| 2841 | #ifndef MAC_OSX | ||
| 2842 | |||
| 2837 | static OSErr | 2843 | static OSErr |
| 2838 | posix_pathname_to_fsspec (ufn, fs) | 2844 | posix_pathname_to_fsspec (ufn, fs) |
| 2839 | const char *ufn; | 2845 | const char *ufn; |
| @@ -2866,8 +2872,6 @@ fsspec_to_posix_pathname (fs, ufn, ufnbuflen) | |||
| 2866 | return fnfErr; | 2872 | return fnfErr; |
| 2867 | } | 2873 | } |
| 2868 | 2874 | ||
| 2869 | #ifndef MAC_OSX | ||
| 2870 | |||
| 2871 | int | 2875 | int |
| 2872 | readlink (const char *path, char *buf, int bufsiz) | 2876 | readlink (const char *path, char *buf, int bufsiz) |
| 2873 | { | 2877 | { |
| @@ -3124,8 +3128,7 @@ get_temp_dir_name () | |||
| 3124 | short vol_ref_num; | 3128 | short vol_ref_num; |
| 3125 | long dir_id; | 3129 | long dir_id; |
| 3126 | OSErr err; | 3130 | OSErr err; |
| 3127 | Str255 dir_name, full_path; | 3131 | Str255 full_path; |
| 3128 | CInfoPBRec cpb; | ||
| 3129 | char unix_dir_name[MAXPATHLEN+1]; | 3132 | char unix_dir_name[MAXPATHLEN+1]; |
| 3130 | DIR *dir; | 3133 | DIR *dir; |
| 3131 | 3134 | ||
| @@ -3217,8 +3220,7 @@ get_path_to_system_folder () | |||
| 3217 | short vol_ref_num; | 3220 | short vol_ref_num; |
| 3218 | long dir_id; | 3221 | long dir_id; |
| 3219 | OSErr err; | 3222 | OSErr err; |
| 3220 | Str255 dir_name, full_path; | 3223 | Str255 full_path; |
| 3221 | CInfoPBRec cpb; | ||
| 3222 | static char system_folder_unix_name[MAXPATHLEN+1]; | 3224 | static char system_folder_unix_name[MAXPATHLEN+1]; |
| 3223 | DIR *dir; | 3225 | DIR *dir; |
| 3224 | 3226 | ||
| @@ -3947,7 +3949,6 @@ DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, | |||
| 3947 | #else | 3949 | #else |
| 3948 | FSSpec fss; | 3950 | FSSpec fss; |
| 3949 | #endif | 3951 | #endif |
| 3950 | OSType cCode; | ||
| 3951 | Lisp_Object result = Qnil; | 3952 | Lisp_Object result = Qnil; |
| 3952 | CHECK_STRING (filename); | 3953 | CHECK_STRING (filename); |
| 3953 | 3954 | ||
| @@ -4002,7 +4003,6 @@ DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0, | |||
| 4002 | #else | 4003 | #else |
| 4003 | FSSpec fss; | 4004 | FSSpec fss; |
| 4004 | #endif | 4005 | #endif |
| 4005 | OSType cCode; | ||
| 4006 | Lisp_Object result = Qnil; | 4006 | Lisp_Object result = Qnil; |
| 4007 | CHECK_STRING (filename); | 4007 | CHECK_STRING (filename); |
| 4008 | 4008 | ||
| @@ -4296,11 +4296,6 @@ Each type should be a string of length 4 or the symbol | |||
| 4296 | Lisp_Object result = Qnil; | 4296 | Lisp_Object result = Qnil; |
| 4297 | DescType src_desc_type, dst_desc_type; | 4297 | DescType src_desc_type, dst_desc_type; |
| 4298 | AEDesc dst_desc; | 4298 | AEDesc dst_desc; |
| 4299 | #ifdef MAC_OSX | ||
| 4300 | FSRef fref; | ||
| 4301 | #else | ||
| 4302 | FSSpec fs; | ||
| 4303 | #endif | ||
| 4304 | 4299 | ||
| 4305 | CHECK_STRING (src_data); | 4300 | CHECK_STRING (src_data); |
| 4306 | if (EQ (src_type, Qundecoded_file_name)) | 4301 | if (EQ (src_type, Qundecoded_file_name)) |
| @@ -4422,18 +4417,20 @@ otherwise. */) | |||
| 4422 | } | 4417 | } |
| 4423 | 4418 | ||
| 4424 | if (NILP (key)) | 4419 | if (NILP (key)) |
| 4425 | if (EQ (format, Qxml)) | 4420 | { |
| 4426 | { | 4421 | if (EQ (format, Qxml)) |
| 4427 | CFDataRef data = CFPropertyListCreateXMLData (NULL, plist); | 4422 | { |
| 4428 | if (data == NULL) | 4423 | CFDataRef data = CFPropertyListCreateXMLData (NULL, plist); |
| 4429 | goto out; | 4424 | if (data == NULL) |
| 4430 | result = cfdata_to_lisp (data); | 4425 | goto out; |
| 4431 | CFRelease (data); | 4426 | result = cfdata_to_lisp (data); |
| 4432 | } | 4427 | CFRelease (data); |
| 4433 | else | 4428 | } |
| 4434 | result = | 4429 | else |
| 4435 | cfproperty_list_to_lisp (plist, EQ (format, Qt), | 4430 | result = |
| 4436 | NILP (hash_bound) ? -1 : XINT (hash_bound)); | 4431 | cfproperty_list_to_lisp (plist, EQ (format, Qt), |
| 4432 | NILP (hash_bound) ? -1 : XINT (hash_bound)); | ||
| 4433 | } | ||
| 4437 | 4434 | ||
| 4438 | out: | 4435 | out: |
| 4439 | if (app_plist) | 4436 | if (app_plist) |
| @@ -4701,7 +4698,6 @@ mac_get_system_locale () | |||
| 4701 | 4698 | ||
| 4702 | 4699 | ||
| 4703 | #ifdef MAC_OSX | 4700 | #ifdef MAC_OSX |
| 4704 | #undef select | ||
| 4705 | 4701 | ||
| 4706 | extern int inhibit_window_system; | 4702 | extern int inhibit_window_system; |
| 4707 | extern int noninteractive; | 4703 | extern int noninteractive; |