]> code.delx.au - gnu-emacs/blobdiff - src/coding.h
Add a note how to use `tramp-own-remote-path'
[gnu-emacs] / src / coding.h
index a2f9cbc578fcf563fdf1997843f24f236c76577e..426be6277cabbb790cc5590677a3338884b3896e 100644 (file)
@@ -1,5 +1,5 @@
 /* Header for coding system handler.
-   Copyright (C) 2001-2015 Free Software Foundation, Inc.
+   Copyright (C) 2001-2016 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)
@@ -12,8 +12,8 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,6 +26,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifndef EMACS_CODING_H
 #define EMACS_CODING_H
 
+#include "lisp.h"
+
 /* Index to arguments of Fdefine_coding_system_internal.  */
 
 enum define_coding_system_arg_index
@@ -434,11 +436,37 @@ struct coding_system
 
   /* Flag bits of the coding system.  The meaning of each bit is common
      to all types of coding systems.  */
-  int common_flags;
+  unsigned common_flags : 14;
 
   /* Mode bits of the coding system.  See the comments of the macros
      CODING_MODE_XXX.  */
-  unsigned int mode;
+  unsigned mode : 5;
+
+  /* The following two members specify how binary 8-bit code 128..255
+     are represented in source and destination text respectively.  True
+     means they are represented by 2-byte sequence, false means they are
+     represented by 1-byte as is (see the comment in character.h).  */
+  bool_bf src_multibyte : 1;
+  bool_bf dst_multibyte : 1;
+
+  /* True if the source of conversion is not in the member
+     `charbuf', but at `src_object'.  */
+  bool_bf chars_at_source : 1;
+
+  /* Nonzero if the result of conversion is in `destination'
+     buffer rather than in `dst_object'.  */
+  bool_bf raw_destination : 1;
+
+  /* Set to true if charbuf contains an annotation.  */
+  bool_bf annotated : 1;
+
+  /* Used internally in coding.c.  See the comment of detect_ascii.  */
+  unsigned eol_seen : 3;
+
+  /* Finish status of code conversion.  */
+  ENUM_BF (coding_result_code) result : 3;
+
+  int max_charset_id;
 
   /* Detailed information specific to each type of coding system.  */
   union
@@ -451,16 +479,8 @@ struct coding_system
       struct undecided_spec undecided;
     } spec;
 
-  int max_charset_id;
   unsigned char *safe_charsets;
 
-  /* The following two members specify how binary 8-bit code 128..255
-     are represented in source and destination text respectively.  True
-     means they are represented by 2-byte sequence, false means they are
-     represented by 1-byte as is (see the comment in character.h).  */
-  bool_bf src_multibyte : 1;
-  bool_bf dst_multibyte : 1;
-
   /* 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
@@ -472,21 +492,9 @@ struct coding_system
      sequence.  Set by detect_coding_utf_8.  */
   ptrdiff_t detected_utf8_bytes, detected_utf8_chars;
 
-  /* 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;
 
-  /* Number of error source data found in a decoding routine.  */
-  ptrdiff_t errors;
-
-  /* Store the positions of error source data.  */
-  ptrdiff_t *error_positions;
-
-  /* Finish status of code conversion.  */
-  enum coding_result_code result;
-
   ptrdiff_t src_pos, src_pos_byte, src_chars, src_bytes;
   Lisp_Object src_object;
   const unsigned char *source;
@@ -510,17 +518,6 @@ struct coding_system
   int *charbuf;
   int charbuf_size, charbuf_used;
 
-  /* True if the source of conversion is not in the member
-     `charbuf', but at `src_object'.  */
-  bool_bf chars_at_source : 1;
-
-  /* Nonzero if the result of conversion is in `destination'
-     buffer rather than in `dst_object'.  */
-  bool_bf raw_destination : 1;
-
-  /* Set to true if charbuf contains an annotation.  */
-  bool_bf annotated : 1;
-
   unsigned char carryover[64];
   int carryover_bytes;
 
@@ -710,6 +707,7 @@ extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
 extern Lisp_Object encode_file_name (Lisp_Object);
 extern Lisp_Object decode_file_name (Lisp_Object);
 extern Lisp_Object raw_text_coding_system (Lisp_Object);
+extern bool raw_text_coding_system_p (struct coding_system *);
 extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object);
 extern Lisp_Object complement_process_encoding_system (Lisp_Object);
 
@@ -743,7 +741,7 @@ extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf);
 extern Lisp_Object from_unicode (Lisp_Object str);
 
 /* Convert WSTR to an Emacs string.  */
-extern Lisp_Object from_unicode_buffer (const wchar_twstr);
+extern Lisp_Object from_unicode_buffer (const wchar_t *wstr);
 
 #endif /* WINDOWSNT || CYGWIN */
 
@@ -768,25 +766,7 @@ extern Lisp_Object from_unicode_buffer (const wchar_t* wstr);
 extern Lisp_Object preferred_coding_system (void);
 
 
-extern Lisp_Object Qutf_8, Qutf_8_emacs;
-
-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 Qbuffer_file_coding_system;
-
-extern Lisp_Object Qunix, Qdos;
-
-extern Lisp_Object Qtranslation_table;
-extern Lisp_Object Qtranslation_table_id;
-
 #ifdef emacs
-extern Lisp_Object Qfile_coding_system;
-extern Lisp_Object Qcall_process, Qcall_process_region;
-extern Lisp_Object Qstart_process, Qopen_network_stream;
-extern Lisp_Object Qwrite_region;
-
-extern char *emacs_strerror (int);
 
 /* Coding system to be used to encode text for terminal display when
    terminal coding system is nil.  */
@@ -794,9 +774,6 @@ extern struct coding_system safe_terminal_coding;
 
 #endif
 
-/* Error signaled when there's a problem with detecting coding system */
-extern Lisp_Object Qcoding_system_error;
-
 extern char emacs_mule_bytes[256];
 
 #endif /* EMACS_CODING_H */