2007-12-22 00:38:33 -05:00
|
|
|
#include "regenc.h"
|
2015-09-15 01:49:52 -04:00
|
|
|
#include "encindex.h"
|
|
|
|
#ifndef ENCINDEX_US_ASCII
|
|
|
|
#define ENCINDEX_US_ASCII 0
|
|
|
|
#endif
|
2007-12-22 00:38:33 -05:00
|
|
|
|
2008-10-24 15:00:35 -04:00
|
|
|
static int
|
2008-01-02 15:06:58 -05:00
|
|
|
us_ascii_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
|
2007-12-22 00:38:33 -05:00
|
|
|
{
|
2014-09-15 12:18:41 -04:00
|
|
|
if (*p & 0x80)
|
|
|
|
return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
|
|
|
|
return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
|
2007-12-22 00:38:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
OnigEncodingDefine(us_ascii, US_ASCII) = {
|
2008-01-02 15:06:58 -05:00
|
|
|
us_ascii_mbc_enc_len,
|
2007-12-22 00:38:33 -05:00
|
|
|
"US-ASCII",/* name */
|
|
|
|
1, /* max byte length */
|
|
|
|
1, /* min byte length */
|
|
|
|
onigenc_is_mbc_newline_0x0a,
|
|
|
|
onigenc_single_byte_mbc_to_code,
|
|
|
|
onigenc_single_byte_code_to_mbclen,
|
|
|
|
onigenc_single_byte_code_to_mbc,
|
|
|
|
onigenc_ascii_mbc_case_fold,
|
|
|
|
onigenc_ascii_apply_all_case_fold,
|
|
|
|
onigenc_ascii_get_case_fold_codes_by_str,
|
|
|
|
onigenc_minimum_property_name_to_ctype,
|
|
|
|
onigenc_ascii_is_code_ctype,
|
|
|
|
onigenc_not_support_get_ctype_code_range,
|
|
|
|
onigenc_single_byte_left_adjust_char_head,
|
2012-02-17 02:42:23 -05:00
|
|
|
onigenc_always_true_is_allowed_reverse_match,
|
2015-09-15 01:49:52 -04:00
|
|
|
ENCINDEX_US_ASCII,
|
2012-02-17 02:42:23 -05:00
|
|
|
ONIGENC_FLAG_NONE,
|
* regenc.h/c: Rename onigenc_not_support_case_map to
onigenc_ascii_only_case_map.
* regenc.h: Add definition of onigenc_single_byte_ascii_only_case_map.
* enc/iso_8859_X.c, windows_125X.c, ascii.c, us-ascii.c, koi8_x.c:
Replace onigenc_not_support_case_map by
onigenc_single_byte_ascii_only_case_map.
* enc/big5.c, cp949.c, emacs_mule.c, euc_X.c, gbX.c, shift_jis.c,
windows_31j.c: Replace onigenc_not_support_case_map by
onigenc_ascii_only_case_map.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07 02:05:18 -04:00
|
|
|
onigenc_single_byte_ascii_only_case_map,
|
2007-12-22 00:38:33 -05:00
|
|
|
};
|
2008-07-01 04:39:10 -04:00
|
|
|
ENC_ALIAS("ASCII", "US-ASCII")
|
|
|
|
ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII")
|
|
|
|
ENC_ALIAS("646", "US-ASCII")
|