Debian Codegraph @

vendor/onigmo-source/enc/us_ascii.c

raw
1 #include "regenc.h"
2 #ifdef RUBY
3 # include "encindex.h"
4 #endif
5
6 #ifndef ENCINDEX_US_ASCII
7 # define ENCINDEX_US_ASCII 0
8 #endif
9
10 static int
11 us_ascii_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
12 {
13 if (*p & 0x80)
14 return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
15 return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
16 }
17
18 OnigEncodingDefine(us_ascii, US_ASCII) = {
19 us_ascii_mbc_enc_len,
20 "US-ASCII",/* name */
21 1, /* max byte length */
22 1, /* min byte length */
23 onigenc_is_mbc_newline_0x0a,
24 onigenc_single_byte_mbc_to_code,
25 onigenc_single_byte_code_to_mbclen,
26 onigenc_single_byte_code_to_mbc,
27 onigenc_ascii_mbc_case_fold,
28 onigenc_ascii_apply_all_case_fold,
29 onigenc_ascii_get_case_fold_codes_by_str,
30 onigenc_minimum_property_name_to_ctype,
31 onigenc_ascii_is_code_ctype,
32 onigenc_not_support_get_ctype_code_range,
33 onigenc_single_byte_left_adjust_char_head,
34 onigenc_always_true_is_allowed_reverse_match,
35 onigenc_single_byte_ascii_only_case_map,
36 ENCINDEX_US_ASCII,
37 ONIGENC_FLAG_NONE,
38 };
39 ENC_ALIAS("ASCII", "US-ASCII")
40 ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII")
41 ENC_ALIAS("646", "US-ASCII")