emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/mac.c


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] Changes to emacs/src/mac.c
Date: Sat, 15 Oct 2005 22:22:17 -0400

Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.44 emacs/src/mac.c:1.45
*** emacs/src/mac.c:1.44        Sun Aug  7 12:33:17 2005
--- emacs/src/mac.c     Sun Oct 16 02:22:16 2005
***************
*** 3411,3417 ****
  }
  
  /* Convert a lisp string to the 4 byte character code.  */
!  
  OSType
  mac_get_code_from_arg(Lisp_Object arg, OSType defCode)
  {
--- 3411,3417 ----
  }
  
  /* Convert a lisp string to the 4 byte character code.  */
! 
  OSType
  mac_get_code_from_arg(Lisp_Object arg, OSType defCode)
  {
***************
*** 3419,3425 ****
    if (NILP(arg))
      {
        result = defCode;
!     } 
    else
      {
        /* check type string */
--- 3419,3425 ----
    if (NILP(arg))
      {
        result = defCode;
!     }
    else
      {
        /* check type string */
***************
*** 3483,3489 ****
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr) 
        {
  #ifdef MAC_OSX
          result = 
mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileCreator);
--- 3483,3489 ----
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr)
        {
  #ifdef MAC_OSX
          result = 
mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileCreator);
***************
*** 3538,3544 ****
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr) 
        {
  #ifdef MAC_OSX
          result = 
mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileType);
--- 3538,3544 ----
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr)
        {
  #ifdef MAC_OSX
          result = 
mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileType);
***************
*** 3596,3602 ****
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr) 
        {
  #ifdef MAC_OSX
        ((FileInfo*)&catalogInfo.finderInfo)->fileCreator = cCode;
--- 3596,3602 ----
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr)
        {
  #ifdef MAC_OSX
        ((FileInfo*)&catalogInfo.finderInfo)->fileCreator = cCode;
***************
*** 3656,3662 ****
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr) 
        {
  #ifdef MAC_OSX
        ((FileInfo*)&catalogInfo.finderInfo)->fileType = cCode;
--- 3656,3662 ----
  
        status = FSpGetFInfo (&fss, &finder_info);
  #endif
!       if (status == noErr)
        {
  #ifdef MAC_OSX
        ((FileInfo*)&catalogInfo.finderInfo)->fileType = cCode;
***************
*** 3968,3977 ****
    CFStringRef iana_name;
    CFStringEncoding encoding = kCFStringEncodingInvalidId;
  
    if (INTEGERP (obj))
      return XINT (obj);
  
!   if (SYMBOLP (obj) && !NILP (obj) && !NILP (Fcoding_system_p (obj)))
      {
        Lisp_Object coding_spec, plist;
  
--- 3968,3980 ----
    CFStringRef iana_name;
    CFStringEncoding encoding = kCFStringEncodingInvalidId;
  
+   if (NILP (obj))
+     return kCFStringEncodingUnicode;
+ 
    if (INTEGERP (obj))
      return XINT (obj);
  
!   if (SYMBOLP (obj) && !NILP (Fcoding_system_p (obj)))
      {
        Lisp_Object coding_spec, plist;
  
***************
*** 4115,4121 ****
         doc: /* Convert STRING from SOURCE encoding to TARGET encoding.
  The conversion is performed using the converter provided by the system.
  Each encoding is specified by either a coding system symbol, a mime
! charset string, or an integer as a CFStringEncoding value.
  On Mac OS X 10.2 and later, you can do Unicode Normalization by
  specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
  NFKD, NFC, NFKC, HFS+D, or HFS+C.
--- 4118,4125 ----
         doc: /* Convert STRING from SOURCE encoding to TARGET encoding.
  The conversion is performed using the converter provided by the system.
  Each encoding is specified by either a coding system symbol, a mime
! charset string, or an integer as a CFStringEncoding value.  Nil for
! encoding means UTF-16 in native byte order, no byte order marker.
  On Mac OS X 10.2 and later, you can do Unicode Normalization by
  specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
  NFKD, NFC, NFKC, HFS+D, or HFS+C.
***************
*** 4126,4132 ****
    Lisp_Object result = Qnil;
    CFStringEncoding src_encoding, tgt_encoding;
    CFStringRef str = NULL;
-   CFDataRef data = NULL;
  
    CHECK_STRING (string);
    if (!INTEGERP (source) && !STRINGP (source))
--- 4130,4135 ----
***************
*** 4148,4154 ****
    if (src_encoding != kCFStringEncodingInvalidId
        && tgt_encoding != kCFStringEncodingInvalidId)
      str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string),
!                                  src_encoding, true);
  #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
    if (str)
      {
--- 4151,4157 ----
    if (src_encoding != kCFStringEncodingInvalidId
        && tgt_encoding != kCFStringEncodingInvalidId)
      str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string),
!                                  src_encoding, !NILP (source));
  #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
    if (str)
      {
***************
*** 4160,4173 ****
  #endif
    if (str)
      {
!       data = CFStringCreateExternalRepresentation (NULL, str,
!                                                  tgt_encoding, '\0');
        CFRelease (str);
-     }
-   if (data)
-     {
-       result = cfdata_to_lisp (data);
-       CFRelease (data);
      }
  
    UNBLOCK_INPUT;
--- 4163,4179 ----
  #endif
    if (str)
      {
!       CFIndex str_len, buf_len;
! 
!       str_len = CFStringGetLength (str);
!       if (CFStringGetBytes (str, CFRangeMake (0, str_len), tgt_encoding, 0,
!                           !NILP (target), NULL, 0, &buf_len) == str_len)
!       {
!         result = make_uninit_string (buf_len);
!         CFStringGetBytes (str, CFRangeMake (0, str_len), tgt_encoding, 0,
!                           !NILP (target), SDATA (result), buf_len, NULL);
!       }
        CFRelease (str);
      }
  
    UNBLOCK_INPUT;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]