diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 69 |
1 files changed, 24 insertions, 45 deletions
diff --git a/src/coding.c b/src/coding.c index 711ada59c85..b49070e5e16 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -300,27 +300,30 @@ encode_coding_XXX (struct coding_system *coding) | |||
| 300 | 300 | ||
| 301 | Lisp_Object Vcoding_system_hash_table; | 301 | Lisp_Object Vcoding_system_hash_table; |
| 302 | 302 | ||
| 303 | Lisp_Object Qcoding_system, Qcoding_aliases, Qeol_type; | 303 | static Lisp_Object Qcoding_system, Qeol_type; |
| 304 | static Lisp_Object Qcoding_aliases; | ||
| 304 | Lisp_Object Qunix, Qdos; | 305 | Lisp_Object Qunix, Qdos; |
| 305 | Lisp_Object Qbuffer_file_coding_system; | 306 | Lisp_Object Qbuffer_file_coding_system; |
| 306 | Lisp_Object Qpost_read_conversion, Qpre_write_conversion; | 307 | static Lisp_Object Qpost_read_conversion, Qpre_write_conversion; |
| 307 | Lisp_Object Qdefault_char; | 308 | static Lisp_Object Qdefault_char; |
| 308 | Lisp_Object Qno_conversion, Qundecided; | 309 | Lisp_Object Qno_conversion, Qundecided; |
| 309 | Lisp_Object Qcharset, Qiso_2022, Qutf_8, Qutf_16, Qshift_jis, Qbig5; | 310 | Lisp_Object Qcharset, Qutf_8; |
| 310 | Lisp_Object Qbig, Qlittle; | 311 | static Lisp_Object Qiso_2022; |
| 311 | Lisp_Object Qcoding_system_history; | 312 | static Lisp_Object Qutf_16, Qshift_jis, Qbig5; |
| 312 | Lisp_Object Qvalid_codes; | 313 | static Lisp_Object Qbig, Qlittle; |
| 313 | Lisp_Object QCcategory, QCmnemonic, QCdefault_char; | 314 | static Lisp_Object Qcoding_system_history; |
| 314 | Lisp_Object QCdecode_translation_table, QCencode_translation_table; | 315 | static Lisp_Object Qvalid_codes; |
| 315 | Lisp_Object QCpost_read_conversion, QCpre_write_conversion; | 316 | static Lisp_Object QCcategory, QCmnemonic, QCdefault_char; |
| 316 | Lisp_Object QCascii_compatible_p; | 317 | static Lisp_Object QCdecode_translation_table, QCencode_translation_table; |
| 318 | static Lisp_Object QCpost_read_conversion, QCpre_write_conversion; | ||
| 319 | static Lisp_Object QCascii_compatible_p; | ||
| 317 | 320 | ||
| 318 | Lisp_Object Qcall_process, Qcall_process_region; | 321 | Lisp_Object Qcall_process, Qcall_process_region; |
| 319 | Lisp_Object Qstart_process, Qopen_network_stream; | 322 | Lisp_Object Qstart_process, Qopen_network_stream; |
| 320 | Lisp_Object Qtarget_idx; | 323 | static Lisp_Object Qtarget_idx; |
| 321 | 324 | ||
| 322 | Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; | 325 | static Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; |
| 323 | Lisp_Object Qinterrupted, Qinsufficient_memory; | 326 | static Lisp_Object Qinterrupted, Qinsufficient_memory; |
| 324 | 327 | ||
| 325 | /* If a symbol has this property, evaluate the value to define the | 328 | /* If a symbol has this property, evaluate the value to define the |
| 326 | symbol as a coding system. */ | 329 | symbol as a coding system. */ |
| @@ -351,12 +354,12 @@ struct coding_system safe_terminal_coding; | |||
| 351 | 354 | ||
| 352 | Lisp_Object Qtranslation_table; | 355 | Lisp_Object Qtranslation_table; |
| 353 | Lisp_Object Qtranslation_table_id; | 356 | Lisp_Object Qtranslation_table_id; |
| 354 | Lisp_Object Qtranslation_table_for_decode; | 357 | static Lisp_Object Qtranslation_table_for_decode; |
| 355 | Lisp_Object Qtranslation_table_for_encode; | 358 | static Lisp_Object Qtranslation_table_for_encode; |
| 356 | 359 | ||
| 357 | /* Two special coding systems. */ | 360 | /* Two special coding systems. */ |
| 358 | Lisp_Object Vsjis_coding_system; | 361 | static Lisp_Object Vsjis_coding_system; |
| 359 | Lisp_Object Vbig5_coding_system; | 362 | static Lisp_Object Vbig5_coding_system; |
| 360 | 363 | ||
| 361 | /* ISO2022 section */ | 364 | /* ISO2022 section */ |
| 362 | 365 | ||
| @@ -2859,7 +2862,7 @@ encode_coding_emacs_mule (struct coding_system *coding) | |||
| 2859 | COMPOSITION_WITH_RULE_ALTCHARS: | 2862 | COMPOSITION_WITH_RULE_ALTCHARS: |
| 2860 | ESC 4 ALTCHAR [ RULE ALTCHAR ] ESC 0 CHAR [ CHAR ] ESC 1 */ | 2863 | ESC 4 ALTCHAR [ RULE ALTCHAR ] ESC 0 CHAR [ CHAR ] ESC 1 */ |
| 2861 | 2864 | ||
| 2862 | enum iso_code_class_type iso_code_class[256]; | 2865 | static enum iso_code_class_type iso_code_class[256]; |
| 2863 | 2866 | ||
| 2864 | #define SAFE_CHARSET_P(coding, id) \ | 2867 | #define SAFE_CHARSET_P(coding, id) \ |
| 2865 | ((id) <= (coding)->max_charset_id \ | 2868 | ((id) <= (coding)->max_charset_id \ |
| @@ -6209,7 +6212,7 @@ adjust_coding_eol_type (struct coding_system *coding, int eol_seen) | |||
| 6209 | system is detected, update fields of CODING by the detected coding | 6212 | system is detected, update fields of CODING by the detected coding |
| 6210 | system. */ | 6213 | system. */ |
| 6211 | 6214 | ||
| 6212 | void | 6215 | static void |
| 6213 | detect_coding (struct coding_system *coding) | 6216 | detect_coding (struct coding_system *coding) |
| 6214 | { | 6217 | { |
| 6215 | const unsigned char *src, *src_end; | 6218 | const unsigned char *src, *src_end; |
| @@ -7527,30 +7530,6 @@ decode_coding_gap (struct coding_system *coding, | |||
| 7527 | return coding->result; | 7530 | return coding->result; |
| 7528 | } | 7531 | } |
| 7529 | 7532 | ||
| 7530 | int | ||
| 7531 | encode_coding_gap (struct coding_system *coding, | ||
| 7532 | EMACS_INT chars, EMACS_INT bytes) | ||
| 7533 | { | ||
| 7534 | int count = SPECPDL_INDEX (); | ||
| 7535 | |||
| 7536 | code_conversion_save (0, 0); | ||
| 7537 | |||
| 7538 | coding->src_object = Fcurrent_buffer (); | ||
| 7539 | coding->src_chars = chars; | ||
| 7540 | coding->src_bytes = bytes; | ||
| 7541 | coding->src_pos = -chars; | ||
| 7542 | coding->src_pos_byte = -bytes; | ||
| 7543 | coding->src_multibyte = chars < bytes; | ||
| 7544 | coding->dst_object = coding->src_object; | ||
| 7545 | coding->dst_pos = PT; | ||
| 7546 | coding->dst_pos_byte = PT_BYTE; | ||
| 7547 | |||
| 7548 | encode_coding (coding); | ||
| 7549 | |||
| 7550 | unbind_to (count, Qnil); | ||
| 7551 | return coding->result; | ||
| 7552 | } | ||
| 7553 | |||
| 7554 | 7533 | ||
| 7555 | /* Decode the text in the range FROM/FROM_BYTE and TO/TO_BYTE in | 7534 | /* Decode the text in the range FROM/FROM_BYTE and TO/TO_BYTE in |
| 7556 | SRC_OBJECT into DST_OBJECT by coding context CODING. | 7535 | SRC_OBJECT into DST_OBJECT by coding context CODING. |
| @@ -8831,7 +8810,7 @@ is nil. */) | |||
| 8831 | } | 8810 | } |
| 8832 | 8811 | ||
| 8833 | 8812 | ||
| 8834 | Lisp_Object | 8813 | static Lisp_Object |
| 8835 | code_convert_region (Lisp_Object start, Lisp_Object end, | 8814 | code_convert_region (Lisp_Object start, Lisp_Object end, |
| 8836 | Lisp_Object coding_system, Lisp_Object dst_object, | 8815 | Lisp_Object coding_system, Lisp_Object dst_object, |
| 8837 | int encodep, int norecord) | 8816 | int encodep, int norecord) |