diff options
| author | Tom Tromey | 2012-12-17 07:56:22 -0700 |
|---|---|---|
| committer | Tom Tromey | 2012-12-17 07:56:22 -0700 |
| commit | 3d6eced1ae51ffd0a782130e7c334052277e2724 (patch) | |
| tree | 5d1d2ad7cd3374f922886c4a72062511a035c168 /src/coding.h | |
| parent | bf69f522a9e135f9aa483cedd53e71e915f2bf75 (diff) | |
| parent | 7c3d167f48d6262ee4e5512aa50a07ee96bc1509 (diff) | |
| download | emacs-3d6eced1ae51ffd0a782130e7c334052277e2724.tar.gz emacs-3d6eced1ae51ffd0a782130e7c334052277e2724.zip | |
merge from trunk
Diffstat (limited to 'src/coding.h')
| -rw-r--r-- | src/coding.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/coding.h b/src/coding.h index c45d2ef86e2..192be58f083 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -646,10 +646,8 @@ struct coding_system | |||
| 646 | for file names, if any. */ | 646 | for file names, if any. */ |
| 647 | #define ENCODE_FILE(name) \ | 647 | #define ENCODE_FILE(name) \ |
| 648 | (! NILP (Vfile_name_coding_system) \ | 648 | (! NILP (Vfile_name_coding_system) \ |
| 649 | && !EQ (Vfile_name_coding_system, make_number (0)) \ | ||
| 650 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \ | 649 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \ |
| 651 | : (! NILP (Vdefault_file_name_coding_system) \ | 650 | : (! NILP (Vdefault_file_name_coding_system) \ |
| 652 | && !EQ (Vdefault_file_name_coding_system, make_number (0)) \ | ||
| 653 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \ | 651 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \ |
| 654 | : name)) | 652 | : name)) |
| 655 | 653 | ||
| @@ -658,10 +656,8 @@ struct coding_system | |||
| 658 | for file names, if any. */ | 656 | for file names, if any. */ |
| 659 | #define DECODE_FILE(name) \ | 657 | #define DECODE_FILE(name) \ |
| 660 | (! NILP (Vfile_name_coding_system) \ | 658 | (! NILP (Vfile_name_coding_system) \ |
| 661 | && !EQ (Vfile_name_coding_system, make_number (0)) \ | ||
| 662 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \ | 659 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \ |
| 663 | : (! NILP (Vdefault_file_name_coding_system) \ | 660 | : (! NILP (Vdefault_file_name_coding_system) \ |
| 664 | && !EQ (Vdefault_file_name_coding_system, make_number (0)) \ | ||
| 665 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ | 661 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ |
| 666 | : name)) | 662 | : name)) |
| 667 | 663 | ||
| @@ -670,7 +666,6 @@ struct coding_system | |||
| 670 | for system functions, if any. */ | 666 | for system functions, if any. */ |
| 671 | #define ENCODE_SYSTEM(str) \ | 667 | #define ENCODE_SYSTEM(str) \ |
| 672 | (! NILP (Vlocale_coding_system) \ | 668 | (! NILP (Vlocale_coding_system) \ |
| 673 | && !EQ (Vlocale_coding_system, make_number (0)) \ | ||
| 674 | ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ | 669 | ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ |
| 675 | : str) | 670 | : str) |
| 676 | 671 | ||
| @@ -678,7 +673,6 @@ struct coding_system | |||
| 678 | for system functions, if any. */ | 673 | for system functions, if any. */ |
| 679 | #define DECODE_SYSTEM(str) \ | 674 | #define DECODE_SYSTEM(str) \ |
| 680 | (! NILP (Vlocale_coding_system) \ | 675 | (! NILP (Vlocale_coding_system) \ |
| 681 | && !EQ (Vlocale_coding_system, make_number (0)) \ | ||
| 682 | ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ | 676 | ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ |
| 683 | : str) | 677 | : str) |
| 684 | 678 | ||
| @@ -707,6 +701,28 @@ extern void encode_coding_object (struct coding_system *, | |||
| 707 | Lisp_Object, ptrdiff_t, ptrdiff_t, | 701 | Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 708 | ptrdiff_t, ptrdiff_t, Lisp_Object); | 702 | ptrdiff_t, ptrdiff_t, Lisp_Object); |
| 709 | 703 | ||
| 704 | #if defined (WINDOWSNT) || defined (CYGWIN) | ||
| 705 | |||
| 706 | /* These functions use Lisp string objects to store the UTF-16LE | ||
| 707 | strings that modern versions of Windows expect. These strings are | ||
| 708 | not particularly useful to Lisp, and all Lisp strings should be | ||
| 709 | native Emacs multibyte. */ | ||
| 710 | |||
| 711 | /* Access the wide-character string stored in a Lisp string object. */ | ||
| 712 | #define WCSDATA(x) ((wchar_t *) SDATA (x)) | ||
| 713 | |||
| 714 | /* Convert the multi-byte string in STR to UTF-16LE encoded unibyte | ||
| 715 | string, and store it in *BUF. BUF may safely point to STR on entry. */ | ||
| 716 | extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); | ||
| 717 | |||
| 718 | /* Convert STR, a UTF-16LE encoded string embedded in a unibyte string | ||
| 719 | object, to a multi-byte Emacs string and return it. This function | ||
| 720 | calls code_convert_string_norecord internally and has all its | ||
| 721 | failure modes. STR itself is not modified. */ | ||
| 722 | extern Lisp_Object from_unicode (Lisp_Object str); | ||
| 723 | |||
| 724 | #endif /* WINDOWSNT || CYGWIN */ | ||
| 725 | |||
| 710 | /* Macros for backward compatibility. */ | 726 | /* Macros for backward compatibility. */ |
| 711 | 727 | ||
| 712 | #define decode_coding_region(coding, from, to) \ | 728 | #define decode_coding_region(coding, from, to) \ |