diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2013-03-06 15:26:30 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2013-03-06 15:26:30 +0400 |
commit | 1af1a51aada18d88fac7b2ba09231428c6a65d7c (patch) | |
tree | 0de56c02accf7de21dff3d26da734374ab2c9b6f /src/coding.h | |
parent | 34fd7a48dde735b199d618c06ea87a5e8f193406 (diff) | |
download | emacs-1af1a51aada18d88fac7b2ba09231428c6a65d7c.tar.gz |
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.
Diffstat (limited to 'src/coding.h')
-rw-r--r-- | src/coding.h | 34 |
1 files changed, 6 insertions, 28 deletions
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), \ |