aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.h
diff options
context:
space:
mode:
authorEli Zaretskii2018-01-15 14:15:53 +0200
committerEli Zaretskii2018-01-15 14:15:53 +0200
commitf3fafd24175a8918996c824db17c670c13fb380d (patch)
tree8b14ba97184ebf60360ac97e95df3ed6e1f54285 /src/coding.h
parentadb9e75d916ead0fee77f540ecb74b731b40e0fa (diff)
downloademacs-f3fafd24175a8918996c824db17c670c13fb380d.tar.gz
emacs-f3fafd24175a8918996c824db17c670c13fb380d.zip
; * src/coding.h (surrogates_to_codepoint): Add prototype.
Diffstat (limited to 'src/coding.h')
-rw-r--r--src/coding.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/coding.h b/src/coding.h
index d90b799d76e..165c1b29b71 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -674,18 +674,6 @@ struct coding_system
674#define UTF_16_LOW_SURROGATE_P(val) \ 674#define UTF_16_LOW_SURROGATE_P(val) \
675 (((val) & 0xFC00) == 0xDC00) 675 (((val) & 0xFC00) == 0xDC00)
676 676
677/* Return the Unicode code point for the given UTF-16 surrogates. */
678
679INLINE int
680surrogates_to_codepoint (int low, int high)
681{
682 eassert (0 <= low && low <= 0xFFFF);
683 eassert (0 <= high && high <= 0xFFFF);
684 eassert (UTF_16_LOW_SURROGATE_P (low));
685 eassert (UTF_16_HIGH_SURROGATE_P (high));
686 return 0x10000 + (low - 0xDC00) + ((high - 0xD800) * 0x400);
687}
688
689/* Extern declarations. */ 677/* Extern declarations. */
690extern Lisp_Object code_conversion_save (bool, bool); 678extern Lisp_Object code_conversion_save (bool, bool);
691extern bool encode_coding_utf_8 (struct coding_system *); 679extern bool encode_coding_utf_8 (struct coding_system *);
@@ -712,6 +700,8 @@ extern void decode_coding_object (struct coding_system *,
712extern void encode_coding_object (struct coding_system *, 700extern void encode_coding_object (struct coding_system *,
713 Lisp_Object, ptrdiff_t, ptrdiff_t, 701 Lisp_Object, ptrdiff_t, ptrdiff_t,
714 ptrdiff_t, ptrdiff_t, Lisp_Object); 702 ptrdiff_t, ptrdiff_t, Lisp_Object);
703/* Defined in this file. */
704INLINE int surrogates_to_codepoint (int, int);
715 705
716#if defined (WINDOWSNT) || defined (CYGWIN) 706#if defined (WINDOWSNT) || defined (CYGWIN)
717 707
@@ -756,6 +746,18 @@ extern Lisp_Object from_unicode_buffer (const wchar_t *wstr);
756 } while (false) 746 } while (false)
757 747
758 748
749/* Return the Unicode code point for the given UTF-16 surrogates. */
750
751INLINE int
752surrogates_to_codepoint (int low, int high)
753{
754 eassert (0 <= low && low <= 0xFFFF);
755 eassert (0 <= high && high <= 0xFFFF);
756 eassert (UTF_16_LOW_SURROGATE_P (low));
757 eassert (UTF_16_HIGH_SURROGATE_P (high));
758 return 0x10000 + (low - 0xDC00) + ((high - 0xD800) * 0x400);
759}
760
759extern Lisp_Object preferred_coding_system (void); 761extern Lisp_Object preferred_coding_system (void);
760 762
761 763