*** empty log message ***
[bpt/emacs.git] / src / coding.h
index 103f623..5ef9f2a 100644 (file)
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.  */
 #define _CODING_H
 
 #ifndef _CCL_H
-#include "../src/ccl.h"
+#include "ccl.h"
 #endif
 
 /*** EMACS' INTERNAL FORMAT (emacs-mule) section ***/
@@ -282,6 +282,7 @@ enum coding_type
 #define CODING_FINISH_INSUFFICIENT_SRC 1
 #define CODING_FINISH_INSUFFICIENT_DST 2
 #define CODING_FINISH_INCONSISTENT_EOL 3
+#define CODING_FINISH_INTERRUPT                4
 
 /* Macros used for the member `mode' of the struct coding_system.  */
 
@@ -333,6 +334,9 @@ struct coding_system
      meaing of each non-zero value.  */
   int composing;
 
+  /* Number of composed characters in the current composing sequence.  */
+  int composed_chars;
+
   /* Detailed information specific to each type of coding system.  */
   union spec
     {
@@ -375,8 +379,8 @@ struct coding_system
   Lisp_Object pre_write_conversion;
 
   /* Character translation tables to look up, or nil.  */
-  Lisp_Object character_translation_table_for_decode;
-  Lisp_Object character_translation_table_for_encode;
+  Lisp_Object translation_table_for_decode;
+  Lisp_Object translation_table_for_encode;
 };
 
 #define CODING_REQUIRE_FLUSHING_MASK   1
@@ -417,10 +421,11 @@ struct coding_system
 #define CODING_CATEGORY_IDX_ISO_8_2    5
 #define CODING_CATEGORY_IDX_ISO_7_ELSE 6
 #define CODING_CATEGORY_IDX_ISO_8_ELSE 7
-#define CODING_CATEGORY_IDX_BIG5       8
-#define CODING_CATEGORY_IDX_RAW_TEXT   9
-#define CODING_CATEGORY_IDX_BINARY     10
-#define CODING_CATEGORY_IDX_MAX                11
+#define CODING_CATEGORY_IDX_CCL                8
+#define CODING_CATEGORY_IDX_BIG5       9
+#define CODING_CATEGORY_IDX_RAW_TEXT   10
+#define CODING_CATEGORY_IDX_BINARY     11
+#define CODING_CATEGORY_IDX_MAX                12
 
 /* Definitions of flag bits returned by the function
    detect_coding_mask ().  */
@@ -432,6 +437,7 @@ struct coding_system
 #define CODING_CATEGORY_MASK_ISO_8_2   (1 << CODING_CATEGORY_IDX_ISO_8_2)
 #define CODING_CATEGORY_MASK_ISO_7_ELSE        (1 << CODING_CATEGORY_IDX_ISO_7_ELSE)
 #define CODING_CATEGORY_MASK_ISO_8_ELSE        (1 << CODING_CATEGORY_IDX_ISO_8_ELSE)
+#define CODING_CATEGORY_MASK_CCL       (1 << CODING_CATEGORY_IDX_CCL)
 #define CODING_CATEGORY_MASK_BIG5      (1 << CODING_CATEGORY_IDX_BIG5)
 #define CODING_CATEGORY_MASK_RAW_TEXT  (1 << CODING_CATEGORY_IDX_RAW_TEXT)
 #define CODING_CATEGORY_MASK_BINARY    (1 << CODING_CATEGORY_IDX_BINARY)
@@ -447,6 +453,7 @@ struct coding_system
    | CODING_CATEGORY_MASK_ISO_8_2      \
    | CODING_CATEGORY_MASK_ISO_7_ELSE   \
    | CODING_CATEGORY_MASK_ISO_8_ELSE   \
+   | CODING_CATEGORY_MASK_CCL          \
    | CODING_CATEGORY_MASK_BIG5)
 
 #define CODING_CATEGORY_MASK_ISO_7BIT \
@@ -493,10 +500,10 @@ struct coding_system
 #define ENCODE_FILE(name)                                                 \
   (! NILP (Vfile_name_coding_system)                                      \
    && XFASTINT (Vfile_name_coding_system) != 0                            \
-   ? Fencode_coding_string (name, Vfile_name_coding_system, Qt)                   \
+   ? code_convert_string_norecord (name, Vfile_name_coding_system, 1)     \
    : (! NILP (Vdefault_file_name_coding_system)                                   \
-      && XFASTINT (Vdefault_file_name_coding_system)                      \
-      ? Fencode_coding_string (name, Vdefault_file_name_coding_system, Qt) \
+      && XFASTINT (Vdefault_file_name_coding_system) != 0                 \
+      ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \
       : name))
 
 /* Decode the file name NAME using the specified coding system
@@ -504,10 +511,10 @@ struct coding_system
 #define DECODE_FILE(name)                                                 \
   (! NILP (Vfile_name_coding_system)                                      \
    && XFASTINT (Vfile_name_coding_system) != 0                            \
-   ? Fdecode_coding_string (name, Vfile_name_coding_system, Qt)                   \
+   ? code_convert_string_norecord (name, Vfile_name_coding_system, 0)     \
    : (! NILP (Vdefault_file_name_coding_system)                                   \
-      && XFASTINT (Vdefault_file_name_coding_system)                      \
-      ? Fdecode_coding_string (name, Vdefault_file_name_coding_system, Qt) \
+      && XFASTINT (Vdefault_file_name_coding_system) != 0                 \
+      ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \
       : name))
 
 /* Extern declarations.  */
@@ -525,30 +532,35 @@ extern int conversion_buffer_size;
 extern char *conversion_buffer;
 extern char *get_conversion_buffer P_ ((int));
 extern int setup_coding_system P_ ((Lisp_Object, struct coding_system *));
+extern void setup_raw_text_coding_system P_ ((struct coding_system *));
 extern Lisp_Object Qcoding_system, Qeol_type, Qcoding_category_index;
-extern Lisp_Object Qraw_text;
+extern Lisp_Object Qraw_text, Qemacs_mule;
 extern Lisp_Object Qbuffer_file_coding_system;
 extern Lisp_Object Vcoding_category_list;
 
-extern Lisp_Object Qcharacter_translation_table;
-extern Lisp_Object Qcharacter_translation_table_id;
+extern Lisp_Object Qtranslation_table;
+extern Lisp_Object Qtranslation_table_id;
 
-/* Mnemonic character to indicate each type of end-of-line.  */
-extern int eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
-/* Mnemonic character to indicate type of end-of-line is not yet decided.  */
-extern int eol_mnemonic_undecided;
+/* Mnemonic strings to indicate each type of end-of-line.  */
+extern Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
+/* Mnemonic string to indicate type of end-of-line is not yet decided.  */
+extern Lisp_Object eol_mnemonic_undecided;
 
 #ifdef emacs
 extern Lisp_Object Qfile_coding_system;
 extern Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument;
 extern Lisp_Object Qstart_process, Qopen_network_stream;
 
+extern char *emacs_strerror P_ ((int));
+
 /* Coding-system for reading files and receiving data from process.  */
 extern Lisp_Object Vcoding_system_for_read;
 /* Coding-system for writing files and sending data to process.  */
 extern Lisp_Object Vcoding_system_for_write;
 /* Coding-system actually used in the latest I/O.  */
 extern Lisp_Object Vlast_coding_system_used;
+/* Coding-system to use with system messages (e.g. strerror).  */
+extern Lisp_Object Vlocale_coding_system;
 
 /* If non-zero, process buffer inherits the coding system used to decode
    the subprocess output.  */
@@ -568,6 +580,9 @@ extern struct coding_system safe_terminal_coding;
    function `set-keyboard-coding-system'.  */
 extern struct coding_system keyboard_coding;
 
+/* Default coding system to be used to write a file.  */
+extern struct coding_system default_buffer_file_coding;
+
 /* Default coding systems used for process I/O.  */
 extern Lisp_Object Vdefault_process_coding_system;