diff options
author | Daniel Colascione <dancol@dancol.org> | 2012-10-29 09:24:29 -0800 |
---|---|---|
committer | Daniel Colascione <dancol@dancol.org> | 2012-10-29 09:24:29 -0800 |
commit | ba11600816880f862a7a85899bfa3dc41c176273 (patch) | |
tree | 18f4f2ed554b2e93a1d2588a25e7df1d9339fbde /src/cygw32.c | |
parent | d7f9cc85284bc159166d1c600100b0080bfad494 (diff) |
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/cygw32.c')
-rw-r--r-- | src/cygw32.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/cygw32.c b/src/cygw32.c index 8f63461da2..54f2076a89 100644 --- a/src/cygw32.c +++ b/src/cygw32.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "buffer.h" #include <unistd.h> #include <fcntl.h> -static Lisp_Object Qutf_16le; static Lisp_Object fchdir_unwind (Lisp_Object dir_fd) @@ -107,36 +106,6 @@ conv_filename_from_w32_unicode (const wchar_t* in, int absolute_p) return unbind_to (count, DECODE_FILE (converted)); } -Lisp_Object -from_unicode (Lisp_Object str) -{ - CHECK_STRING (str); - if (!STRING_MULTIBYTE (str) && - SBYTES (str) & 1) - { - str = Fsubstring (str, make_number (0), make_number (-1)); - } - - return code_convert_string_norecord (str, Qutf_16le, 0); -} - -wchar_t * -to_unicode (Lisp_Object str, Lisp_Object *buf) -{ - *buf = code_convert_string_norecord (str, Qutf_16le, 1); - /* We need to make a another copy (in addition to the one made by - code_convert_string_norecord) to ensure that the final string is - _doubly_ zero terminated --- that is, that the string is - terminated by two zero bytes and one utf-16le null character. - Because strings are already terminated with a single zero byte, - we just add one additional zero. */ - str = make_uninit_string (SBYTES (*buf) + 1); - memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); - SDATA (str) [SBYTES (*buf)] = '\0'; - *buf = str; - return WCSDATA (*buf); -} - DEFUN ("cygwin-convert-path-to-windows", Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows, 1, 2, 0, @@ -162,8 +131,6 @@ DEFUN ("cygwin-convert-path-from-windows", void syms_of_cygw32 (void) { - /* No, not utf-16-le: that one has a BOM. */ - DEFSYM (Qutf_16le, "utf-16le"); defsubr (&Scygwin_convert_path_from_windows); defsubr (&Scygwin_convert_path_to_windows); } |