From 84cc1ab62539eed7869a88003a017330d79e8cac Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 30 Dec 2012 13:34:39 -0800 Subject: * coding.c (Qmac): Now static. --- src/coding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/coding.h') diff --git a/src/coding.h b/src/coding.h index 192be58f083..db0033c751b 100644 --- a/src/coding.h +++ b/src/coding.h @@ -767,7 +767,7 @@ extern Lisp_Object Qcoding_system_p; extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided; extern Lisp_Object Qbuffer_file_coding_system; -extern Lisp_Object Qunix, Qdos, Qmac; +extern Lisp_Object Qunix, Qdos; extern Lisp_Object Qtranslation_table; extern Lisp_Object Qtranslation_table_id; -- cgit v1.2.1 From ab422c4d6899b1442cb6954c1829c1fb656b006c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 1 Jan 2013 09:11:05 +0000 Subject: Update copyright notices for 2013. --- src/coding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/coding.h') diff --git a/src/coding.h b/src/coding.h index 192be58f083..4954adb3161 100644 --- a/src/coding.h +++ b/src/coding.h @@ -1,5 +1,5 @@ /* Header for coding system handler. - Copyright (C) 2001-2012 Free Software Foundation, Inc. + Copyright (C) 2001-2013 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 National Institute of Advanced Industrial Science and Technology (AIST) -- cgit v1.2.1 From 1af1a51aada18d88fac7b2ba09231428c6a65d7c Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 6 Mar 2013 15:26:30 +0400 Subject: Coding system support cleanup and minor refactoring. * coding.h (enum coding_result_code): Remove CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM. (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL. (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY) (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION) (CODING_MODE_SAFE_ENCODING): Rearrange bit values. (decode_coding_region, encode_coding_region, decode_coding_string): Remove unused compatibility macros. * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove. (record_conversion_result): Adjust user. (syms_of_coding): Likewise. (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA. (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE. (decode_coding_object): Simplify since xrealloc never returns NULL. Add eassert. --- src/coding.h | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'src/coding.h') diff --git a/src/coding.h b/src/coding.h index eb95fa13ddb..28a7d776b63 100644 --- a/src/coding.h +++ b/src/coding.h @@ -272,37 +272,31 @@ enum coding_result_code CODING_RESULT_SUCCESS, CODING_RESULT_INSUFFICIENT_SRC, CODING_RESULT_INSUFFICIENT_DST, - CODING_RESULT_INCONSISTENT_EOL, CODING_RESULT_INVALID_SRC, - CODING_RESULT_INTERRUPT, - CODING_RESULT_INSUFFICIENT_MEM + CODING_RESULT_INTERRUPT }; /* Macros used for the member `mode' of the struct coding_system. */ -/* If set, recover the original CR or LF of the already decoded text - when the decoding routine encounters an inconsistent eol format. */ -#define CODING_MODE_INHIBIT_INCONSISTENT_EOL 0x01 - /* If set, the decoding/encoding routines treat the current data as the last block of the whole text to be converted, and do the appropriate finishing job. */ -#define CODING_MODE_LAST_BLOCK 0x02 +#define CODING_MODE_LAST_BLOCK 0x01 /* If set, it means that the current source text is in a buffer which enables selective display. */ -#define CODING_MODE_SELECTIVE_DISPLAY 0x04 +#define CODING_MODE_SELECTIVE_DISPLAY 0x02 /* This flag is used by the decoding/encoding routines on the fly. If set, it means that right-to-left text is being processed. */ -#define CODING_MODE_DIRECTION 0x08 +#define CODING_MODE_DIRECTION 0x04 -#define CODING_MODE_FIXED_DESTINATION 0x10 +#define CODING_MODE_FIXED_DESTINATION 0x08 /* If set, it means that the encoding routines produces some safe ASCII characters (usually '?') for unsupported characters. */ -#define CODING_MODE_SAFE_ENCODING 0x20 +#define CODING_MODE_SAFE_ENCODING 0x10 /* For handling composition sequence. */ #include "composite.h" @@ -725,22 +719,6 @@ extern Lisp_Object from_unicode (Lisp_Object str); /* Macros for backward compatibility. */ -#define decode_coding_region(coding, from, to) \ - decode_coding_object (coding, Fcurrent_buffer (), \ - from, CHAR_TO_BYTE (from), \ - to, CHAR_TO_BYTE (to), Fcurrent_buffer ()) - - -#define encode_coding_region(coding, from, to) \ - encode_coding_object (coding, Fcurrent_buffer (), \ - from, CHAR_TO_BYTE (from), \ - to, CHAR_TO_BYTE (to), Fcurrent_buffer ()) - - -#define decode_coding_string(coding, string, nocopy) \ - decode_coding_object (coding, string, 0, 0, SCHARS (string), \ - SBYTES (string), Qt) - #define encode_coding_string(coding, string, nocopy) \ (STRING_MULTIBYTE(string) ? \ (encode_coding_object (coding, string, 0, 0, SCHARS (string), \ -- cgit v1.2.1 From 819e2da92a18d7af03ccd9cf0a2e5b940eb7b54f Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Sun, 10 Mar 2013 14:55:25 -0800 Subject: 2013-03-10 Daniel Colascione * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN) (GUI_SDATA, guichar_t): Macros to abstract out differences between NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of w32fns.c. * w32term.c (construct_drag_n_drop): Use the above macros to make drag-and-drop work for non-ASCII filenames in cygw32 builds. * w32fns.c (x_set_name, x_set_title): Use the above macros to properly display non-ASCII frame titles in cygw32 builds. * w32fns.c (Fw32_shell_execute): Use the above macros to properly call ShellExecute in cygw32 builds. * w32fn.c (Fx_file_dialog): Use the above macros to simplify the common file dialog code. * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which can just use du like other systems. * coding.c (from_unicode_buffer): Declare. * coding.c (from_unicode_buffer): Implement. --- src/coding.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/coding.h') diff --git a/src/coding.h b/src/coding.h index 28a7d776b63..c13567c3d53 100644 --- a/src/coding.h +++ b/src/coding.h @@ -715,6 +715,9 @@ extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); failure modes. STR itself is not modified. */ extern Lisp_Object from_unicode (Lisp_Object str); +/* Convert WSTR to an Emacs string. */ +extern Lisp_Object from_unicode_buffer (const wchar_t* wstr); + #endif /* WINDOWSNT || CYGWIN */ /* Macros for backward compatibility. */ -- cgit v1.2.1 From 8a44e6d176989d8eef140314098c76a70248ba61 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 16 Mar 2013 01:03:54 +0900 Subject: Optimize ASCII file reading with EOL format detection and decoding. --- src/coding.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/coding.h') diff --git a/src/coding.h b/src/coding.h index c13567c3d53..d40209be68f 100644 --- a/src/coding.h +++ b/src/coding.h @@ -440,9 +440,13 @@ struct coding_system /* How may heading bytes we can skip for decoding. This is set to -1 in setup_coding_system, and updated by detect_coding. So, when this is equal to the byte length of the text being - converted, we can skip the actual conversion process. */ + converted, we can skip the actual conversion process except for + the eol format. */ ptrdiff_t head_ascii; + /* Used internally in coding.c. See the comment of detect_ascii. */ + int eol_seen; + /* The following members are set by encoding/decoding routine. */ ptrdiff_t produced, produced_char, consumed, consumed_char; -- cgit v1.2.1