diff options
| author | YAMAMOTO Mitsuharu | 2005-11-23 07:19:16 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2005-11-23 07:19:16 +0000 |
| commit | f997a5589064a54bd4c4af58c57370dd374beda6 (patch) | |
| tree | fe09d9da00e1567b1f6a8f1b50dda5d49111fd61 /src | |
| parent | a4f8f6cf42c80118b16abbe4008ccc80167437eb (diff) | |
| download | emacs-f997a5589064a54bd4c4af58c57370dd374beda6.tar.gz emacs-f997a5589064a54bd4c4af58c57370dd374beda6.zip | |
(DECODE_UTF_8): Remove macro.
[TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function
created from cfstring_to_lisp.
[TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it.
(xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mac.c | 26 |
1 files changed, 19 insertions, 7 deletions
| @@ -265,7 +265,6 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen) | |||
| 265 | #if TARGET_API_MAC_CARBON | 265 | #if TARGET_API_MAC_CARBON |
| 266 | static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; | 266 | static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; |
| 267 | static Lisp_Object Qarray, Qdictionary; | 267 | static Lisp_Object Qarray, Qdictionary; |
| 268 | #define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0) | ||
| 269 | 268 | ||
| 270 | struct cfdict_context | 269 | struct cfdict_context |
| 271 | { | 270 | { |
| @@ -336,12 +335,11 @@ cfdata_to_lisp (data) | |||
| 336 | } | 335 | } |
| 337 | 336 | ||
| 338 | 337 | ||
| 339 | /* From CFString to a lisp string. Never returns a unibyte string | 338 | /* From CFString to a lisp string. Returns a unibyte string |
| 340 | (even if it only contains ASCII characters). | 339 | containing a UTF-8 byte sequence. */ |
| 341 | This may cause GC during code conversion. */ | ||
| 342 | 340 | ||
| 343 | Lisp_Object | 341 | Lisp_Object |
| 344 | cfstring_to_lisp (string) | 342 | cfstring_to_lisp_nodecode (string) |
| 345 | CFStringRef string; | 343 | CFStringRef string; |
| 346 | { | 344 | { |
| 347 | Lisp_Object result = Qnil; | 345 | Lisp_Object result = Qnil; |
| @@ -362,9 +360,23 @@ cfstring_to_lisp (string) | |||
| 362 | } | 360 | } |
| 363 | } | 361 | } |
| 364 | 362 | ||
| 363 | return result; | ||
| 364 | } | ||
| 365 | |||
| 366 | |||
| 367 | /* From CFString to a lisp string. Never returns a unibyte string | ||
| 368 | (even if it only contains ASCII characters). | ||
| 369 | This may cause GC during code conversion. */ | ||
| 370 | |||
| 371 | Lisp_Object | ||
| 372 | cfstring_to_lisp (string) | ||
| 373 | CFStringRef string; | ||
| 374 | { | ||
| 375 | Lisp_Object result = cfstring_to_lisp_nodecode (string); | ||
| 376 | |||
| 365 | if (!NILP (result)) | 377 | if (!NILP (result)) |
| 366 | { | 378 | { |
| 367 | result = DECODE_UTF_8 (result); | 379 | result = code_convert_string_norecord (result, Qutf_8, 0); |
| 368 | /* This may be superfluous. Just to make sure that the result | 380 | /* This may be superfluous. Just to make sure that the result |
| 369 | is a multibyte string. */ | 381 | is a multibyte string. */ |
| 370 | result = string_to_multibyte (result); | 382 | result = string_to_multibyte (result); |
| @@ -1141,7 +1153,7 @@ xrm_get_preference_database (application) | |||
| 1141 | CFSetGetValues (key_set, (const void **)keys); | 1153 | CFSetGetValues (key_set, (const void **)keys); |
| 1142 | for (index = 0; index < count; index++) | 1154 | for (index = 0; index < count; index++) |
| 1143 | { | 1155 | { |
| 1144 | res_name = SDATA (cfstring_to_lisp (keys[index])); | 1156 | res_name = SDATA (cfstring_to_lisp_nodecode (keys[index])); |
| 1145 | quarks = parse_resource_name (&res_name); | 1157 | quarks = parse_resource_name (&res_name); |
| 1146 | if (!(NILP (quarks) || *res_name)) | 1158 | if (!(NILP (quarks) || *res_name)) |
| 1147 | { | 1159 | { |