Auto-commit of loaddefs files.
[bpt/emacs.git] / src / coding.h
index 0caa5b2..c45d2ef 100644 (file)
@@ -1,8 +1,7 @@
 /* Header for coding system handler.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 2001-2012  Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-     2005, 2006, 2007, 2008, 2009, 2010
+     2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
    Copyright (C) 2003
@@ -178,7 +177,6 @@ enum coding_attr_index
 #define CODING_ATTR_PRE_WRITE(attrs)   AREF (attrs, coding_attr_pre_write)
 #define CODING_ATTR_DEFAULT_CHAR(attrs)        AREF (attrs, coding_attr_default_char)
 #define CODING_ATTR_FOR_UNIBYTE(attrs) AREF (attrs, coding_attr_for_unibyte)
-#define CODING_ATTR_FLUSHING(attrs)    AREF (attrs, coding_attr_flushing)
 #define CODING_ATTR_PLIST(attrs)       AREF (attrs, coding_attr_plist)
 #define CODING_ATTR_CATEGORY(attrs)    AREF (attrs, coding_attr_category)
 #define CODING_ATTR_SAFE_CHARSETS(attrs)AREF (attrs, coding_attr_safe_charsets)
@@ -323,7 +321,7 @@ struct composition_status
 {
   enum composition_state state;
   enum composition_method method;
-  int old_form;                  /* 0:pre-21 form, 1:post-21 form */
+  bool old_form;         /* true if pre-21 form */
   int length;            /* number of elements produced in charbuf */
   int nchars;            /* number of characters composed */
   int ncomps;            /* number of composition components */
@@ -352,18 +350,18 @@ struct iso_2022_spec
      there was an invalid designation previously.  */
   int current_designation[4];
 
-  /* Set to 1 temporarily only when graphic register 2 or 3 is invoked
-     by single-shift while encoding.  */
-  int single_shifting;
-
-  /* Set to 1 temporarily only when processing at beginning of line.  */
-  int bol;
-
   /* If positive, we are now scanning CTEXT extended segment.  */
   int ctext_extended_segment_len;
 
-  /* If nonzero, we are now scanning embedded UTF-8 sequence.  */
-  int embedded_utf_8;
+  /* True temporarily only when graphic register 2 or 3 is invoked by
+     single-shift while encoding.  */
+  unsigned single_shifting : 1;
+
+  /* True temporarily only when processing at beginning of line.  */
+  unsigned bol : 1;
+
+  /* If true, we are now scanning embedded UTF-8 sequence.  */
+  unsigned embedded_utf_8 : 1;
 
   /* The current composition.  */
   struct composition_status cmp_status;
@@ -371,7 +369,6 @@ struct iso_2022_spec
 
 struct emacs_mule_spec
 {
-  int full_support;
   struct composition_status cmp_status;
 };
 
@@ -416,7 +413,7 @@ struct coding_system
      setup_coding_system.  At the early stage of building time, this
      value is -1 in the array coding_categories to indicate that no
      coding-system of that category is yet defined.  */
-  int id;
+  ptrdiff_t id;
 
   /* Flag bits of the coding system.  The meaning of each bit is common
      to all types of coding systems.  */
@@ -450,32 +447,28 @@ struct coding_system
      -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.  */
-  int head_ascii;
+  ptrdiff_t head_ascii;
 
   /* The following members are set by encoding/decoding routine.  */
-  EMACS_INT produced, produced_char, consumed, consumed_char;
+  ptrdiff_t produced, produced_char, consumed, consumed_char;
 
   /* Number of error source data found in a decoding routine.  */
   int errors;
 
-  /* Store the positions of error source data. */
-  EMACS_INT *error_positions;
+  /* Store the positions of error source data.  */
+  ptrdiff_t *error_positions;
 
   /* Finish status of code conversion.  */
   enum coding_result_code result;
 
-  EMACS_INT src_pos, src_pos_byte, src_chars, src_bytes;
+  ptrdiff_t src_pos, src_pos_byte, src_chars, src_bytes;
   Lisp_Object src_object;
   const unsigned char *source;
 
-  EMACS_INT dst_pos, dst_pos_byte, dst_bytes;
+  ptrdiff_t dst_pos, dst_pos_byte, dst_bytes;
   Lisp_Object dst_object;
   unsigned char *destination;
 
-  /* Set to 1 if the source of conversion is not in the member
-     `charbuf', but at `src_object'.  */
-  int chars_at_source;
-
   /* If an element is non-negative, it is a character code.
 
      If it is in the range -128..-1, it is a 8-bit character code
@@ -486,23 +479,26 @@ struct coding_system
      element.  The following elements are OFFSET, ANNOTATION-TYPE, and
      a sequence of actual data for the annotation.  OFFSET is a
      character position offset from dst_pos or src_pos,
-     ANNOTATION-TYPE specfies the meaning of the annotation and how to
+     ANNOTATION-TYPE specifies the meaning of the annotation and how to
      handle the following data..  */
   int *charbuf;
   int charbuf_size, charbuf_used;
 
+  /* True if the source of conversion is not in the member
+     `charbuf', but at `src_object'.  */
+  unsigned chars_at_source : 1;
+
   /* Set to 1 if charbuf contains an annotation.  */
-  int annotated;
+  unsigned annotated : 1;
 
   unsigned char carryover[64];
   int carryover_bytes;
 
   int default_char;
 
-  int (*detector) (struct coding_system *,
-                   struct coding_detection_info *);
+  bool (*detector) (struct coding_system *, struct coding_detection_info *);
   void (*decoder) (struct coding_system *);
-  int (*encoder) (struct coding_system *);
+  bool (*encoder) (struct coding_system *);
 };
 
 /* Meanings of bits in the member `common_flags' of the structure
@@ -519,7 +515,7 @@ struct coding_system
 #define CODING_REQUIRE_DETECTION_MASK          0x1000
 #define CODING_RESET_AT_BOL_MASK               0x2000
 
-/* Return 1 if the coding context CODING requires annotaion
+/* Return 1 if the coding context CODING requires annotation
    handling.  */
 #define CODING_REQUIRE_ANNOTATION(coding) \
   ((coding)->common_flags & CODING_ANNOTATION_MASK)
@@ -686,38 +682,30 @@ struct coding_system
    ? code_convert_string_norecord (str, Vlocale_coding_system, 0)         \
    : str)
 
-/* Used by the gtk menu code.  Note that this encodes utf-8, not
-   utf-8-emacs, so it's not a no-op.  */
+/* Note that this encodes utf-8, not utf-8-emacs, so it's not a no-op.  */
 #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1)
 
 /* Extern declarations.  */
-extern Lisp_Object code_conversion_save (int, int);
-extern int decoding_buffer_size (struct coding_system *, int);
-extern int encoding_buffer_size (struct coding_system *, int);
+extern Lisp_Object code_conversion_save (bool, bool);
 extern void setup_coding_system (Lisp_Object, struct coding_system *);
 extern Lisp_Object coding_charset_list (struct coding_system *);
 extern Lisp_Object coding_system_charset_list (Lisp_Object);
-extern void detect_coding (struct coding_system *);
-extern Lisp_Object code_convert_region (Lisp_Object, Lisp_Object,
-                                        Lisp_Object, Lisp_Object,
-                                        int, int);
 extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object,
-                                        Lisp_Object, int, int, int);
+                                        Lisp_Object, bool, bool, bool);
 extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
-                                                 int);
+                                                 bool);
 extern Lisp_Object raw_text_coding_system (Lisp_Object);
 extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object);
+extern Lisp_Object complement_process_encoding_system (Lisp_Object);
 
-extern int decode_coding_gap (struct coding_system *,
-                              EMACS_INT, EMACS_INT);
-extern int encode_coding_gap (struct coding_system *,
-                              EMACS_INT, EMACS_INT);
+extern void decode_coding_gap (struct coding_system *,
+                              ptrdiff_t, ptrdiff_t);
 extern void decode_coding_object (struct coding_system *,
-                                  Lisp_Object, EMACS_INT, EMACS_INT,
-                                  EMACS_INT, EMACS_INT, Lisp_Object);
+                                  Lisp_Object, ptrdiff_t, ptrdiff_t,
+                                  ptrdiff_t, ptrdiff_t, Lisp_Object);
 extern void encode_coding_object (struct coding_system *,
-                                  Lisp_Object, EMACS_INT, EMACS_INT,
-                                  EMACS_INT, EMACS_INT, Lisp_Object);
+                                  Lisp_Object, ptrdiff_t, ptrdiff_t,
+                                  ptrdiff_t, ptrdiff_t, Lisp_Object);
 
 /* Macros for backward compatibility.  */
 
@@ -758,10 +746,9 @@ extern Lisp_Object preferred_coding_system (void);
 
 extern Lisp_Object Qutf_8, Qutf_8_emacs;
 
-extern Lisp_Object Qcoding_system, Qeol_type, Qcoding_category_index;
+extern Lisp_Object Qcoding_category_index;
 extern Lisp_Object Qcoding_system_p;
 extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
-extern Lisp_Object Qiso_2022;
 extern Lisp_Object Qbuffer_file_coding_system;
 
 extern Lisp_Object Qunix, Qdos, Qmac;
@@ -769,11 +756,6 @@ extern Lisp_Object Qunix, Qdos, Qmac;
 extern Lisp_Object Qtranslation_table;
 extern Lisp_Object Qtranslation_table_id;
 
-/* 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;
@@ -782,53 +764,15 @@ extern Lisp_Object Qwrite_region;
 
 extern char *emacs_strerror (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.  */
-extern int inherit_process_coding_system;
-
 /* Coding system to be used to encode text for terminal display when
    terminal coding system is nil.  */
 extern struct coding_system safe_terminal_coding;
 
-/* Default coding systems used for process I/O.  */
-extern Lisp_Object Vdefault_process_coding_system;
-
-/* Char table for translating Quail and self-inserting input.  */
-extern Lisp_Object Vtranslation_table_for_input;
-
-/* Function to call to force a user to force select a propert coding
-   system.  */
-extern Lisp_Object Vselect_safe_coding_system_function;
-
-/* If nonzero, on writing a file, Vselect_safe_coding_system_function
-   is called even if Vcoding_system_for_write is non-nil.  */
-extern int coding_system_require_warning;
-
-/* Coding system for file names, or nil if none.  */
-extern Lisp_Object Vfile_name_coding_system;
-
-/* Coding system for file names used only when
-   Vfile_name_coding_system is nil.  */
-extern Lisp_Object Vdefault_file_name_coding_system;
-
 #endif
 
 /* Error signaled when there's a problem with detecting coding system */
 extern Lisp_Object Qcoding_system_error;
 
 extern char emacs_mule_bytes[256];
-extern int emacs_mule_string_char (unsigned char *);
 
 #endif /* EMACS_CODING_H */
-
-/* arch-tag: 2bc3b4fa-6870-4f64-8135-b962b2d290e4
-   (do not change this comment) */