aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-12-03 14:25:50 +0000
committerKaroly Lorentey2005-12-03 14:25:50 +0000
commit9ef706664e98e37e9633712126bae99869904677 (patch)
tree193bce7424700e4c7d70f54b04f7f81d64525554 /src/mac.c
parent950bed4bb96d2a580818bdaab64a164c7c9a1c1e (diff)
parent9f6efa0c78099f2f028c4db1db5a58567a1cfb4e (diff)
downloademacs-9ef706664e98e37e9633712126bae99869904677.tar.gz
emacs-9ef706664e98e37e9633712126bae99869904677.zip
Merged from miles@gnu.org--gnu-2005 (patch 659-663)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-659 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-660 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-661 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-662 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-663 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-445
Diffstat (limited to 'src/mac.c')
-rw-r--r--src/mac.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mac.c b/src/mac.c
index 2493945727d..76ba3d41798 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -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
266static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; 266static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
267static Lisp_Object Qarray, Qdictionary; 267static Lisp_Object Qarray, Qdictionary;
268#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)
269 268
270struct cfdict_context 269struct 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
343Lisp_Object 341Lisp_Object
344cfstring_to_lisp (string) 342cfstring_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
371Lisp_Object
372cfstring_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 {