X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/02dfeba8a4ce93dadd7f5fa7f462fca12fdf28f8..8510724d46951d651a78424e12b93ccee100c665:/src/coding.h diff --git a/src/coding.h b/src/coding.h index eba7727330..544dd44bb9 100644 --- a/src/coding.h +++ b/src/coding.h @@ -1,8 +1,8 @@ /* Header for coding system handler. Copyright (C) 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 + 2005, 2006, 2007, 2008, 2009 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H14PRO021 Copyright (C) 2003 @@ -11,10 +11,10 @@ This file is part of GNU Emacs. -GNU Emacs is free software; you can redistribute it and/or modify +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, 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 @@ -22,9 +22,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GNU Emacs. If not, see . */ #ifndef EMACS_CODING_H #define EMACS_CODING_H @@ -58,6 +56,12 @@ enum define_coding_iso2022_arg_index coding_arg_iso2022_max }; +enum define_coding_utf8_arg_index + { + coding_arg_utf8_bom = coding_arg_max, + coding_arg_utf8_max + }; + enum define_coding_utf16_arg_index { coding_arg_utf16_bom = coding_arg_max, @@ -150,7 +154,7 @@ enum coding_attr_index coding_attr_iso_request, coding_attr_iso_flags, - coding_attr_utf_16_bom, + coding_attr_utf_bom, coding_attr_utf_16_endian, coding_attr_emacs_mule_full, @@ -161,23 +165,23 @@ enum coding_attr_index /* Macros to access an element of an attribute vector. */ -#define CODING_ATTR_BASE_NAME(attrs) ASLOT (attrs, coding_attr_base_name) -#define CODING_ATTR_TYPE(attrs) ASLOT (attrs, coding_attr_type) -#define CODING_ATTR_CHARSET_LIST(attrs) ASLOT (attrs, coding_attr_charset_list) -#define CODING_ATTR_MNEMONIC(attrs) ASLOT (attrs, coding_attr_mnemonic) -#define CODING_ATTR_DOCSTRING(attrs) ASLOT (attrs, coding_attr_docstring) -#define CODING_ATTR_ASCII_COMPAT(attrs) ASLOT (attrs, coding_attr_ascii_compat) -#define CODING_ATTR_DECODE_TBL(attrs) ASLOT (attrs, coding_attr_decode_tbl) -#define CODING_ATTR_ENCODE_TBL(attrs) ASLOT (attrs, coding_attr_encode_tbl) -#define CODING_ATTR_TRANS_TBL(attrs) ASLOT (attrs, coding_attr_trans_tbl) -#define CODING_ATTR_POST_READ(attrs) ASLOT (attrs, coding_attr_post_read) -#define CODING_ATTR_PRE_WRITE(attrs) ASLOT (attrs, coding_attr_pre_write) -#define CODING_ATTR_DEFAULT_CHAR(attrs) ASLOT (attrs, coding_attr_default_char) -#define CODING_ATTR_FOR_UNIBYTE(attrs) ASLOT (attrs, coding_attr_for_unibyte) -#define CODING_ATTR_FLUSHING(attrs) ASLOT (attrs, coding_attr_flushing) -#define CODING_ATTR_PLIST(attrs) ASLOT (attrs, coding_attr_plist) -#define CODING_ATTR_CATEGORY(attrs) ASLOT (attrs, coding_attr_category) -#define CODING_ATTR_SAFE_CHARSETS(attrs)ASLOT (attrs, coding_attr_safe_charsets) +#define CODING_ATTR_BASE_NAME(attrs) AREF (attrs, coding_attr_base_name) +#define CODING_ATTR_TYPE(attrs) AREF (attrs, coding_attr_type) +#define CODING_ATTR_CHARSET_LIST(attrs) AREF (attrs, coding_attr_charset_list) +#define CODING_ATTR_MNEMONIC(attrs) AREF (attrs, coding_attr_mnemonic) +#define CODING_ATTR_DOCSTRING(attrs) AREF (attrs, coding_attr_docstring) +#define CODING_ATTR_ASCII_COMPAT(attrs) AREF (attrs, coding_attr_ascii_compat) +#define CODING_ATTR_DECODE_TBL(attrs) AREF (attrs, coding_attr_decode_tbl) +#define CODING_ATTR_ENCODE_TBL(attrs) AREF (attrs, coding_attr_encode_tbl) +#define CODING_ATTR_TRANS_TBL(attrs) AREF (attrs, coding_attr_trans_tbl) +#define CODING_ATTR_POST_READ(attrs) AREF (attrs, coding_attr_post_read) +#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) /* Return the name of a coding system specified by ID. */ @@ -327,11 +331,11 @@ struct iso_2022_spec struct ccl_spec; -enum utf_16_bom_type +enum utf_bom_type { - utf_16_detect_bom, - utf_16_without_bom, - utf_16_with_bom + utf_detect_bom, + utf_without_bom, + utf_with_bom }; enum utf_16_endian_type @@ -342,7 +346,7 @@ enum utf_16_endian_type struct utf_16_spec { - enum utf_16_bom_type bom; + enum utf_bom_type bom; enum utf_16_endian_type endian; int surrogate; }; @@ -382,6 +386,7 @@ struct coding_system struct iso_2022_spec iso_2022; struct ccl_spec *ccl; /* Defined in ccl.h. */ struct utf_16_spec utf_16; + enum utf_bom_type utf_8_bom; int emacs_mule_full_support; } spec; @@ -645,6 +650,7 @@ extern int decoding_buffer_size P_ ((struct coding_system *, int)); extern int encoding_buffer_size P_ ((struct coding_system *, int)); extern void setup_coding_system P_ ((Lisp_Object, struct coding_system *)); extern Lisp_Object coding_charset_list P_ ((struct coding_system *)); +extern Lisp_Object coding_system_charset_list P_ ((Lisp_Object)); extern void detect_coding P_ ((struct coding_system *)); extern Lisp_Object code_convert_region P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object,