Lines Matching refs:enc

173 #define MBCODE_START_POS(enc) \  argument
174 (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80)
176 #define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \ argument
177 add_code_range_to_buf(pbuf, MBCODE_START_POS(enc), ~((OnigCodePoint )0))
179 #define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) do {\ argument
180 if (! ONIGENC_IS_SINGLEBYTE(enc)) {\
181 r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\
274 strdup_with_null(OnigEncoding enc, UChar* s, UChar* end) in strdup_with_null() argument
280 term_len = ONIGENC_MBC_MINLEN(enc); in strdup_with_null()
301 p += ONIGENC_MBC_ENC_LEN(enc, p); \
304 c = ONIGENC_MBC_TO_CODE(enc, p, end); \
306 p += ONIGENC_MBC_ENC_LEN(enc, p); \
311 p += ONIGENC_MBC_ENC_LEN(enc, p); \
315 c = ONIGENC_MBC_TO_CODE(enc, p, end); \
316 p += ONIGENC_MBC_ENC_LEN(enc, p); \
320 #define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)
551 OnigEncoding enc; member
581 narg.enc = reg->enc; /* should be pattern encoding. */ in onig_foreach_name()
785 e->name = strdup_with_null(reg->enc, name, name_end); in name_add()
835 e->name = strdup_with_null(reg->enc, name, name_end); in name_add()
1492 str_node_split_last_char(StrNode* sn, OnigEncoding enc) in str_node_split_last_char() argument
1498 p = onigenc_get_prev_char_head(enc, sn->s, sn->end); in str_node_split_last_char()
1511 str_node_can_be_split(StrNode* sn, OnigEncoding enc) in str_node_can_be_split() argument
1514 return ((enclen(enc, sn->s) < sn->end - sn->s) ? 1 : 0); in str_node_can_be_split()
1538 onig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc) in onig_scan_unsigned_number() argument
1548 if (ONIGENC_IS_CODE_DIGIT(enc, c)) { in onig_scan_unsigned_number()
1566 OnigEncoding enc) in scan_unsigned_hexadecimal_number() argument
1576 if (ONIGENC_IS_CODE_XDIGIT(enc, c)) { in scan_unsigned_hexadecimal_number()
1577 val = (unsigned int )XDIGITVAL(enc,c); in scan_unsigned_hexadecimal_number()
1581 num = (num << 4) + XDIGITVAL(enc,c); in scan_unsigned_hexadecimal_number()
1594 OnigEncoding enc) in scan_unsigned_octal_number() argument
1604 if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8') { in scan_unsigned_octal_number()
1736 not_code_range_buf(OnigEncoding enc, BBuf* bbuf, BBuf** pbuf) in not_code_range_buf() argument
1744 return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); in not_code_range_buf()
1753 pre = MBCODE_START_POS(enc); in not_code_range_buf()
1778 or_code_range_buf(OnigEncoding enc, BBuf* bbuf1, int not1, in or_code_range_buf() argument
1788 return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); in or_code_range_buf()
1798 return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); in or_code_range_buf()
1805 return not_code_range_buf(enc, bbuf2, pbuf); in or_code_range_buf()
1821 r = not_code_range_buf(enc, bbuf2, pbuf); in or_code_range_buf()
1932 and_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc) in and_cclass() argument
1963 if (! ONIGENC_IS_SINGLEBYTE(enc)) { in and_cclass()
1965 r = or_code_range_buf(enc, buf1, 0, buf2, 0, &pbuf); in and_cclass()
1971 r = not_code_range_buf(enc, pbuf, &tbuf); in and_cclass()
1990 or_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc) in or_cclass() argument
2021 if (! ONIGENC_IS_SINGLEBYTE(enc)) { in or_cclass()
2026 r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf); in or_cclass()
2029 r = not_code_range_buf(enc, pbuf, &tbuf); in or_cclass()
2274 OnigEncoding enc = env->enc; in fetch_range_quantifier() local
2294 low = onig_scan_unsigned_number(&p, end, env->enc); in fetch_range_quantifier()
2313 up = onig_scan_unsigned_number(&p, end, env->enc); in fetch_range_quantifier()
2366 OnigEncoding enc = env->enc; in fetch_escaped_value() local
2462 OnigEncoding enc = env->enc; in fetch_name_with_level() local
2485 if (ONIGENC_IS_CODE_DIGIT(enc, c)) { in fetch_name_with_level()
2493 else if (!ONIGENC_IS_CODE_WORD(enc, c)) { in fetch_name_with_level()
2507 if (ONIGENC_IS_CODE_DIGIT(enc, c)) { in fetch_name_with_level()
2515 else if (!ONIGENC_IS_CODE_WORD(enc, c)) { in fetch_name_with_level()
2530 if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto err; in fetch_name_with_level()
2532 level = onig_scan_unsigned_number(&p, end, enc); in fetch_name_with_level()
2552 *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc); in fetch_name_with_level()
2581 OnigEncoding enc = env->enc; in fetch_name() local
2603 if (ONIGENC_IS_CODE_DIGIT(enc, c)) { in fetch_name()
2622 else if (!ONIGENC_IS_CODE_WORD(enc, c)) { in fetch_name()
2637 if (ONIGENC_IS_CODE_DIGIT(enc, c)) { in fetch_name()
2641 if (!ONIGENC_IS_CODE_WORD(enc, c)) in fetch_name()
2649 if (!ONIGENC_IS_CODE_WORD(enc, c)) { in fetch_name()
2661 *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc); in fetch_name()
2699 OnigEncoding enc = env->enc; in fetch_name() local
2722 if (ONIGENC_IS_CODE_DIGIT(enc, c)) { in fetch_name()
2740 if (! ONIGENC_IS_CODE_DIGIT(enc, c)) in fetch_name()
2749 *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc); in fetch_name()
2777 onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, in CC_ESC_WARN()
2791 onig_snprintf_with_pattern(buf, WARN_BUFSIZE, (env)->enc, in CLOSE_BRACKET_WITHOUT_ESC_WARN()
2800 UChar **next, OnigEncoding enc) in find_str_position() argument
2808 x = ONIGENC_MBC_TO_CODE(enc, p, to); in find_str_position()
2809 q = p + enclen(enc, p); in find_str_position()
2812 x = ONIGENC_MBC_TO_CODE(enc, q, to); in find_str_position()
2814 q += enclen(enc, q); in find_str_position()
2829 OnigCodePoint bad, OnigEncoding enc, OnigSyntaxType* syn) in str_exist_check_with_esc() argument
2840 p += enclen(enc, p); in str_exist_check_with_esc()
2843 x = ONIGENC_MBC_TO_CODE(enc, p, to); in str_exist_check_with_esc()
2844 q = p + enclen(enc, p); in str_exist_check_with_esc()
2847 x = ONIGENC_MBC_TO_CODE(enc, q, to); in str_exist_check_with_esc()
2849 q += enclen(enc, q); in str_exist_check_with_esc()
2852 p += enclen(enc, p); in str_exist_check_with_esc()
2855 x = ONIGENC_MBC_TO_CODE(enc, p, to); in str_exist_check_with_esc()
2871 OnigEncoding enc = env->enc; in fetch_token_in_cc() local
2974 num = scan_unsigned_octal_number(&p, end, 11, enc); in fetch_token_in_cc()
2978 if (ONIGENC_IS_CODE_DIGIT(enc, c2)) in fetch_token_in_cc()
2982 if (p > prev + enclen(enc, prev) && !PEND && (PPEEK_IS('}'))) { in fetch_token_in_cc()
3001 num = scan_unsigned_hexadecimal_number(&p, end, 8, enc); in fetch_token_in_cc()
3005 if (ONIGENC_IS_CODE_XDIGIT(enc, c2)) in fetch_token_in_cc()
3009 if (p > prev + enclen(enc, prev) && !PEND && (PPEEK_IS('}'))) { in fetch_token_in_cc()
3021 num = scan_unsigned_hexadecimal_number(&p, end, 2, enc); in fetch_token_in_cc()
3037 num = scan_unsigned_hexadecimal_number(&p, end, 4, enc); in fetch_token_in_cc()
3053 num = scan_unsigned_octal_number(&p, end, 3, enc); in fetch_token_in_cc()
3081 (OnigCodePoint )']', enc, syn)) { in fetch_token_in_cc()
3117 OnigEncoding enc = env->enc; in fetch_token() local
3342 num = scan_unsigned_octal_number(&p, end, 11, enc); in fetch_token()
3345 if (ONIGENC_IS_CODE_DIGIT(enc, PPEEK)) in fetch_token()
3349 if ((p > prev + enclen(enc, prev)) && !PEND && PPEEK_IS('}')) { in fetch_token()
3367 num = scan_unsigned_hexadecimal_number(&p, end, 8, enc); in fetch_token()
3370 if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK)) in fetch_token()
3374 if ((p > prev + enclen(enc, prev)) && !PEND && PPEEK_IS('}')) { in fetch_token()
3385 num = scan_unsigned_hexadecimal_number(&p, end, 2, enc); in fetch_token()
3401 num = scan_unsigned_hexadecimal_number(&p, end, 4, enc); in fetch_token()
3416 num = onig_scan_unsigned_number(&p, end, enc); in fetch_token()
3450 num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc); in fetch_token()
3600 SAFE_ENC_LEN(enc, tok->backp, end, len); in fetch_token()
3748 if (ONIGENC_IS_CODE_NEWLINE(enc, c)) in fetch_token()
3776 OnigEncoding enc ARG_UNUSED, in add_ctype_to_cc_by_range()
3852 OnigEncoding enc = env->enc; in add_ctype_to_cc() local
3854 r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sb_out, &ranges); in add_ctype_to_cc()
3856 return add_ctype_to_cc_by_range(cc, ctype, not, env->enc, sb_out, ranges); in add_ctype_to_cc()
3877 if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) in add_ctype_to_cc()
3880 ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); in add_ctype_to_cc()
3884 if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) in add_ctype_to_cc()
3894 if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) in add_ctype_to_cc()
3900 if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) in add_ctype_to_cc()
3903 ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); in add_ctype_to_cc()
3910 if (IS_CODE_SB_WORD(enc, c)) BITSET_SET_BIT(cc->bs, c); in add_ctype_to_cc()
3912 ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); in add_ctype_to_cc()
3916 if ((ONIGENC_CODE_TO_MBCLEN(enc, c) > 0) /* check invalid code point */ in add_ctype_to_cc()
3917 && ! ONIGENC_IS_CODE_WORD(enc, c)) in add_ctype_to_cc()
3958 OnigEncoding enc = env->enc; in parse_posix_bracket() local
3968 if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MIN_LEN + 3) in parse_posix_bracket()
3972 if (onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) { in parse_posix_bracket()
3973 p = (UChar* )onigenc_step(enc, p, end, pb->len); in parse_posix_bracket()
3974 if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0) in parse_posix_bracket()
4010 OnigEncoding enc = env->enc; in fetch_char_property_to_ctype() local
4020 r = ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, start, prev); in fetch_char_property_to_ctype()
4172 OnigEncoding enc = env->enc; in code_exist_check() local
4240 len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c); in parse_char_class()
4259 if (! ONIGENC_IS_SINGLEBYTE(env->enc) && tok->base != 0) { in parse_char_class()
4266 for (i = 1; i < ONIGENC_MBC_MAXLEN(env->enc); i++) { in parse_char_class()
4276 if (i < ONIGENC_MBC_MINLEN(env->enc)) { in parse_char_class()
4281 len = enclen(env->enc, buf); in parse_char_class()
4299 v = ONIGENC_MBC_TO_CODE(env->enc, buf, bufe); in parse_char_class()
4316 len = ONIGENC_CODE_TO_MBCLEN(env->enc, v); in parse_char_class()
4427 r = or_cclass(cc, acc, env->enc); in parse_char_class()
4447 r = and_cclass(prev_cc, cc, env->enc); in parse_char_class()
4484 r = and_cclass(prev_cc, cc, env->enc); in parse_char_class()
4505 if (ONIGENC_IS_CODE_NEWLINE(env->enc, NEWLINE_CODE)) { in parse_char_class()
4506 if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1) in parse_char_class()
4534 OnigEncoding enc = env->enc; in parse_enclose() local
4797 if (str_node_can_be_split(sn, env->enc)) { in set_quantifier()
4798 Node* n = str_node_split_last_char(sn, env->enc); in set_quantifier()
4825 onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, in set_quantifier()
4835 onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, in set_quantifier()
4876 clear_not_flag_cclass(CClassNode* cc, OnigEncoding enc) in clear_not_flag_cclass() argument
4884 if (! ONIGENC_IS_SINGLEBYTE(enc)) { in clear_not_flag_cclass()
4885 r = not_code_range_buf(enc, cc->mbuf, &tbuf); in clear_not_flag_cclass()
4921 int is_in = onig_is_code_in_cc(env->enc, from, cc); in i_apply_case_fold()
4925 if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) { in i_apply_case_fold()
4934 if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) { in i_apply_case_fold()
4935 if (IS_NCCLASS_NOT(cc)) clear_not_flag_cclass(cc, env->enc); in i_apply_case_fold()
4953 if (onig_is_code_in_cc(env->enc, from, cc) in i_apply_case_fold()
4959 len = ONIGENC_CODE_TO_MBC(env->enc, to[i], buf); in i_apply_case_fold()
5064 if (len >= ONIGENC_MBC_MINLEN(env->enc)) { in parse_exp()
5065 if (len == enclen(env->enc, NSTR(*np)->s)) {//should not enclen_end() in parse_exp()
5078 if (len < ONIGENC_MBC_MINLEN(env->enc)) { in parse_exp()
5079 rem = ONIGENC_MBC_MINLEN(env->enc) - len; in parse_exp()
5081 if (len + rem == enclen(env->enc, NSTR(*np)->s)) { in parse_exp()
5101 int num = ONIGENC_CODE_TO_MBC(env->enc, tok->u.code, buf); in parse_exp()
5120 qend = find_str_position(end_op, 2, qstart, end, &nextp, env->enc); in parse_exp()
5180 r = ONIGENC_APPLY_ALL_CASE_FOLD(env->enc, env->case_fold_flag, in parse_exp()
5446 env->enc = reg->enc; in onig_parse_make_tree()
5454 if (! ONIGENC_IS_VALID_MBC_STRING(env->enc, pattern, end)) in onig_parse_make_tree()