aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <[email protected]>2005-11-23 07:19:16 +0000
committerYAMAMOTO Mitsuharu <[email protected]>2005-11-23 07:19:16 +0000
commitf997a5589064a54bd4c4af58c57370dd374beda6 (patch)
treefe09d9da00e1567b1f6a8f1b50dda5d49111fd61 /src/mac.c
parenta4f8f6cf42c80118b16abbe4008ccc80167437eb (diff)
(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/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 2493945727..76ba3d4179 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -265,7 +265,6 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
#if TARGET_API_MAC_CARBON
static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
static Lisp_Object Qarray, Qdictionary;
-#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)
struct cfdict_context
{
@@ -336,12 +335,11 @@ cfdata_to_lisp (data)
}
-/* From CFString to a lisp string. Never returns a unibyte string
- (even if it only contains ASCII characters).
- This may cause GC during code conversion. */
+/* From CFString to a lisp string. Returns a unibyte string
+ containing a UTF-8 byte sequence. */
Lisp_Object
-cfstring_to_lisp (string)
+cfstring_to_lisp_nodecode (string)
CFStringRef string;
{
Lisp_Object result = Qnil;
@@ -362,9 +360,23 @@ cfstring_to_lisp (string)
}
}
+ return result;
+}
+
+
+/* From CFString to a lisp string. Never returns a unibyte string
+ (even if it only contains ASCII characters).
+ This may cause GC during code conversion. */
+
+Lisp_Object
+cfstring_to_lisp (string)
+ CFStringRef string;
+{
+ Lisp_Object result = cfstring_to_lisp_nodecode (string);
+
if (!NILP (result))
{
- result = DECODE_UTF_8 (result);
+ result = code_convert_string_norecord (result, Qutf_8, 0);
/* This may be superfluous. Just to make sure that the result
is a multibyte string. */
result = string_to_multibyte (result);
@@ -1141,7 +1153,7 @@ xrm_get_preference_database (application)
CFSetGetValues (key_set, (const void **)keys);
for (index = 0; index < count; index++)
{
- res_name = SDATA (cfstring_to_lisp (keys[index]));
+ res_name = SDATA (cfstring_to_lisp_nodecode (keys[index]));
quarks = parse_resource_name (&res_name);
if (!(NILP (quarks) || *res_name))
{