summaryrefslogtreecommitdiff
path: root/src/coding.h
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2012-10-29 09:24:29 -0800
committerDaniel Colascione <dancol@dancol.org>2012-10-29 09:24:29 -0800
commitba11600816880f862a7a85899bfa3dc41c176273 (patch)
tree18f4f2ed554b2e93a1d2588a25e7df1d9339fbde /src/coding.h
parentd7f9cc85284bc159166d1c600100b0080bfad494 (diff)
downloademacs-ba11600816880f862a7a85899bfa3dc41c176273.tar.gz
2012-10-29 Daniel Colascione <dancol@dancol.org>
cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In preparation for fixing bug#12739, move these functions from here... * coding.h, coding.c: ... to here, and compile them only when WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 proper lets us write cygw32-agnostic code for the HAVE_NTGUI case.
Diffstat (limited to 'src/coding.h')
-rw-r--r--src/coding.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/coding.h b/src/coding.h
index 989552bf667..6ba5f8e0e1e 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -701,6 +701,28 @@ extern void encode_coding_object (struct coding_system *,
Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, Lisp_Object);
+#if defined (WINDOWSNT) || defined (HAVE_NTGUI)
+
+/* These functions use Lisp string objects to store the UTF-16LE
+ strings that modern versions of Windows expect. These strings are
+ not particularly useful to Lisp, and all Lisp strings should be
+ native Emacs multibyte. */
+
+/* Access the wide-character string stored in a Lisp string object. */
+#define WCSDATA(x) ((wchar_t *) SDATA (x))
+
+/* Convert the multi-byte string in STR to UTF-16LE encoded unibyte
+ string, and store it in *BUF. BUF may safely point to STR on entry. */
+extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf);
+
+/* Convert STR, a UTF-16LE encoded string embedded in a unibyte string
+ object, to a multi-byte Emacs string and return it. This function
+ calls code_convert_string_norecord internally and has all its
+ failure modes. STR itself is not modified. */
+extern Lisp_Object from_unicode (Lisp_Object str);
+
+#endif /* WINDOWSNT || HAVE_NTGUI */
+
/* Macros for backward compatibility. */
#define decode_coding_region(coding, from, to) \