Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/re.h"
#include "encindex.h"
#include "probes.h"
#include "gc.h"
#include "ruby_assert.h"
#include "id.h"
#include <math.h>
#include <ctype.h>
#include "missing/crypt.h"
Go to the source code of this file.
Data Structures | |
struct | mapping_buffer |
struct | tr |
Macros | |
#define | BEG(no) (regs->beg[(no)]) |
#define | END(no) (regs->end[(no)]) |
#define | HAVE_CRYPT_R 1 |
#define | STRING_ENUMERATORS_WANTARRAY 0 /* next major */ |
#define | RUBY_MAX_CHAR_LEN 16 |
#define | STR_IS_SHARED_M FL_USER6 |
#define | STR_TMPLOCK FL_USER7 |
#define | STR_NOFREE FL_USER18 |
#define | STR_FAKESTR FL_USER19 |
#define | STR_SET_NOEMBED(str) |
#define | STR_SET_EMBED(str) FL_UNSET((str), (STR_NOEMBED|STR_NOFREE)) |
#define | STR_SET_EMBED_LEN(str, n) |
#define | STR_SET_LEN(str, n) |
#define | STR_DEC_LEN(str) |
#define | TERM_LEN(str) rb_enc_mbminlen(rb_enc_get(str)) |
#define | TERM_FILL(ptr, termlen) |
#define | RESIZE_CAPA(str, capacity) |
#define | RESIZE_CAPA_TERM(str, capacity, termlen) |
#define | STR_SET_SHARED(str, shared_str) |
#define | STR_HEAP_PTR(str) (RSTRING(str)->as.heap.ptr) |
#define | STR_HEAP_SIZE(str) ((size_t)RSTRING(str)->as.heap.aux.capa + TERM_LEN(str)) |
#define | STR_ENC_GET(str) get_encoding(str) |
#define | SHARABLE_MIDDLE_SUBSTRING 0 |
#define | SHARABLE_SUBSTRING_P(beg, len, end) ((beg) + (len) == (end)) |
#define | STR_EMBEDDABLE_P(len, termlen) ((len) <= RSTRING_EMBED_LEN_MAX + 1 - (termlen)) |
#define | BARE_STRING_P(str) (!FL_ANY_RAW(str, FL_TAINT|FL_EXIVAR) && RBASIC_CLASS(str) == rb_cString) |
#define | STR_BUF_MIN_SIZE 127 |
#define | rb_str_dup_frozen rb_str_new_frozen |
#define | str_buf_cat2(str, ptr) str_buf_cat((str), (ptr), strlen(ptr)) |
#define | lesser(a, b) (((a)>(b))?(b):(a)) |
#define | rb_str_index(str, sub, offset) rb_strseq_index(str, sub, offset, 0) |
#define | rb_str_splice(str, beg, len, val) rb_str_update(str, beg, len, val) |
#define | CHAR_ESC_LEN 13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */ |
#define | IS_EVSTR(p, e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{')) |
#define | CASE_MAPPING_ADDITIONAL_LENGTH 20 |
#define | CASEMAP_DEBUG 0 |
#define | CHECK_IF_ASCII(c) |
#define | TR_TABLE_SIZE 257 |
#define | ascii_isspace(c) isspacetable[(unsigned char)(c)] |
#define | DEFAULT_REPLACE_CHAR(str) |
#define | sym_equal rb_obj_equal |
#define | rb_intern(str) rb_intern_const(str) |
Typedefs | |
typedef struct mapping_buffer | mapping_buffer |
typedef unsigned char * | USTR |
Enumerations | |
enum | neighbor_char { NEIGHBOR_NOT_CHAR, NEIGHBOR_FOUND, NEIGHBOR_WRAPPED } |
Variables | |
VALUE | rb_cString |
VALUE | rb_cSymbol |
static VALUE | sym_ascii |
static VALUE | sym_turkic |
static VALUE | sym_lithuanian |
static VALUE | sym_fold |
const struct st_hash_type | rb_fstring_hash_type |
VALUE | rb_fs |
static const char | isspacetable [256] |
#define ascii_isspace | ( | c | ) | isspacetable[(unsigned char)(c)] |
Definition at line 7187 of file string.c.
Referenced by lstrip_offset(), rb_str_split_m(), and rstrip_offset().
#define BARE_STRING_P | ( | str | ) | (!FL_ANY_RAW(str, FL_TAINT|FL_EXIVAR) && RBASIC_CLASS(str) == rb_cString) |
Definition at line 258 of file string.c.
Referenced by fstr_update_callback(), and rb_fstring().
#define BEG | ( | no | ) | (regs->beg[(no)]) |
Definition at line 22 of file string.c.
Referenced by rb_str_split_m(), rb_str_sub_bang(), rb_str_subpat_set(), scan_once(), and str_gsub().
#define CASE_MAPPING_ADDITIONAL_LENGTH 20 |
Definition at line 5969 of file string.c.
Referenced by rb_str_casemap().
#define CASEMAP_DEBUG 0 |
Definition at line 5971 of file string.c.
Referenced by rb_str_ascii_casemap(), and rb_str_casemap().
#define CHAR_ESC_LEN 13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */ |
Definition at line 5552 of file string.c.
Referenced by rb_str_buf_cat_escaped_char(), rb_str_escape(), and rb_str_inspect().
#define CHECK_IF_ASCII | ( | c | ) |
Referenced by tr_trans().
#define DEFAULT_REPLACE_CHAR | ( | str | ) |
Referenced by enc_str_scrub().
#define END | ( | no | ) | (regs->end[(no)]) |
Definition at line 23 of file string.c.
Referenced by rb_str_split_m(), rb_str_sub_bang(), rb_str_subpat_set(), scan_once(), and str_gsub().
#define IS_EVSTR | ( | p, | |
e | |||
) | ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{')) |
Definition at line 5758 of file string.c.
Referenced by rb_str_dump().
#define lesser | ( | a, | |
b | |||
) | (((a)>(b))?(b):(a)) |
Definition at line 3022 of file string.c.
Referenced by rb_str_cmp().
#define rb_intern | ( | str | ) | rb_intern_const(str) |
Referenced by Init_String(), and rb_str_match_m().
#define rb_str_dup_frozen rb_str_new_frozen |
#define rb_str_index | ( | str, | |
sub, | |||
offset | |||
) | rb_strseq_index(str, sub, offset, 0) |
Definition at line 3283 of file string.c.
Referenced by rb_str_aref(), rb_str_aset(), rb_str_include(), rb_str_index_m(), and rb_str_partition().
#define rb_str_splice | ( | str, | |
beg, | |||
len, | |||
val | |||
) | rb_str_update(str, beg, len, val) |
Definition at line 4440 of file string.c.
Referenced by rb_str_aset(), rb_str_aset_m(), and rb_str_insert().
#define RESIZE_CAPA | ( | str, | |
capacity | |||
) |
Definition at line 128 of file string.c.
Referenced by rb_str_splice_0(), rb_str_sub_bang(), and str_succ().
#define RESIZE_CAPA_TERM | ( | str, | |
capacity, | |||
termlen | |||
) |
Definition at line 132 of file string.c.
Referenced by rb_str_modify_expand(), and str_buf_cat().
#define RUBY_MAX_CHAR_LEN 16 |
Definition at line 82 of file string.c.
Referenced by rb_str_to_s().
Definition at line 169 of file string.c.
Referenced by rb_str_subseq(), str_byte_substr(), and str_substr().
#define str_buf_cat2 | ( | str, | |
ptr | |||
) | str_buf_cat((str), (ptr), strlen(ptr)) |
Definition at line 2661 of file string.c.
Referenced by rb_str_inspect().
#define STR_BUF_MIN_SIZE 127 |
Definition at line 1244 of file string.c.
Referenced by rb_str_buf_new(), and rb_str_init().
#define STR_DEC_LEN | ( | str | ) |
#define STR_EMBEDDABLE_P | ( | len, | |
termlen | |||
) | ((len) <= RSTRING_EMBED_LEN_MAX + 1 - (termlen)) |
Definition at line 174 of file string.c.
Referenced by rb_str_drop_bytes(), rb_str_resize(), rb_str_setbyte(), rb_str_subseq(), str_byte_substr(), str_make_independent_expand(), str_new0(), str_new_frozen(), str_replace_shared_without_enc(), str_shared_replace(), and str_substr().
#define STR_ENC_GET | ( | str | ) | get_encoding(str) |
Definition at line 163 of file string.c.
Referenced by chopped_length(), mustnot_broken(), mustnot_wchar(), rb_enc_cr_str_copy_for_substr(), rb_enc_str_asciionly_p(), rb_enc_str_scrub(), rb_str_capitalize_bang(), rb_str_clear(), rb_str_concat(), rb_str_conv_enc_opts(), rb_str_downcase_bang(), rb_str_enumerate_codepoints(), rb_str_export(), rb_str_export_locale(), rb_str_export_to_enc(), rb_str_include_range_p(), rb_str_justify(), rb_str_lstrip(), rb_str_lstrip_bang(), rb_str_offset(), rb_str_ord(), rb_str_quote_unprintable(), rb_str_reverse(), rb_str_rindex_m(), rb_str_rstrip(), rb_str_rstrip_bang(), rb_str_scrub(), rb_str_setbyte(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_strip(), rb_str_strip_bang(), rb_str_sub_bang(), rb_str_sublen(), rb_str_subpos(), rb_str_swapcase_bang(), rb_str_symname_p(), rb_str_upcase_bang(), scan_once(), single_byte_optimizable(), str_byte_substr(), str_compat_and_valid(), str_gsub(), str_shared_replace(), str_strlen(), str_succ(), and sym_inspect().
#define STR_FAKESTR FL_USER19 |
Definition at line 86 of file string.c.
Referenced by fstr_update_callback(), register_fstring(), and setup_fake_str().
#define STR_HEAP_PTR | ( | str | ) | (RSTRING(str)->as.heap.ptr) |
Definition at line 160 of file string.c.
Referenced by rb_str_free(), rb_str_resize(), str_discard(), and tr_trans().
Definition at line 161 of file string.c.
Referenced by rb_str_free(), rb_str_init(), rb_str_memsize(), str_discard(), and tr_trans().
#define STR_IS_SHARED_M FL_USER6 |
Definition at line 83 of file string.c.
Referenced by rb_str_tmp_frozen_release(), and str_new_frozen().
#define STR_NOFREE FL_USER18 |
Definition at line 85 of file string.c.
Referenced by rb_str_drop_bytes(), rb_str_free(), rb_str_memsize(), rb_str_tmp_frozen_release(), setup_fake_str(), str_capacity(), str_dependent_p(), str_discard(), str_make_independent_expand(), str_new_frozen(), and str_new_static().
#define STR_SET_EMBED | ( | str | ) | FL_UNSET((str), (STR_NOEMBED|STR_NOFREE)) |
Definition at line 92 of file string.c.
Referenced by rb_str_clear(), rb_str_drop_bytes(), rb_str_resize(), str_make_independent_expand(), str_new_frozen(), str_replace_shared_without_enc(), and str_shared_replace().
#define STR_SET_EMBED_LEN | ( | str, | |
n | |||
) |
Definition at line 93 of file string.c.
Referenced by rb_str_clear(), rb_str_drop_bytes(), rb_str_resize(), str_make_independent_expand(), str_new_frozen(), str_replace_shared_without_enc(), and str_shared_replace().
#define STR_SET_LEN | ( | str, | |
n | |||
) |
Definition at line 99 of file string.c.
Referenced by rb_str_cat_conv_enc_opts(), rb_str_chomp_string(), rb_str_chop_bang(), rb_str_delete_bang(), rb_str_justify(), rb_str_lstrip_bang(), rb_str_reverse(), rb_str_rstrip_bang(), rb_str_set_len(), rb_str_splice_0(), rb_str_squeeze_bang(), rb_str_strip_bang(), rb_str_sub_bang(), rb_str_times(), str_buf_cat(), str_new0(), and str_succ().
#define STR_SET_NOEMBED | ( | str | ) |
Definition at line 88 of file string.c.
Referenced by str_make_independent_expand(), str_new0(), str_new_frozen(), str_new_static(), str_replace(), str_shared_replace(), and tr_trans().
#define STR_SET_SHARED | ( | str, | |
shared_str | |||
) |
Definition at line 151 of file string.c.
Referenced by str_new_frozen(), str_replace(), str_replace_shared_without_enc(), and str_shared_replace().
#define STR_TMPLOCK FL_USER7 |
Definition at line 84 of file string.c.
Referenced by rb_check_lockedtmp(), rb_str_tmp_frozen_release(), rb_str_unlocktmp(), and RUBY_ALIAS_FUNCTION().
#define sym_equal rb_obj_equal |
Definition at line 9581 of file string.c.
Referenced by Init_String().
#define TERM_FILL | ( | ptr, | |
termlen | |||
) |
Definition at line 120 of file string.c.
Referenced by rb_str_change_terminator_length(), rb_str_chomp_string(), rb_str_chop_bang(), rb_str_delete_bang(), rb_str_init(), rb_str_justify(), rb_str_lstrip_bang(), rb_str_plus(), rb_str_resize(), rb_str_rstrip_bang(), rb_str_set_len(), rb_str_splice_0(), rb_str_squeeze_bang(), rb_str_strip_bang(), rb_str_sub_bang(), rb_str_times(), str_buf_cat(), str_fill_term(), str_make_independent_expand(), str_new0(), str_new_frozen(), str_replace_shared_without_enc(), str_succ(), and tr_trans().
#define TERM_LEN | ( | str | ) | rb_enc_mbminlen(rb_enc_get(str)) |
Definition at line 119 of file string.c.
Referenced by rb_str_capacity(), rb_str_chomp_string(), rb_str_chop_bang(), rb_str_delete_bang(), rb_str_drop_bytes(), rb_str_modify_expand(), rb_str_new_with_class(), rb_str_resize(), rb_str_set_len(), rb_str_splice_0(), rb_str_squeeze_bang(), rb_str_sub_bang(), rb_str_subseq(), rb_str_times(), str_buf_cat(), str_byte_substr(), str_make_independent(), str_new_frozen(), str_replace_shared_without_enc(), and str_substr().
#define TR_TABLE_SIZE 257 |
Definition at line 6736 of file string.c.
Referenced by rb_str_count(), rb_str_delete_bang(), and rb_str_squeeze_bang().
typedef struct mapping_buffer mapping_buffer |
enum neighbor_char |
|
static |
Definition at line 4004 of file string.c.
References ISDIGIT, and str_upto_each().
Referenced by rb_str_include_range_p(), and str_upto_each().
|
static |
Definition at line 5929 of file string.c.
References ONIGENC_CASE_ASCII_ONLY, ONIGENC_CASE_DOWNCASE, ONIGENC_CASE_FOLD, ONIGENC_CASE_FOLD_LITHUANIAN, ONIGENC_CASE_FOLD_TURKISH_AZERI, ONIGENC_CASE_UPCASE, rb_eArgError, rb_raise(), sym_ascii, sym_fold, sym_lithuanian, and sym_turkic.
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), rb_str_swapcase_bang(), and rb_str_upcase_bang().
|
static |
Definition at line 7460 of file string.c.
References NULL, rb_enc_ascget(), rb_enc_is_newline, and rb_enc_prev_char.
Referenced by rb_str_enumerate_lines().
Definition at line 8122 of file string.c.
References NIL_P, rb_check_arity, rb_rs, and StringValue.
Referenced by rb_str_chomp(), and rb_str_chomp_bang().
Definition at line 8023 of file string.c.
References is_broken_string, len, memcmp(), rb_default_rs, rb_enc_ascget(), rb_enc_check(), rb_enc_get(), rb_enc_is_newline, rb_enc_left_char_head, rb_enc_mbminlen, RB_GC_GUARD, RSTRING_GETMEM, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_str_chomp(), and rb_str_chomp_string().
|
static |
Definition at line 7954 of file string.c.
References rb_enc_ascget(), rb_enc_prev_char, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
Referenced by rb_str_chop(), and rb_str_chop_bang().
|
static |
Definition at line 497 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_VALID, len, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_ascii8bit_encindex(), rb_enc_asciicompat, rb_enc_precise_mbclen(), rb_enc_to_index(), and search_nonascii().
Referenced by rb_enc_str_coderange(), rb_str_sub_bang(), and RUBY_ALIAS_FUNCTION().
Definition at line 695 of file string.c.
References RUBY_DTRACE_CREATE_HOOK, str_alloc(), and STRING.
Referenced by Init_String().
|
static |
Definition at line 3737 of file string.c.
References MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, NEIGHBOR_FOUND, NEIGHBOR_NOT_CHAR, NEIGHBOR_WRAPPED, rb_enc_code_to_mbclen, rb_enc_mbc_to_codepoint, rb_enc_mbcput, rb_enc_mbminlen, and rb_enc_precise_mbclen().
Referenced by enc_succ_alnum_char().
|
static |
Definition at line 9251 of file string.c.
References buf, DEFAULT_REPLACE_CHAR, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAN_P, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, ENCINDEX_UTF_16BE, ENCINDEX_UTF_16LE, ENCINDEX_UTF_32BE, ENCINDEX_UTF_32LE, ENCODING_CODERANGE_SET, FALSE, FL_SET_RAW, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, MBCLEN_NEEDMORE_P, NIL_P, NULL, OBJ_TAINTED_RAW, Qnil, rb_block_given_p(), rb_eArgError, rb_enc_asciicompat, rb_enc_dummy_p(), rb_enc_mbmaxlen, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_enc_to_index(), rb_raise(), rb_str_buf_cat(), rb_str_buf_new(), rb_utf8_encindex(), rb_yield(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, search_nonascii(), str_compat_and_valid(), TRUE, and UNREACHABLE.
Referenced by rb_enc_str_scrub(), rb_str_scrub(), and str_compat_and_valid().
|
inlinestatic |
Definition at line 1574 of file string.c.
References diff(), ENC_CODERANGE_CLEAN_P, ENC_CODERANGE_VALID, ISASCII, len, rb_enc_asciicompat, rb_enc_fast_mbclen(), rb_enc_mbclen(), rb_enc_mbmaxlen, rb_enc_mbminlen, rb_utf8_encoding(), and search_nonascii().
Referenced by rb_enc_strlen(), rb_str_sublen(), and str_strlen().
|
static |
Definition at line 3799 of file string.c.
References enc_pred_char(), enc_succ_char(), MEMCPY, NEIGHBOR_FOUND, NEIGHBOR_NOT_CHAR, NEIGHBOR_WRAPPED, ONIGENC_CODE_TO_MBC_MAXLEN, ONIGENC_CTYPE_ALPHA, ONIGENC_CTYPE_DIGIT, range, rb_enc_isctype, rb_enc_mbc_to_codepoint, and str_succ().
Referenced by str_succ().
|
static |
Definition at line 3685 of file string.c.
References MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, NEIGHBOR_FOUND, NEIGHBOR_NOT_CHAR, NEIGHBOR_WRAPPED, rb_enc_code_to_mbclen, rb_enc_mbc_to_codepoint, rb_enc_mbcput, rb_enc_mbminlen, and rb_enc_precise_mbclen().
Referenced by enc_succ_alnum_char(), and str_succ().
|
static |
Definition at line 261 of file string.c.
References assert, BARE_STRING_P, ENCODING_GET, FL_TEST_RAW, OBJ_FREEZE_RAW, OBJ_FROZEN, Qundef, rb_cString, rb_objspace_garbage_object_p(), RBASIC, RSTRING, RSTRING_FSTR, RUBY_FUNC_EXPORTED, ST_CONTINUE, ST_DELETE, ST_STOP, STR_FAKESTR, str_make_independent(), str_new_frozen(), str_new_static(), and STR_SHARED_P.
Referenced by register_fstring().
Definition at line 406 of file string.c.
References ENCODING_GET, memcmp(), and RSTRING_GETMEM.
Referenced by mustnot_wchar().
Definition at line 399 of file string.c.
References RBASIC_SET_CLASS, and ST_CONTINUE.
Referenced by Init_String().
|
static |
Definition at line 197 of file string.c.
References ENCINDEX_UTF_16, ENCINDEX_UTF_16BE, ENCINDEX_UTF_16LE, ENCINDEX_UTF_32, ENCINDEX_UTF_32BE, ENCINDEX_UTF_32LE, rb_ascii8bit_encoding(), rb_enc_from_index(), rb_enc_get_from_index(), RSTRING_LEN, and RSTRING_PTR.
Referenced by get_encoding(), rb_enc_str_coderange(), and rb_str_inspect().
|
static |
Definition at line 227 of file string.c.
References ENCODING_GET, and get_actual_encoding().
Definition at line 4636 of file string.c.
References BUILTIN_TYPE, Check_Type, NIL_P, rb_check_string_type(), rb_reg_regcomp(), SPECIAL_CONST_P, T_REGEXP, T_STRING, and val.
Referenced by rb_str_match(), rb_str_match_m(), and rb_str_match_m_p().
Definition at line 4661 of file string.c.
References BUILTIN_TYPE, Check_Type, is_broken_string, NIL_P, rb_check_string_type(), rb_exc_raise(), rb_reg_check_preprocess(), SPECIAL_CONST_P, T_REGEXP, T_STRING, and val.
Referenced by rb_str_partition(), rb_str_scan(), rb_str_split_m(), rb_str_sub_bang(), and str_gsub().
Definition at line 4147 of file string.c.
References Qnil, and rb_equal().
Referenced by rb_str_include_range_p().
void Init_String | ( | void | ) |
Definition at line 10012 of file string.c.
References assert, CLASS_OF, empty_str_alloc(), fstring_set_class_i(), ID2SYM, Qnil, rb_cObject, rb_cString, rb_cSymbol, rb_define_alloc_func(), rb_define_class(), rb_define_hooked_variable(), rb_define_method(), rb_define_singleton_method(), rb_fs, rb_fs_setter(), rb_include_module(), rb_intern, rb_mComparable, rb_obj_encoding(), rb_str_aref_m(), rb_str_aset_m(), rb_str_b(), rb_str_bytes(), rb_str_bytesize(), rb_str_byteslice(), rb_str_capitalize(), rb_str_capitalize_bang(), rb_str_casecmp(), rb_str_casecmp_p(), rb_str_center(), rb_str_chars(), rb_str_chomp(), rb_str_chomp_bang(), rb_str_chop(), rb_str_chop_bang(), rb_str_chr(), rb_str_clear(), rb_str_cmp_m(), rb_str_codepoints(), rb_str_concat(), rb_str_concat_multi(), rb_str_count(), rb_str_crypt(), rb_str_delete(), rb_str_downcase(), rb_str_downcase_bang(), rb_str_dump(), rb_str_each_byte(), rb_str_each_char(), rb_str_each_codepoint(), rb_str_each_line(), rb_str_empty(), rb_str_end_with(), rb_str_eql(), rb_str_equal(), rb_str_force_encoding(), rb_str_format_m(), rb_str_freeze(), rb_str_getbyte(), rb_str_gsub(), rb_str_gsub_bang(), rb_str_hash_m(), rb_str_hex(), rb_str_include(), rb_str_index_m(), rb_str_init(), rb_str_insert(), rb_str_inspect(), rb_str_intern(), rb_str_is_ascii_only_p(), rb_str_length(), rb_str_lines(), rb_str_ljust(), rb_str_lstrip(), rb_str_lstrip_bang(), rb_str_match(), rb_str_match_m(), rb_str_match_m_p(), rb_str_oct(), rb_str_ord(), rb_str_partition(), rb_str_plus(), rb_str_prepend_multi(), rb_str_replace(), rb_str_reverse(), rb_str_reverse_bang(), rb_str_rindex_m(), rb_str_rjust(), rb_str_rpartition(), rb_str_rstrip(), rb_str_rstrip_bang(), rb_str_s_try_convert(), rb_str_scan(), rb_str_setbyte(), rb_str_slice_bang(), rb_str_split_m(), rb_str_squeeze(), rb_str_squeeze_bang(), rb_str_start_with(), rb_str_strip(), rb_str_strip_bang(), rb_str_sub(), rb_str_sub_bang(), rb_str_succ(), rb_str_succ_bang(), rb_str_sum(), rb_str_swapcase(), rb_str_swapcase_bang(), rb_str_times(), rb_str_to_f(), rb_str_to_i(), rb_str_to_s(), rb_str_tr(), rb_str_tr_bang(), rb_str_tr_s(), rb_str_tr_s_bang(), rb_str_upcase(), rb_str_upcase_bang(), rb_str_upto(), rb_str_valid_encoding_p(), rb_sym_all_symbols(), rb_sym_to_proc(), rb_sym_to_s(), rb_undef_alloc_func(), rb_undef_method(), rb_vm_fstring_table(), st_foreach, str_scrub(), str_scrub_bang(), str_uminus(), str_uplus(), sym_aref(), sym_ascii, sym_capitalize(), sym_casecmp(), sym_casecmp_p(), sym_cmp(), sym_downcase(), sym_empty(), sym_encoding(), sym_equal, sym_fold, sym_inspect(), sym_length(), sym_lithuanian, sym_match(), sym_match_m(), sym_match_m_p(), sym_succ(), sym_swapcase(), sym_to_sym(), sym_turkic, and sym_upcase().
|
static |
Definition at line 8200 of file string.c.
References ascii_isspace, rb_enc_codepoint_len(), rb_isspace(), and single_byte_optimizable().
Referenced by rb_str_lstrip(), rb_str_lstrip_bang(), rb_str_strip(), and rb_str_strip_bang().
|
inlinestatic |
Definition at line 680 of file string.c.
References rb_eArgError, and rb_raise().
Referenced by rb_enc_str_new_cstr(), rb_str_cat_cstr(), and rb_str_new_cstr().
|
static |
Definition at line 233 of file string.c.
References is_broken_string, rb_eArgError, rb_enc_name, rb_raise(), and STR_ENC_GET.
Referenced by rb_str_scan(), and rb_str_split_m().
|
static |
Definition at line 241 of file string.c.
References fstring_cmp(), rb_eArgError, rb_enc_mbminlen, rb_enc_name, rb_raise(), register_fstring(), and STR_ENC_GET.
Referenced by rb_str_crypt().
|
inlinestatic |
Definition at line 1916 of file string.c.
References FL_TEST, rb_eRuntimeError, rb_raise(), and STR_TMPLOCK.
Referenced by rb_str_change_terminator_length(), str_fill_term(), and str_modifiable().
Definition at line 2164 of file string.c.
References rb_check_convert_type(), and T_STRING.
Referenced by ary_join_1(), check_gid_switch(), check_rounding_mode_option(), constant_arg(), env_has_value(), env_rassoc(), extract_getline_args(), get_pat(), get_pat_quoted(), gzreader_gets(), io_encoding_set(), make_exception(), month_arg(), prepare_getline_args(), range_each(), range_step(), rb_ary_join(), rb_ary_times(), rb_check_id(), rb_check_sockaddr_string_type(), rb_check_symbol(), rb_convert_to_integer(), rb_digest_instance_equal(), rb_f_kill(), rb_fs_check(), rb_io_extract_encoding_option(), rb_marshal_load_with_proc(), rb_num_get_rounding_option(), rb_str_format(), rb_str_include_range_p(), rb_str_index_m(), rb_str_rindex_m(), rb_str_rpartition(), rb_str_s_try_convert(), rb_String(), rb_threadptr_error_print(), rb_to_encoding_index(), reg_operand(), setup_narg(), string_for_symbol(), trap_handler(), and utc_offset_arg().
Definition at line 583 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, rb_enc_asciicompat, RSTRING_END, RSTRING_LEN, RSTRING_PTR, search_nonascii(), str_enc_copy(), and STR_ENC_GET.
Referenced by rb_str_subseq(), rb_str_succ(), rb_str_times(), and str_substr().
Definition at line 613 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, and str_enc_copy().
Referenced by rb_str_init(), str_new_frozen(), str_replace(), and str_replace_shared().
char* rb_enc_nth | ( | const char * | p, |
const char * | e, | ||
long | nth, | ||
rb_encoding * | enc | ||
) |
Definition at line 2238 of file string.c.
References str_nth_len().
Referenced by rb_str_ellipsize(), and rb_str_format().
int rb_enc_str_asciionly_p | ( | VALUE | str | ) |
Definition at line 640 of file string.c.
References ENC_CODERANGE_7BIT, FALSE, rb_enc_asciicompat, rb_enc_str_coderange(), STR_ENC_GET, and TRUE.
Referenced by enc_compatible_latter(), file_path_convert(), fnmatch_brace(), get_env_cstr(), r_symreal(), rb_file_expand_path_internal(), rb_inspect(), rb_realpath_internal(), rb_reg_quote(), rb_reg_s_union(), and time_zone_name().
VALUE rb_enc_str_buf_cat | ( | VALUE | str, |
const char * | ptr, | ||
long | len, | ||
rb_encoding * | ptr_enc | ||
) |
Definition at line 2771 of file string.c.
References ENC_CODERANGE_UNKNOWN, NULL, and rb_enc_to_index().
Referenced by parser_here_document(), rb_reg_regsub(), rb_str_to_s(), str_gsub(), and strio_write().
int rb_enc_str_coderange | ( | VALUE | str | ) |
Definition at line 620 of file string.c.
References coderange_scan(), ENC_CODERANGE, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ENCODING_GET, get_actual_encoding(), rb_enc_dummy_p(), rb_enc_from_index(), rb_enc_mbminlen, RSTRING_LEN, and RSTRING_PTR.
Referenced by check_getline_args(), enc_compatible_latter(), optimized_unescape(), parser_str_new(), rb_econv_prepare_options(), rb_enc_str_asciionly_p(), rb_external_str_with_enc(), rb_file_expand_path_internal(), rb_reg_fragment_setenc(), rb_str_comparable(), rb_str_hash(), rb_str_is_ascii_only_p(), rb_str_valid_encoding_p(), RUBY_ALIAS_FUNCTION(), str_coderange(), str_compat_and_valid(), str_succ(), str_transcode0(), sym_check_asciionly(), and w_symbol().
VALUE rb_enc_str_new | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 758 of file string.c.
References rb_cString, rb_enc_associate(), rb_enc_mbminlen, rb_str_new(), and str_new0().
Referenced by buffer_size_check(), check_getline_args(), do_opendir(), econv_get_replacement(), enc_str_scrub(), io_getc(), match_named_captures_iter(), ole_alloc_vstr(), ospath_new(), parser_str_new(), rb_enc_reg_new(), rb_enc_str_new_cstr(), rb_enc_uint_chr(), rb_intern3(), rb_io_getline_0(), rb_push_glob(), rb_readlink(), rb_strftime(), rb_strftime_timespec(), rb_syntax_error_append(), rb_tainted_str_new_with_enc(), rb_w32_conv_from_wchar(), reg_names_iter(), register_static_symid(), str_upto_each(), strio_init(), sym_inspect(), time_strftime(), transcode_loop(), warn_vsprintf(), and writer().
VALUE rb_enc_str_new_cstr | ( | const char * | ptr, |
rb_encoding * | enc | ||
) |
Definition at line 793 of file string.c.
References must_not_null(), rb_eArgError, rb_enc_mbminlen, rb_enc_str_new(), rb_raise(), and strlen().
Referenced by join_path(), and syserr_initialize().
VALUE rb_enc_str_new_static | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 847 of file string.c.
References rb_cString, rb_enc_to_index(), and str_new_static().
VALUE rb_enc_str_scrub | ( | rb_encoding * | enc, |
VALUE | str, | ||
VALUE | repl | ||
) |
Definition at line 9239 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_UNKNOWN, enc_str_scrub(), and STR_ENC_GET.
Referenced by str_transcode0().
long rb_enc_strlen | ( | const char * | p, |
const char * | e, | ||
rb_encoding * | enc | ||
) |
Definition at line 1646 of file string.c.
References ENC_CODERANGE_UNKNOWN, and enc_strlen().
Referenced by rb_str_format(), and update_char_offset().
long rb_enc_strlen_cr | ( | const char * | p, |
const char * | e, | ||
rb_encoding * | enc, | ||
int * | cr | ||
) |
Definition at line 1655 of file string.c.
References diff(), ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_VALID, ISASCII, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_mbmaxlen, rb_enc_mbminlen, rb_enc_precise_mbclen(), and search_nonascii().
Referenced by str_strlen().
Definition at line 1020 of file string.c.
References rb_default_external_encoding(), and rb_external_str_new_with_enc().
Referenced by fsdbm_delete(), fsdbm_delete_if(), fsdbm_each_key(), fsdbm_each_pair(), fsdbm_each_value(), fsdbm_fetch(), fsdbm_invert(), fsdbm_key(), fsdbm_keys(), fsdbm_select(), fsdbm_shift(), fsdbm_to_a(), fsdbm_to_hash(), and fsdbm_values().
Definition at line 1026 of file string.c.
References rb_default_external_encoding(), rb_external_str_new_with_enc(), and strlen().
Referenced by external_str_new_cstr().
VALUE rb_external_str_new_with_enc | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | eenc | ||
) |
Definition at line 998 of file string.c.
References rb_external_str_with_enc(), and rb_tainted_str_new_with_enc().
Referenced by dir_each(), dir_read(), env_enc_str_new(), etc_getlogin(), push_pattern(), rb_external_str_new(), rb_external_str_new_cstr(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_locale_str_new(), and rb_locale_str_new_cstr().
VALUE rb_external_str_with_enc | ( | VALUE | str, |
rb_encoding * | eenc | ||
) |
Definition at line 1007 of file string.c.
References ENC_CODERANGE_7BIT, rb_ascii8bit_encindex(), rb_default_internal_encoding(), rb_enc_associate_index(), rb_enc_str_coderange(), rb_enc_to_index(), rb_str_conv_enc(), and rb_usascii_encindex().
Referenced by dir_each(), rb_external_str_new_with_enc(), and time_zone_name().
Definition at line 1044 of file string.c.
References rb_external_str_new_with_enc(), and rb_filesystem_encoding().
Referenced by etc_systmpdir().
Definition at line 1050 of file string.c.
References rb_external_str_new_with_enc(), rb_filesystem_encoding(), and strlen().
Referenced by etc_getlogin(), etc_sysconfdir(), load_path_getcwd(), rb_compile_cstr(), rb_compile_string(), rb_parser_compile_cstr(), rb_parser_compile_file(), rb_parser_compile_string(), and search_required().
Definition at line 7159 of file string.c.
References NIL_P, rb_check_string_type(), RB_TYPE_P, T_REGEXP, T_STRING, and val.
Referenced by rb_fs_setter(), and rb_str_split_m().
Definition at line 9072 of file string.c.
References PRIsVALUE, rb_eTypeError, rb_fs_check(), rb_id2str, rb_raise(), and val.
Referenced by Init_String().
RUBY_FUNC_EXPORTED VALUE rb_fstring | ( | VALUE | str | ) |
Definition at line 305 of file string.c.
References BARE_STRING_P, Check_Type, FL_TEST, OBJ_FREEZE_RAW, register_fstring(), RSTRING_FSTR, STR_EMBED_P, str_replace_shared_without_enc(), and T_STRING.
Referenced by case_when_optimizable_literal(), compile_dstr_fragments(), eval_string_with_cref(), get_loaded_features_index(), ibf_load_location_str(), ibf_load_object_string(), iseq_compile_each(), iseqw_s_compile_file(), prepare_iseq_build(), rb_autoload_str(), rb_construct_expanded_load_path(), rb_enc_reg_new(), rb_insns_name_array(), rb_provide_feature(), rb_str_intern(), reg_set_source(), register_static_symid_str(), when_vals(), and yyparse().
Definition at line 387 of file string.c.
References rb_fstring_new(), and strlen().
Referenced by caller_location(), enc_name(), Init_VM(), iseqw_s_compile(), iseqw_s_compile_file(), make_no_method_exception(), raise_method_missing(), rb_autoload(), rb_binding_add_dynavars(), rb_enc_aliases_enc_i(), rb_enc_name_list_i(), rb_iseq_compile_with_option(), rb_iseq_new_main(), sig_list(), and syntax_error_initialize().
VALUE rb_fstring_enc_cstr | ( | const char * | ptr, |
rb_encoding * | enc | ||
) |
Definition at line 393 of file string.c.
References rb_fstring_enc_new(), and strlen().
VALUE rb_fstring_enc_new | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 380 of file string.c.
References rb_setup_fake_str(), and register_fstring().
Referenced by rb_fstring_enc_cstr().
Definition at line 373 of file string.c.
References ENCINDEX_US_ASCII, register_fstring(), and setup_fake_str().
Referenced by check_id_type(), check_setter_id(), rb_deprecate_constant(), and rb_fstring_cstr().
Definition at line 9640 of file string.c.
References rb_id2str, and rb_str_quote_unprintable().
Definition at line 1032 of file string.c.
References rb_external_str_new_with_enc(), and rb_locale_encoding().
Referenced by readline_attempted_completion_function().
Definition at line 1038 of file string.c.
References rb_external_str_new_with_enc(), rb_locale_encoding(), and strlen().
Referenced by etc_getlogin(), filename_completion_proc_call(), hist_each(), hist_get(), rb_remove_history(), readline_attempted_completion_function(), readline_readline(), readline_s_get_completion_case_fold(), and username_completion_proc_call().
void rb_must_asciicompat | ( | VALUE | str | ) |
Definition at line 2032 of file string.c.
References rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, and rb_raise().
Referenced by dir_s_home(), rb_str2big_karatsuba(), rb_str2big_normal(), rb_str2big_poweroftwo(), rb_str_to_inum(), rb_warning_s_warn(), string_to_c(), string_to_c_strict(), string_to_r(), and string_to_r_strict().
Definition at line 1364 of file string.c.
References FL_ABLE, FL_TEST_RAW, OBJ_INFECT_RAW, rb_any_to_s(), rb_funcall(), RB_TYPE_P, RSTRING_FSTR, and T_STRING.
Referenced by ary_join_1(), exc_inspect(), fdbm_store(), init_libraries(), io_write(), io_write_nonblock(), name_err_mesg_to_str(), pack_pack(), pruby_eval(), pruby_obj_to_var(), range_to_s(), rb_gzwriter_write(), rb_inspect(), rb_io_puts(), rb_io_s_new(), rb_io_syswrite(), rb_p(), rb_str_format(), rb_str_sub_bang(), readline_attempted_completion_function(), reg_fragment_check_gen(), ruby__sfvextra(), setup_exception(), str_gsub(), strio_s_new(), and strio_write().
Definition at line 4688 of file string.c.
References BUILTIN_TYPE, match(), OBJ_INFECT, Qnil, rb_backref_get(), rb_backref_set(), rb_backref_set_string(), rb_reg_search0(), rb_str_new_frozen(), rb_strseq_index(), RSTRING_LEN, and T_STRING.
Referenced by rb_str_scan(), rb_str_sub_bang(), scan_once(), and str_gsub().
VALUE rb_setup_fake_str | ( | struct RString * | fake_str, |
const char * | name, | ||
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 367 of file string.c.
References rb_enc_to_index(), and setup_fake_str().
Referenced by attrsetname_to_attr_id(), rb_check_id_cstr(), rb_check_symbol_cstr(), rb_fstring_enc_new(), rb_intern3(), rb_sym_intern(), and ruby_require_internal().
Definition at line 2818 of file string.c.
References rb_str_buf_append(), and StringValue.
Referenced by append_method(), argf_read(), dir_inspect(), dt_lite_iso8601(), dt_lite_jisx0301(), fc_path(), gzfile_error_inspect(), insn_data_to_s_detail(), inspect_range(), inspect_struct(), io_fillbuf(), join_der_i(), make_version_str(), match_inspect(), method_inspect(), ole_raise(), ossl_sslctx_set_ciphers(), ossl_x509extfactory_create_ext(), parser_here_document(), path_sub_ext(), range_to_s(), rb_const_set(), rb_io_inspect(), rb_iseq_disasm(), rb_load_fail(), rb_mod_to_s(), rb_reg_s_union(), rb_set_class_path_string(), rb_stat_inspect(), rb_str_concat(), rb_str_ellipsize(), rb_str_insert(), rb_str_prepend_multi(), sockopt_inspect(), strscan_concat(), syserr_fail2_in(), and wmap_inspect_i().
Definition at line 4211 of file string.c.
References FALSE, FIX2LONG, FIXNUM_P, INT2FIX, NULL, NUM2LONG, Qfalse, Qnil, rb_range_beg_len(), rb_str_dup(), rb_str_index, rb_str_subpat(), rb_str_substr(), RB_TYPE_P, str_strlen(), str_substr(), T_REGEXP, and T_STRING.
Referenced by rb_str_aref_m().
Definition at line 4314 of file string.c.
References NUM2LONG, rb_check_arity, rb_str_aref(), rb_str_subpat(), rb_str_substr(), RB_TYPE_P, and T_REGEXP.
Referenced by Init_String(), rb_str_slice_bang(), and sym_aref().
|
static |
Definition at line 6060 of file string.c.
References CASEMAP_DEBUG, onigenc_ascii_only_case_map(), rb_eArgError, rb_raise(), RSTRING_END, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), rb_str_swapcase_bang(), and rb_str_upcase_bang().
Definition at line 4481 of file string.c.
References FIX2LONG, FIXNUM_P, INT2FIX, len, NULL, NUM2LONG, rb_eIndexError, rb_raise(), rb_range_beg_len(), rb_str_index, rb_str_splice, rb_str_sublen(), rb_str_subpat_set(), SPECIAL_CONST_P, str_strlen(), T_REGEXP, T_STRING, TYPE, and val.
Referenced by rb_str_aset_m().
Definition at line 4548 of file string.c.
References NUM2LONG, rb_check_arity, rb_str_aset(), rb_str_splice, rb_str_subpat_set(), RB_TYPE_P, and T_REGEXP.
Referenced by Init_String(), and rb_str_slice_bang().
Definition at line 9108 of file string.c.
References ENC_CODERANGE_CLEAR, OBJ_INFECT_RAW, rb_cString, str_alloc(), and str_replace_shared_without_enc().
Referenced by Init_String().
Definition at line 2802 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, ENCODING_GET, OBJ_INFECT, RSTRING_LEN, and RSTRING_PTR.
Referenced by append_method(), ary_join_0(), ary_join_1(), env_inspect(), exc_inspect(), gc_profile_result(), inspect_ary(), inspect_i(), literal_concat0(), match_inspect(), method_inspect(), rb_digest_instance_inspect(), rb_file_join(), rb_reg_preprocess_dregexp(), rb_str_append(), rb_str_concat_multi(), str_gsub(), and strio_write().
Definition at line 2778 of file string.c.
References ALLOCA_N, buf, ENC_CODERANGE_7BIT, ENC_CODERANGE_VALID, ENCODING_GET, rb_enc_asciicompat, rb_enc_codelen(), rb_enc_from_index(), rb_enc_mbcput, rb_enc_mbmaxlen, and strlen().
Referenced by check_getline_args(), inspect_i(), and rb_reg_s_union().
int rb_str_buf_cat_escaped_char | ( | VALUE | result, |
unsigned int | c, | ||
int | unicode_p | ||
) |
Definition at line 5555 of file string.c.
References buf, CHAR_ESC_LEN, ISPRINT, rb_str_buf_cat(), snprintf, and strlen().
Referenced by rb_reg_expr_str(), rb_str_escape(), and rb_str_inspect().
VALUE rb_str_buf_new | ( | long | capa | ) |
Definition at line 1247 of file string.c.
References ALLOC_N, RString::capa, FL_SET, rb_cString, RSTRING, str_alloc(), STR_BUF_MIN_SIZE, and STR_NOEMBED.
Referenced by appendline(), copy_stream_body(), copy_stream_fallback_body(), enc_str_scrub(), gc_profile_result(), JSON_parse_string(), optimized_escape(), optimized_escape_html(), optimized_unescape(), optimized_unescape_html(), pack_pack(), parser_nextline(), pst_to_s(), rb_ary_join(), rb_digest_instance_inspect(), rb_econv_append(), rb_enc_vsprintf(), rb_exec_fillarg(), rb_execarg_parent_start1(), rb_file_join(), rb_marshal_dump_limited(), rb_reg_preprocess(), rb_reg_regsub(), rb_reg_s_union(), rb_str_buf_new_cstr(), rb_str_conv_enc_opts(), rb_str_encode_ospath(), rb_str_escape(), rb_str_format(), rb_str_inspect(), str_gsub(), zstream_append_buffer(), zstream_append_input(), and zstream_expand_buffer_into().
Definition at line 1263 of file string.c.
References len, rb_str_buf_cat(), rb_str_buf_new(), and strlen().
Referenced by rb_load_fail().
Definition at line 7749 of file string.c.
References rb_str_enumerate_bytes().
Referenced by Init_String().
Definition at line 1765 of file string.c.
References LONG2NUM, and RSTRING_LEN.
Referenced by Init_String().
Definition at line 5329 of file string.c.
References NUM2LONG, rb_check_arity, str_byte_aref(), str_byte_substr(), and TRUE.
Referenced by Init_String().
size_t rb_str_capacity | ( | VALUE | str | ) |
Definition at line 674 of file string.c.
References str_capacity(), and TERM_LEN.
Referenced by append_fspath(), check_gid_switch(), dump_append_string_content(), econv_primitive_convert(), rb_econv_append(), rb_str_vcatf(), rb_strftime_with_timespec(), str_cat_conv_enc_opts(), zstream_append_buffer(), zstream_buffer_ungets(), zstream_expand_buffer_non_stream(), and zstream_shift_buffer().
Definition at line 6307 of file string.c.
References rb_str_capitalize_bang(), and rb_str_dup().
Referenced by Init_String(), and sym_capitalize().
Definition at line 6271 of file string.c.
References check_case_options(), ONIGENC_CASE_ASCII_ONLY, ONIGENC_CASE_MODIFIED, ONIGENC_CASE_TITLECASE, ONIGENC_CASE_UPCASE, Qnil, rb_str_ascii_casemap(), rb_str_casemap(), rb_str_check_dummy_enc(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, str_modify_keep_cr(), and str_shared_replace().
Referenced by Init_String(), and rb_str_capitalize().
Definition at line 3193 of file string.c.
References INT2FIX, len, memcmp(), Qnil, rb_enc_ascget(), rb_enc_compatible(), rb_enc_mbclen(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), StringValue, and TOUPPER.
Referenced by Init_String(), and sym_casecmp().
Definition at line 3265 of file string.c.
References Qnil, rb_enc_compatible(), rb_str_downcase(), rb_str_eql(), StringValue, and sym_fold.
Referenced by Init_String(), and sym_casecmp_p().
|
static |
Definition at line 5983 of file string.c.
References RString::capa, mapping_buffer::capa, OnigEncodingTypeST::case_map, CASE_MAPPING_ADDITIONAL_LENGTH, CASEMAP_DEBUG, memcpy, mapping_buffer::next, NULL, OBJ_INFECT_RAW, offsetof, PRIuSIZE, rb_eArgError, rb_raise(), rb_str_dup(), rb_str_new_with_class(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, mapping_buffer::space, str_enc_copy(), mapping_buffer::used, xfree(), and xmalloc.
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), rb_str_swapcase_bang(), and rb_str_upcase_bang().
Definition at line 2664 of file string.c.
References rb_eArgError, rb_raise(), and str_buf_cat().
Referenced by append_lex_state_name(), date_strftime_internal(), flo_to_s(), ibf_dump_write(), init_env(), inspect1(), inspect_range(), io_getc(), io_shift_cbuf(), moreswitches(), mustbe_callable(), ole_excepinfo2msg(), optimized_escape(), optimized_escape_html(), optimized_unescape(), optimized_unescape_html(), parser_here_document(), process_sflag(), r_bytes1_buffered(), range_to_s(), rb_file_dirname(), rb_id_attrset(), rb_io_inspect(), rb_str_cat_conv_enc_opts(), rb_str_concat(), rb_str_ellipsize(), rb_str_encode_ospath(), realpath_rec(), rsock_inspect_sockaddr(), show_bitstack(), and zstream_append_buffer().
VALUE rb_str_cat_conv_enc_opts | ( | VALUE | newstr, |
long | ofs, | ||
const char * | ptr, | ||
long | len, | ||
rb_encoding * | from, | ||
int | ecflags, | ||
VALUE | ecopts | ||
) |
Definition at line 914 of file string.c.
References rb_eIndexError, rb_enc_get(), rb_raise(), rb_str_cat(), rb_str_modify(), RSTRING_LEN, str_cat_conv_enc_opts(), and STR_SET_LEN.
Referenced by rb_file_expand_path_internal().
Definition at line 2674 of file string.c.
References must_not_null(), rb_str_buf_cat(), and strlen().
Referenced by append_lex_state_name(), feature_option(), html_escaped_cat(), location_format(), optimized_escape(), rb_if_indextoname(), rb_syntax_error_append(), show_bitstack(), thread_start_func_2(), and trace_lex_state().
Definition at line 2103 of file string.c.
References assert, RString::capa, FL_TEST, L, len, rb_check_lockedtmp(), RSTRING, RSTRING_LEN, RSTRING_PTR, str_capacity(), str_dependent_p(), STR_EMBED_P, str_make_independent_expand(), STR_SHARED, and TERM_FILL.
Referenced by rb_enc_associate_index().
Definition at line 7853 of file string.c.
References rb_str_enumerate_chars().
Referenced by Init_String().
|
static |
Definition at line 5920 of file string.c.
References rb_eEncCompatError, rb_enc_dummy_p(), rb_enc_name, and rb_raise().
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), and rstrip_offset().
Definition at line 8192 of file string.c.
References chomp_rs(), chompped_length(), NIL_P, rb_str_dup(), and rb_str_subseq().
Referenced by Init_String().
Definition at line 8158 of file string.c.
References chomp_rs(), NIL_P, Qnil, rb_str_chomp_string(), RSTRING_LEN, and str_modify_keep_cr().
Referenced by Init_String().
Definition at line 8136 of file string.c.
References chompped_length(), ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, Qnil, RSTRING_LEN, RSTRING_PTR, STR_SET_LEN, TERM_FILL, and TERM_LEN.
Referenced by rb_io_getline_0(), and rb_str_chomp_bang().
Definition at line 8016 of file string.c.
References chopped_length(), and rb_str_subseq().
Referenced by Init_String().
Definition at line 7981 of file string.c.
References chopped_length(), ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, len, Qnil, RSTRING_LEN, RSTRING_PTR, str_modify_keep_cr(), STR_SET_LEN, TERM_FILL, and TERM_LEN.
Referenced by Init_String().
Definition at line 5118 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, rb_enc_asciicompat, RSTRING_PTR, str_discard(), STR_ENC_GET, STR_SET_EMBED, and STR_SET_EMBED_LEN.
Referenced by Init_String().
Definition at line 3050 of file string.c.
References ENCODING_GET, lesser, memcmp(), rb_str_comparable(), and RSTRING_GETMEM.
Referenced by iseq_location_setup(), ole_method_event(), ole_search_event(), ole_search_event_at(), oleclass_from_typelib(), oletypelib_search_registry(), rb_digest_instance_equal(), rb_str_cmp_m(), recordinfo_from_itypelib(), sort_2(), str_upto_each(), typeinfo_from_ole(), and typelib_file_from_typelib().
Definition at line 3159 of file string.c.
References INT2FIX, rb_check_funcall(), rb_invcmp(), rb_str_cmp(), RB_TYPE_P, result, and T_STRING.
Referenced by Init_String(), and sym_cmp().
Definition at line 7947 of file string.c.
References rb_str_enumerate_codepoints().
Referenced by Init_String().
long rb_str_coderange_scan_restartable | ( | const char * | s, |
const char * | e, | ||
rb_encoding * | enc, | ||
int * | cr | ||
) |
Definition at line 530 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, rb_ascii8bit_encindex(), rb_enc_asciicompat, rb_enc_precise_mbclen(), rb_enc_to_index(), and search_nonascii().
Referenced by fnmatch_brace(), parser_here_document(), rb_io_getline_fast(), rb_reg_expr_str(), rb_str_format(), read_all(), and str_encode_associate().
Definition at line 3025 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, FALSE, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_str_coderange(), RSTRING_LEN, and TRUE.
Referenced by rb_str_cmp(), rb_str_hash_cmp(), and str_eql().
Definition at line 2890 of file string.c.
References ALLOCA_N, buf, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, ENCINDEX_ASCII, ENCINDEX_US_ASCII, FIX2LONG, FIXNUM_P, len, memcpy, ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_enc_associate_index(), rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_enc_to_index(), rb_eRangeError, RB_INTEGER_TYPE_P, rb_num_to_uint(), rb_raise(), rb_str_append(), rb_str_cat(), rb_str_resize(), RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
Referenced by clsid_from_remote(), cState_aref(), cState_aset(), debug_deadlock_check(), defined_expr(), f_format(), foleparam_inspect(), Init_String(), insn_data_to_s_detail(), iseq_compile_each(), make_inspect(), nucomp_inspect(), nurat_inspect(), ole_typedesc2val(), oletypelib_path(), pruby_eval(), rb_iseq_disasm(), rb_iseq_disasm_insn(), rb_mod_to_s(), and rb_str_concat_multi().
Definition at line 2825 of file string.c.
References ENC_CODERANGE, ENCINDEX_US_ASCII, ENCODING_GET, ENCODING_GET_INLINED, NULL, OBJ_INFECT_RAW, rb_enc_set_index(), rb_str_new(), rb_str_resurrect(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 2872 of file string.c.
References argc, rb_enc_copy(), rb_str_buf_append(), rb_str_concat(), rb_str_tmp_new(), and str_modifiable().
Referenced by Init_String().
VALUE rb_str_conv_enc | ( | VALUE | str, |
rb_encoding * | from, | ||
rb_encoding * | to | ||
) |
Definition at line 992 of file string.c.
References Qnil, and rb_str_conv_enc_opts().
Referenced by append_fspath(), convert_encoding(), file_path_convert(), get_env_cstr(), process_options(), push_pattern(), rb_external_str_with_enc(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_home_dir_of(), rb_str_encode_ospath(), rb_str_export(), rb_str_export_locale(), rb_str_export_to_enc(), realpath_rec(), strio_ungetc(), and strio_write().
VALUE rb_str_conv_enc_opts | ( | VALUE | str, |
rb_encoding * | from, | ||
rb_encoding * | to, | ||
int | ecflags, | ||
VALUE | ecopts | ||
) |
Definition at line 884 of file string.c.
References is_ascii_string, len, NIL_P, OBJ_INFECT, RString::ptr, rb_ascii8bit_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_str_buf_new(), rb_str_dup(), RSTRING_GETMEM, str_cat_conv_enc_opts(), and STR_ENC_GET.
Referenced by gzfile_newstr(), rb_str_conv_enc(), rb_strftime_with_timespec(), rb_w32_conv_from_wchar(), rb_w32_write_console(), and ruby__sfvextra().
Definition at line 7089 of file string.c.
References argc, FALSE, INT2FIX, INT2NUM, is_broken_string, ONIGENC_IS_ALLOWED_REVERSE_MATCH, rb_check_arity, rb_enc_asciicompat, rb_enc_check(), rb_enc_codepoint_len(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, StringValue, tr_find(), tr_setup_table(), TR_TABLE_SIZE, TRUE, and UNLIMITED_ARGUMENTS.
Referenced by Init_String().
Definition at line 8613 of file string.c.
References crypt(), crypt_r(), FL_SET_RAW, ISASCII, mustnot_wchar(), OBJ_TAINTED_RAW, rb_eArgError, rb_raise(), rb_str_new_cstr(), rb_sys_fail(), result, RSTRING_LEN, RSTRING_PTR, StringValue, and StringValueCStr.
Referenced by Init_String().
Definition at line 6908 of file string.c.
References rb_str_delete_bang(), and rb_str_dup().
Referenced by Init_String().
Definition at line 6832 of file string.c.
References argc, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, Qnil, rb_check_arity, rb_enc_asciicompat, rb_enc_check(), rb_enc_codepoint_len(), rb_enc_mbcput, RSTRING_END, RSTRING_LEN, RSTRING_PTR, str_modify_keep_cr(), STR_SET_LEN, StringValue, TERM_FILL, TERM_LEN, tr_find(), tr_setup_table(), TR_TABLE_SIZE, and UNLIMITED_ARGUMENTS.
Referenced by rb_str_delete(), tr_trans(), and trnext().
Definition at line 6246 of file string.c.
References rb_str_downcase_bang(), and rb_str_dup().
Referenced by Init_String(), rb_str_casecmp_p(), and sym_downcase().
Definition at line 6162 of file string.c.
References check_case_options(), ENC_CODERANGE, ENC_CODERANGE_7BIT, ONIGENC_CASE_ASCII_ONLY, ONIGENC_CASE_DOWNCASE, ONIGENC_CASE_FOLD_TURKISH_AZERI, ONIGENC_CASE_MODIFIED, Qnil, rb_enc_isascii, rb_enc_mbmaxlen, rb_str_ascii_casemap(), rb_str_casemap(), rb_str_check_dummy_enc(), rb_utf8_encoding(), RSTRING_END, RSTRING_PTR, STR_ENC_GET, str_modify_keep_cr(), and str_shared_replace().
Referenced by Init_String(), and rb_str_downcase().
Definition at line 4331 of file string.c.
References ENC_CODERANGE_CLEAR, len, memmove(), RString::ptr, rb_str_new_frozen(), RBASIC, RSTRING, RSTRING_LEN, RSTRING_PTR, STR_EMBEDDABLE_P, str_modifiable(), STR_NOEMBED, STR_NOFREE, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SHARED, STR_SHARED_P, TERM_LEN, and xfree().
Referenced by econv_primitive_convert(), and rb_str_splice_0().
Definition at line 5771 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, IS_EVSTR, ISPRINT, len, LONG_MAX, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, OnigEncodingTypeST::name, OBJ_INFECT_RAW, rb_ascii8bit_encindex(), rb_enc_asciicompat, rb_enc_associate_index(), rb_enc_from_index(), rb_enc_get_index(), rb_enc_mbc_to_codepoint, rb_enc_precise_mbclen(), rb_eRuntimeError, rb_raise(), rb_str_new_with_class(), rb_strlen_lit, rb_utf8_encindex(), result, RSTRING_LEN, RSTRING_PTR, snprintf, and strlen().
Referenced by Init_String(), inspect1(), inspect2(), make_econv_exception(), rb_econv_prepare_options(), and sockopt_inspect().
Definition at line 1436 of file string.c.
References rb_obj_class(), and str_duplicate().
Referenced by argf_next_argv(), cannot_be_coerced_into_BigDecimal(), convert_encoding(), cParser_source(), cState_aset(), date__parse(), dir_path(), econv_convert(), encoded_dup(), exc_inspect(), fc_path(), fdbm_delete_if(), fdbm_fetch(), fgdbm_delete_if(), fole_missing(), fsdbm_delete_if(), gettable_gen(), inspect_range(), intern_str(), iseq_compile_each(), make_inspectname(), optimized_escape(), optimized_escape_html(), optimized_unescape(), optimized_unescape_html(), process_options(), range_to_s(), rb_autoload_str(), rb_class_path(), rb_class_path_no_cache(), rb_const_set(), rb_deflate_init_copy(), rb_file_path(), rb_find_file_ext_safe(), rb_gzfile_comment(), rb_gzfile_orig_name(), rb_gzfile_set_comment(), rb_gzfile_set_orig_name(), rb_id_attrset(), rb_insn_operand_intern(), rb_mod_name(), rb_mod_to_s(), rb_reg_source(), rb_set_class_path(), rb_set_class_path_string(), rb_str_aref(), rb_str_capitalize(), rb_str_casemap(), rb_str_chomp(), rb_str_conv_enc_opts(), rb_str_delete(), rb_str_downcase(), rb_str_intern(), rb_str_justify(), rb_str_lstrip(), rb_str_reverse(), rb_str_rstrip(), rb_str_squeeze(), rb_str_strip(), rb_str_sub(), rb_str_swapcase(), rb_str_times(), rb_str_tr(), rb_str_tr_s(), rb_str_upcase(), realpath_rec(), reg_set_source(), rsock_ipaddr(), ruby_set_script_name(), str_gsub(), str_scrub(), str_uminus(), str_uplus(), and str_upto_each().
Definition at line 7732 of file string.c.
References rb_str_enumerate_bytes().
Referenced by Init_String().
Definition at line 7675 of file string.c.
References LONG2FIX, and RSTRING_LEN.
Referenced by rb_str_enumerate_bytes().
Definition at line 7836 of file string.c.
References rb_str_enumerate_chars().
Referenced by Init_String().
Definition at line 7755 of file string.c.
References rb_str_length().
Referenced by rb_str_enumerate_chars(), and rb_str_enumerate_codepoints().
Definition at line 7929 of file string.c.
References rb_str_enumerate_codepoints().
Referenced by Init_String().
Definition at line 7651 of file string.c.
References rb_str_enumerate_lines().
Referenced by Init_String().
Shortens str and adds three dots, an ellipsis, if it is longer than len characters.
str | the string to ellipsize. |
len | the maximum string length. |
Definition at line 9169 of file string.c.
References Qnil, rb_eIndexError, rb_enc_asciicompat, rb_enc_associate(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_mbminlen, rb_enc_nth(), rb_enc_step_back, rb_raise(), rb_str_append(), rb_str_cat(), rb_str_encode(), rb_str_new_with_class(), rb_str_subseq(), rb_usascii_str_new(), RSTRING_LEN, and RSTRING_PTR.
Referenced by intern_str(), rb_hash_fetch_m(), and syserr_fail2_in().
Definition at line 1782 of file string.c.
References Qfalse, Qtrue, and RSTRING_LEN.
Referenced by Init_String(), and sym_empty().
Definition at line 9040 of file string.c.
References argc, memcmp(), Qfalse, Qtrue, rb_enc_check(), rb_enc_left_char_head, RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_String().
Definition at line 7681 of file string.c.
References RString::ary, INT2FIX, MAYBE_UNUSED, rb_ary_new(), rb_ary_new2, rb_ary_push(), rb_block_given_p(), rb_str_each_byte_size(), rb_warn(), rb_warning(), rb_yield(), RSTRING_LEN, RSTRING_PTR, and SIZED_ENUMERATOR.
Referenced by rb_str_bytes(), rb_str_each_byte(), and rb_str_enumerate_codepoints().
Definition at line 7761 of file string.c.
References RString::ary, ENC_CODERANGE, ENC_CODERANGE_CLEAN_P, len, MAYBE_UNUSED, RString::ptr, rb_ary_new_capa(), rb_ary_push(), rb_block_given_p(), rb_enc_fast_mbclen(), rb_enc_get(), rb_enc_mbclen(), RB_GC_GUARD, rb_str_each_char_size(), rb_str_new_frozen(), rb_str_subseq(), rb_warn(), rb_warning(), rb_yield(), RSTRING_LEN, RSTRING_PTR, SIZED_ENUMERATOR, and str_strlen().
Referenced by rb_str_chars(), and rb_str_each_char().
Definition at line 7860 of file string.c.
References RString::ary, MAYBE_UNUSED, RString::ptr, rb_ary_new_capa(), rb_ary_push(), rb_block_given_p(), rb_enc_codepoint_len(), RB_GC_GUARD, rb_str_each_char_size(), rb_str_enumerate_bytes(), rb_str_new_frozen(), rb_warn(), rb_warning(), rb_yield(), RSTRING_END, RSTRING_PTR, single_byte_optimizable(), SIZED_ENUMERATOR, STR_ENC_GET, str_strlen(), and UINT2NUM.
Referenced by rb_str_codepoints(), and rb_str_each_codepoint().
Definition at line 7473 of file string.c.
References RString::ary, chomp_newline(), len, MAYBE_UNUSED, NIL_P, RString::ptr, Qfalse, Qnil, Qundef, rb_ary_new(), rb_ary_push(), rb_block_given_p(), rb_default_rs, rb_enc_ascget(), rb_enc_asciicompat, rb_enc_check(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_is_newline, rb_enc_mbclen(), rb_enc_mbminlen, rb_enc_right_char_head, RB_GC_GUARD, rb_get_kwargs(), rb_intern_const, rb_memsearch(), rb_rs, rb_scan_args(), rb_str_encode(), rb_str_new(), rb_str_new_frozen(), rb_str_subseq(), rb_warn(), rb_warning(), rb_yield(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, RTEST, SIZED_ENUMERATOR, str_mod_check(), and StringValue.
Referenced by rb_str_each_line(), and rb_str_lines().
Definition at line 3125 of file string.c.
References Qfalse, Qtrue, RB_TYPE_P, str_eql(), and T_STRING.
Referenced by Init_String(), and rb_str_casecmp_p().
Definition at line 3105 of file string.c.
References Qfalse, Qtrue, rb_equal(), rb_respond_to(), RB_TYPE_P, str_eql(), and T_STRING.
Referenced by init_addrinfo_getaddrinfo(), Init_String(), match_equal(), opt_eq_func(), path_eq(), r_object0(), rb_get_expanded_load_path(), and str_upto_each().
Definition at line 5588 of file string.c.
References buf, CHAR_ESC_LEN, ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, ENCODING_GET, ISPRINT, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, OBJ_INFECT_RAW, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_isascii, rb_enc_mbc_to_codepoint, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_unicode_p(), rb_str_buf_cat_escaped_char(), rb_str_buf_new(), rb_usascii_encindex(), result, RSTRING_END, RSTRING_PTR, snprintf, str_buf_cat(), and strlen().
Referenced by rb_any_to_s(), and rb_inspect().
Definition at line 1056 of file string.c.
References rb_default_external_encoding(), rb_str_conv_enc(), and STR_ENC_GET.
Definition at line 1062 of file string.c.
References rb_locale_encoding(), rb_str_conv_enc(), and STR_ENC_GET.
VALUE rb_str_export_to_enc | ( | VALUE | str, |
rb_encoding * | enc | ||
) |
Definition at line 1068 of file string.c.
References rb_str_conv_enc(), and STR_ENC_GET.
Referenced by alias(), scalar(), start_document(), start_mapping(), start_sequence(), and transcode_string().
Definition at line 2156 of file string.c.
References len, RSTRING_LEN, RSTRING_PTR, and str_fill_term().
Referenced by get_env_cstr().
Definition at line 9092 of file string.c.
References ENC_CODERANGE_CLEAR, rb_enc_associate(), rb_to_encoding(), and str_modifiable().
Referenced by Init_String().
Definition at line 1903 of file string.c.
References NIL_P, RARRAY_CONST_PTR, RARRAY_LENINT, rb_check_array_type(), RB_GC_GUARD, and rb_str_format().
Referenced by Init_String().
void rb_str_free | ( | VALUE | str | ) |
Definition at line 1281 of file string.c.
References FL_TEST, NULL, rb_vm_fstring_table(), RSTRING_FSTR, RUBY_FUNC_EXPORTED, ruby_sized_xfree(), st_data_t, st_delete, STR_EMBED_P, STR_HEAP_PTR, STR_HEAP_SIZE, STR_NOFREE, and STR_SHARED.
Referenced by dispose_string(), and obj_free().
Definition at line 2467 of file string.c.
References OBJ_FROZEN, rb_obj_freeze(), rb_str_resize(), and RSTRING_LEN.
Referenced by get_loaded_features_index(), Init_String(), path_freeze(), rb_construct_expanded_load_path(), rb_provide_feature(), and str_uminus().
Definition at line 5154 of file string.c.
References INT2FIX, NUM2LONG, Qnil, RSTRING_LEN, and RSTRING_PTR.
Referenced by Init_String().
Definition at line 5028 of file string.c.
References str_gsub(), and str_modify_keep_cr().
Referenced by Init_String().
st_index_t rb_str_hash | ( | VALUE | str | ) |
Definition at line 2985 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, rb_enc_str_coderange(), rb_memhash(), RSTRING_LEN, and RSTRING_PTR.
Referenced by any_hash(), cdhash_hash(), dsymbol_alloc(), match_hash(), path_hash(), and rb_str_hash_m().
Definition at line 2995 of file string.c.
References memcmp(), rb_str_comparable(), and RSTRING_GETMEM.
Referenced by cdhash_cmp(), and rb_any_cmp().
Definition at line 3016 of file string.c.
References hval, rb_str_hash(), and ST2FIX.
Referenced by Init_String().
Definition at line 8565 of file string.c.
References FALSE, and rb_str_to_inum().
Referenced by Init_String().
Definition at line 5448 of file string.c.
References Qfalse, Qtrue, rb_str_index, and StringValue.
Referenced by Init_String().
Definition at line 4156 of file string.c.
References all_digits_p(), bp, include_range_i(), ISASCII, ISDIGIT, NIL_P, Qfalse, Qtrue, rb_check_string_type(), rb_enc_asciicompat, rb_str_new_frozen(), RSTRING_LEN, RSTRING_PTR, RTEST, STR_ENC_GET, str_upto_each(), and StringValue.
Referenced by range_include().
Definition at line 3348 of file string.c.
References BUILTIN_TYPE, LONG2NUM, memcmp(), NIL_P, NULL, NUM2LONG, Qnil, rb_backref_set(), rb_check_string_type(), rb_enc_check(), rb_enc_left_char_head, rb_eTypeError, rb_obj_classname(), rb_raise(), rb_reg_search(), rb_scan_args(), rb_str_index, rb_str_sublen(), RB_TYPE_P, RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), SPECIAL_CONST_P, str_offset(), str_rindex(), str_strlen(), sub, T_REGEXP, and T_STRING.
Referenced by Init_String().
Definition at line 1466 of file string.c.
References ALLOC_N, RString::as, RString::capa, CONST_ID, ENC_CODERANGE_CLEAR, FL_SET, len, memcpy, NIL_P, NUM2LONG, Qundef, rb_enc_associate(), rb_enc_cr_str_exact_copy(), rb_enc_mbminlen, rb_get_kwargs(), rb_id_encoding(), rb_popcount_intptr(), rb_scan_args(), rb_str_replace(), rb_to_encoding(), REALLOC_N, RSTRING, RSTRING_LEN, RSTRING_PTR, STR_BUF_MIN_SIZE, STR_EMBED_P, STR_HEAP_SIZE, str_modifiable(), STR_NOEMBED, StringValue, and TERM_FILL.
Referenced by Init_String().
Definition at line 4581 of file string.c.
References NUM2LONG, rb_str_append(), and rb_str_splice.
Referenced by Init_String().
Definition at line 5664 of file string.c.
References buf, CHAR_ESC_LEN, ENCODING_GET, get_actual_encoding(), ISPRINT, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, NULL, OBJ_INFECT_RAW, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_codepoint, rb_enc_from_index(), rb_enc_isascii, rb_enc_isprint, rb_enc_mbc_to_codepoint, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_unicode_p(), rb_str_buf_cat_escaped_char(), rb_str_buf_new(), rb_usascii_encoding(), result, RSTRING_END, RSTRING_PTR, snprintf, str_buf_cat(), str_buf_cat2, and strlen().
Referenced by check_path_encoding(), gzfile_error_inspect(), id_to_name(), Init_String(), location_inspect_m(), match_inspect(), rb_str_quote_unprintable(), and sym_inspect().
Definition at line 9147 of file string.c.
References ENC_CODERANGE_7BIT, Qfalse, Qtrue, and rb_enc_str_coderange().
Referenced by Init_String(), rb_str_quote_unprintable(), and rb_str_symname_p().
Definition at line 8752 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_AND, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, f, len, LONG_MAX, memcpy, NIL_P, NUM2LONG, OBJ_INFECT_RAW, rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_mbminlen, RB_GC_GUARD, rb_obj_class(), rb_raise(), rb_scan_args(), rb_str_dup(), RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), size, STR_ENC_GET, str_new0(), str_offset(), STR_SET_LEN, str_strlen(), StringValue, and TERM_FILL.
Referenced by rb_str_center(), rb_str_ljust(), and rb_str_rjust().
Definition at line 1749 of file string.c.
References LONG2NUM, NULL, and str_strlen().
Referenced by Init_String(), rb_reg_match_p(), rb_str_each_char_size(), reg_match_pos(), strscan_get_charpos(), and sym_length().
Definition at line 7669 of file string.c.
References rb_str_enumerate_lines().
Referenced by Init_String().
Definition at line 2538 of file string.c.
References func, rb_ensure(), rb_str_locktmp(), and rb_str_unlocktmp().
Referenced by io_fread(), io_getpartial(), io_read_nonblock(), and rsock_s_recvfrom().
Definition at line 8276 of file string.c.
References len, lstrip_offset(), rb_str_dup(), rb_str_subseq(), RSTRING_GETMEM, and STR_ENC_GET.
Referenced by Init_String().
Definition at line 8238 of file string.c.
References lstrip_offset(), memmove(), Qnil, rb_enc_mbminlen, RSTRING_GETMEM, STR_ENC_GET, str_modify_keep_cr(), STR_SET_LEN, and TERM_FILL.
Referenced by Init_String().
Definition at line 3588 of file string.c.
References BUILTIN_TYPE, get_pat(), idEqTilde, rb_eTypeError, rb_funcall(), rb_raise(), rb_reg_match(), SPECIAL_CONST_P, T_REGEXP, and T_STRING.
Referenced by Init_String(), and sym_match().
Definition at line 3638 of file string.c.
References get_pat(), NIL_P, rb_block_given_p(), rb_check_arity, rb_funcallv, rb_intern, rb_yield(), and result.
Referenced by Init_String(), and sym_match_m().
Definition at line 3670 of file string.c.
References get_pat(), NUM2LONG, rb_check_arity, and rb_reg_match_p().
Referenced by Init_String(), and sym_match_m_p().
RUBY_FUNC_EXPORTED size_t rb_str_memsize | ( | VALUE | str | ) |
Definition at line 1294 of file string.c.
References FL_TEST, STR_HEAP_SIZE, STR_NOEMBED, STR_NOFREE, and STR_SHARED.
Referenced by obj_memsize_of().
void rb_str_modify | ( | VALUE | str | ) |
Definition at line 1980 of file string.c.
References ENC_CODERANGE_CLEAR, str_independent(), and str_make_independent().
Referenced by dedent_string(), econv_primitive_convert(), io_set_read_length(), io_setstrbuf(), ossl_ssl_read_internal(), rb_str_cat_conv_enc_opts(), rb_str_splice_0(), rb_str_sub_bang(), rb_str_succ_bang(), rb_str_vcatf(), rsock_strbuf(), setup_narg(), str_buf_cat(), string_to_c(), string_to_c_strict(), string_to_r(), string_to_r_strict(), strio_extend(), and strio_read().
void rb_str_modify_expand | ( | VALUE | str, |
long | expand | ||
) |
Definition at line 1988 of file string.c.
References ENC_CODERANGE_CLEAR, len, LONG_MAX, rb_eArgError, rb_raise(), RESIZE_CAPA_TERM, RSTRING_LEN, str_independent(), str_make_independent_expand(), and TERM_LEN.
Referenced by append_wstr(), check_gid_switch(), io_setstrbuf(), rb_file_expand_path_internal(), rb_str_encode_ospath(), read_all(), resize_buffer(), rsock_strbuf(), ruby_init_loadpath_safe(), sock_sysaccept(), strio_unget_bytes(), zstream_append_buffer(), zstream_expand_buffer_into(), and zstream_expand_buffer_non_stream().
Definition at line 736 of file string.c.
References rb_cString, and str_new().
Referenced by addrinfo_ipv4_multicast_p(), addrinfo_mdump(), addrinfo_to_sockaddr(), appendline(), argf_getpartial(), asn1str_to_str(), BigDecimal_dump(), BigDecimal_inspect(), BigDecimal_split(), BigDecimal_to_f(), BigDecimal_to_s(), bsock_getpeername(), bsock_getsockname(), bsock_getsockopt(), bubblebabble_str_new(), check_pipe_command(), cState_array_nl(), cState_indent(), cState_object_nl(), cState_space(), cState_space_before(), cState_to_h(), date_strftime_internal(), decode_bstr(), decode_eoc(), dir_s_home(), econv_convert(), econv_description(), econv_finish(), econv_primitive_errinfo(), econv_putback(), etc_systmpdir(), extract_user_token(), fbuffer_append_char(), genrand_bytes(), gzfile_getc(), gzfile_read(), gzfile_read_all(), gzfile_read_header(), gzfile_readpartial(), gzreader_gets(), ibf_dump_setup(), ibf_load_object_string(), infected_str_new(), inspect1(), inspect2(), int_chr(), int_ossl_asn1_decode0_prim(), io_getc(), io_setstrbuf(), io_shift_cbuf(), iseq_ibf_load_extra_data(), join_der(), load_file_internal(), load_transcoder_entry(), make_econv_exception(), match_to_s(), Messaging_HandleMessage(), ossl_asn1cons_to_der(), ossl_asn1data_to_der(), ossl_asn1eoc_initialize(), ossl_bn_to_s(), ossl_cipher_final(), ossl_cipher_is_authenticated(), ossl_cipher_update(), ossl_dh_compute_key(), ossl_dh_to_der(), ossl_digest_finish(), ossl_dsa_sign(), ossl_dsa_to_der(), ossl_hmac_digest(), ossl_hmac_hexdigest(), ossl_hmac_s_digest(), ossl_hmac_s_hexdigest(), ossl_make_error(), ossl_membio2str0(), ossl_ocspbres_to_der(), ossl_ocspcid_get_issuer_key_hash(), ossl_ocspcid_get_issuer_name_hash(), ossl_ocspcid_to_der(), ossl_ocspreq_to_der(), ossl_ocspres_to_der(), ossl_ocspsres_to_der(), ossl_pkcs12_to_der(), ossl_pkcs5_pbkdf2_hmac_sha1(), ossl_pkcs7_to_der(), ossl_pkey_sign(), ossl_rand_bytes(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_rsa_to_der(), ossl_spki_get_challenge(), ossl_spki_to_der(), ossl_ssl_get_client_ca_list(), ossl_ssl_read_internal(), ossl_ssl_session_get_id(), ossl_ssl_session_to_der(), ossl_sslctx_session_get_cb(), ossl_sslctx_set_ciphers(), ossl_str_new(), ossl_x509_to_der(), ossl_x509attr_get_value(), ossl_x509attr_to_der(), ossl_x509ext_to_der(), ossl_x509name_to_der(), ossl_x509req_to_der(), pack_pack(), parse(), proc_options(), push_include(), r_bytes0(), r_bytes1_buffered(), random_raw_seed(), rb_compile_cstr(), rb_digest_base_finish(), rb_enc_str_new(), rb_exc_new(), rb_execarg_commandline(), rb_execarg_parent_start1(), rb_execarg_run_options(), rb_f_backquote(), rb_file_dirname(), rb_file_join(), rb_file_s_basename(), rb_file_s_extname(), rb_gdbm_fetch(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_inflate_inflate(), rb_io_getline_fast(), rb_io_putc(), rb_io_ungetbyte(), rb_iseq_disasm(), rb_iseq_disasm_insn(), rb_nkf_convert(), rb_parser_compile_cstr(), rb_parser_printf(), rb_path_check(), rb_reg_compile(), rb_reg_quote(), rb_str_concat_literals(), rb_str_enumerate_lines(), rb_str_format(), rb_str_new_cstr(), rb_str_slice_bang(), rb_tainted_str_new(), rb_usascii_str_new(), rb_write_error2(), reg_named_captures_iter(), rsock_addrinfo_inspect_sockaddr(), rsock_ipaddr(), ruby_init_loadpath(), ruby_init_loadpath_safe(), s3e(), set_file_encoding(), set_option_encoding_once(), sock_s_gethostbyaddr(), sock_s_pack_sockaddr_in(), sock_s_unpack_sockaddr_in(), sock_sockaddr(), sock_sysaccept(), ssl_renegotiation_cb(), str_new(), strio_gets(), strio_putc(), strio_read(), strio_substr(), time_mdump(), zstream_detach_buffer(), zstream_detach_input(), and zstream_shift_buffer().
Definition at line 770 of file string.c.
References must_not_null(), rb_str_new(), and strlen().
Referenced by addrinfo_mdump(), cv_intern(), debug_deadlock_check(), decorate_convpath(), dir_inspect(), dump_output(), econv_convpath(), encoding_name(), etc_systmpdir(), finish_writeconv(), gc_profile_dump_on(), get_dns_server_list(), hist_to_s(), Init_readline(), inspect1(), load_file_internal(), opobj_inspect(), ossl_make_error(), prep_io(), process_options(), pty_getpty(), pty_open(), rb_econv_open_exc(), rb_exec_fillarg(), rb_file_expand_path_internal(), rb_file_open(), rb_insn_operand_intern(), rb_io_inspect(), rb_iseq_defined_string(), rb_load_file(), rb_parser_dump_tree(), rb_path2class(), rb_set_class_path(), rb_str_crypt(), rb_str_split(), rb_strftime_with_timespec(), rb_sys_fail_str(), rb_tainted_str_new_cstr(), rb_throw_obj(), rb_usascii_str_new_cstr(), rb_utf8_str_new_cstr(), ruby_eval_string_from_file(), ruby_eval_string_from_file_protect(), ruby_init_loadpath(), search_convpath_i(), sig_signame(), syserr_fail2_in(), time_zone_name(), and trace_lex_state().
Definition at line 1123 of file string.c.
References OBJ_FROZEN, OBJ_INFECT, rb_obj_class(), and str_new_frozen().
Referenced by hash_aset_str(), parser_compile_error(), parser_compile_string(), rb_check_argv(), rb_econv_prepare_options(), rb_econv_substr_append(), rb_file_open_generic(), rb_pat_search(), rb_set_class_path_string(), rb_str_drop_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_include_range_p(), rb_str_intern(), rb_str_subseq(), rb_thread_setname(), set_arg0(), str_byte_substr(), str_replace_shared_without_enc(), str_substr(), time_mload(), and yycompile().
Definition at line 1114 of file string.c.
References OBJ_INFECT, rb_obj_class(), and str_new_shared().
Referenced by mustbe_callable(), rb_file_s_basename(), and rb_str_subseq().
Definition at line 829 of file string.c.
References rb_cString, and str_new_static().
Definition at line 1230 of file string.c.
References rb_obj_class(), str_new0(), and TERM_LEN.
Referenced by rb_str_casemap(), rb_str_dump(), rb_str_ellipsize(), rb_str_reverse(), rb_str_subseq(), rb_str_succ(), str_byte_substr(), str_new_empty(), and str_substr().
Definition at line 8589 of file string.c.
References FALSE, and rb_str_to_inum().
Referenced by Init_String().
long rb_str_offset | ( | VALUE | str, |
long | pos | ||
) |
Definition at line 2266 of file string.c.
References RSTRING_END, RSTRING_PTR, single_byte_optimizable(), STR_ENC_GET, and str_offset().
Referenced by rb_str_rpartition(), and reg_match_pos().
Definition at line 8673 of file string.c.
References rb_enc_codepoint, RSTRING_END, RSTRING_PTR, STR_ENC_GET, and UINT2NUM.
Referenced by Init_String().
Definition at line 8921 of file string.c.
References get_pat_quoted(), INT2FIX, rb_ary_new3, rb_reg_search(), rb_str_index, rb_str_subpat(), rb_str_subseq(), RB_TYPE_P, RSTRING_LEN, str_new_empty(), and T_REGEXP.
Referenced by Init_String().
Definition at line 1800 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_AND, ENCODING_CODERANGE_SET, FL_SET_RAW, LONG_MAX, memcpy, OBJ_TAINTED_RAW, rb_cString, rb_eArgError, rb_enc_check_str(), rb_enc_mbminlen, rb_enc_to_index(), RB_GC_GUARD, rb_raise(), RSTRING_GETMEM, RSTRING_PTR, str_new0(), StringValue, and TERM_FILL.
Referenced by Init_String().
Definition at line 2967 of file string.c.
References argc, L, rb_enc_copy(), rb_str_append(), rb_str_tmp_new(), rb_str_update(), and str_modifiable().
Referenced by Init_String().
Definition at line 9619 of file string.c.
References Check_Type, len, NULL, RString::ptr, rb_default_external_encoding(), rb_default_internal_encoding(), rb_str_inspect(), rb_str_is_ascii_only_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, sym_printable(), and T_STRING.
Referenced by rb_id_quote_unprintable().
Definition at line 5097 of file string.c.
References str_discard(), str_modifiable(), str_replace(), and StringValue.
Referenced by Init_String(), rb_str_init(), and str_scrub_bang().
Definition at line 2562 of file string.c.
References RString::as, RString::capa, ENC_CODERANGE_CLEAR, len, MEMCPY, RString::ptr, rb_eArgError, rb_raise(), REALLOC_N, RSTRING, RSTRING_LEN, ruby_xfree(), STR_EMBED_P, STR_EMBEDDABLE_P, STR_HEAP_PTR, str_independent(), str_make_independent_expand(), STR_SET_EMBED, STR_SET_EMBED_LEN, TERM_FILL, and TERM_LEN.
Referenced by append_fspath(), appendline(), argf_getpartial(), argf_read(), big2str_generic(), BigDecimal_dump(), BigDecimal_inspect(), BigDecimal_split(), BigDecimal_to_s(), check_gid_switch(), copy_home_path(), copy_stream_body(), copy_stream_fallback_body(), do_opendir(), econv_primitive_convert(), flo_to_s(), glob_helper(), gzfile_error_inspect(), gzfile_readpartial(), join_path(), JSON_parse_string(), literal_concat0(), moreswitches(), new_regexp_gen(), ossl_cipher_update(), ossl_digest_finish(), ossl_ssl_read_internal(), push_include(), r_object0(), rb_econv_append(), rb_enc_vsprintf(), rb_feature_p(), rb_file_expand_path_internal(), rb_find_file_ext_safe(), rb_find_file_safe(), rb_gzfile_set_comment(), rb_gzfile_set_orig_name(), rb_io_getline_fast(), rb_iseq_disasm(), rb_marshal_dump_limited(), rb_nkf_putchar(), rb_reg_quote(), rb_reg_to_s(), rb_str_concat(), rb_str_format(), rb_str_freeze(), rb_str_vcatf(), rb_strftime_with_timespec(), realpath_rec(), ruby_init_loadpath(), ruby_init_loadpath_safe(), set_file_encoding(), setup_narg(), sock_sysaccept(), str_cat_conv_enc_opts(), str_shrink(), str_transcoding_resize(), strio_extend(), strio_init(), strio_read(), strio_truncate(), sym_inspect(), VpAlloc(), and w_nbyte().
Definition at line 1442 of file string.c.
References rb_cString, RSTRING_LEN, RUBY_DTRACE_CREATE_HOOK, str_duplicate(), and STRING.
Referenced by dump_result(), gzfile_raise(), gzfile_reader_get_unused(), obj_resurrect(), and rb_str_concat_literals().
Definition at line 5350 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, memcpy, OBJ_INFECT_RAW, rb_enc_asciicompat, rb_enc_fast_mbclen(), rb_enc_mbclen(), rb_str_dup(), rb_str_new_with_class(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), str_enc_copy(), STR_ENC_GET, and STR_SET_LEN.
Referenced by Init_String(), and rb_str_reverse_bang().
Definition at line 5409 of file string.c.
References rb_str_reverse(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), str_modify_keep_cr(), and str_shared_replace().
Referenced by Init_String().
Definition at line 3462 of file string.c.
References is_broken_string, len, memcmp(), rb_enc_check(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), str_nth(), str_rindex(), and str_strlen().
Referenced by rb_str_rindex_m(), and rb_str_rpartition().
Definition at line 3513 of file string.c.
References BUILTIN_TYPE, len, LONG2NUM, NIL_P, NUM2LONG, Qnil, rb_backref_set(), rb_check_string_type(), rb_eTypeError, rb_obj_classname(), rb_raise(), rb_reg_search(), rb_scan_args(), rb_str_rindex(), rb_str_sublen(), RB_TYPE_P, RSTRING_END, RSTRING_PTR, single_byte_optimizable(), SPECIAL_CONST_P, STR_ENC_GET, str_offset(), str_strlen(), sub, T_REGEXP, and T_STRING.
Referenced by Init_String().
Definition at line 8961 of file string.c.
References FALSE, NIL_P, rb_ary_new3, rb_backref_get(), rb_check_string_type(), rb_eTypeError, rb_obj_classname(), rb_raise(), rb_reg_nth_match(), rb_reg_search(), rb_str_offset(), rb_str_rindex(), rb_str_sublen(), rb_str_subseq(), RB_TYPE_P, RSTRING_LEN, str_new_empty(), T_REGEXP, and TRUE.
Referenced by Init_String().
Definition at line 8365 of file string.c.
References rb_str_dup(), rb_str_subseq(), RSTRING_GETMEM, rstrip_offset(), and STR_ENC_GET.
Referenced by Init_String().
Definition at line 8328 of file string.c.
References Qnil, rb_enc_mbminlen, RSTRING_GETMEM, rstrip_offset(), STR_ENC_GET, str_modify_keep_cr(), STR_SET_LEN, and TERM_FILL.
Referenced by Init_String().
Definition at line 2182 of file string.c.
References rb_check_string_type().
Referenced by Init_String().
Definition at line 8518 of file string.c.
References RString::ary, get_pat_quoted(), last, mustnot_broken(), NIL_P, rb_ary_new(), rb_ary_push(), rb_block_given_p(), rb_pat_search(), rb_yield(), result, RSTRING_LEN, RSTRING_PTR, scan_once(), and str_mod_check().
Referenced by Init_String().
str | the string to be scrubbed |
repl | the replacement character |
Definition at line 9232 of file string.c.
References ENC_CODERANGE, enc_str_scrub(), and STR_ENC_GET.
Referenced by str_scrub(), and str_scrub_bang().
void rb_str_set_len | ( | VALUE | str, |
long | len | ||
) |
Definition at line 2545 of file string.c.
References RString::capa, rb_bug(), rb_eRuntimeError, rb_raise(), RSTRING_PTR, str_capacity(), str_modifiable(), STR_SET_LEN, STR_SHARED_P, TERM_FILL, and TERM_LEN.
Referenced by append_wstr(), appendline(), check_gid_switch(), dedent_string(), econv_primitive_convert(), io_set_read_length(), load_transcoder_entry(), mustbe_callable(), ole_wc2vstr(), ossl_cipher_final(), ossl_cipher_update(), ossl_dh_compute_key(), ossl_dsa_sign(), ossl_hmac_digest(), ossl_pkey_sign(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_ssl_read_internal(), pack_pack(), pack_unpack_internal(), r_object0(), rb_big2str_generic(), rb_deflate_params(), rb_econv_append(), rb_execarg_parent_start1(), rb_execarg_run_options(), rb_file_expand_path_internal(), rb_file_join(), rb_find_file_ext_safe(), rb_io_getline_0(), rb_nkf_convert(), rb_realpath_internal(), rb_str_encode_ospath(), rb_str_format(), rb_strftime_with_timespec(), rb_sys_enc_warning(), rb_sys_warning(), read_all(), resize_buffer(), rsock_s_recvfrom(), rsock_s_recvfrom_nonblock(), rsock_strbuf(), ruby__sfvwrite(), ruby_init_loadpath_safe(), str_cat_conv_enc_opts(), str_transcode0(), strio_unget_bytes(), zstream_buffer_ungets(), zstream_run_func(), and zstream_shift_buffer().
Definition at line 5173 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_CLEAR, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, ISASCII, len, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, NUM2INT, NUM2LONG, RString::ptr, rb_eIndexError, rb_enc_left_char_head, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_raise(), RSTRING_LEN, RSTRING_PTR, STR_EMBEDDABLE_P, STR_ENC_GET, str_independent(), and str_make_independent().
Referenced by Init_String().
Definition at line 1314 of file string.c.
References str_shared_replace().
Referenced by str_encode_bang().
Definition at line 4616 of file string.c.
References argc, buf, NIL_P, rb_check_arity, rb_str_aref_m(), rb_str_aset_m(), rb_str_new(), result, and str_modify_keep_cr().
Referenced by Init_String().
Definition at line 4359 of file string.c.
References len, memmove(), MEMZERO, OBJ_INFECT, rb_str_drop_bytes(), rb_str_modify(), RESIZE_CAPA, RSTRING_GETMEM, RSTRING_LEN, RSTRING_PTR, STR_SET_LEN, TERM_FILL, and TERM_LEN.
Referenced by rb_str_subpat_set(), and rb_str_update().
Definition at line 7450 of file string.c.
References rb_str_new_cstr(), rb_str_split_m(), and StringValue.
Referenced by ossl_sslctx_set_ecdh_curves().
Definition at line 7241 of file string.c.
References ascii_isspace, BEG, BUILTIN_TYPE, END, get_pat_quoted(), is_ascii_string, len, mustnot_broken(), NIL_P, NUM2INT, re_registers::num_regs, RString::ptr, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_new(), rb_ary_new2, rb_ary_new3, rb_ary_pop(), rb_ary_push(), rb_backref_get(), rb_enc_ascget(), rb_enc_asciicompat, rb_enc_check(), rb_enc_codepoint_len(), rb_enc_fast_mbclen(), rb_enc_right_char_head, rb_eTypeError, rb_fs, rb_fs_check(), rb_isspace(), rb_memsearch(), rb_raise(), rb_reg_regcomp(), rb_reg_search(), rb_scan_args(), rb_str_subseq(), result, RMATCH_REGS, RSTRING_END, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, str_new_empty(), and T_STRING.
Referenced by Init_String(), and rb_str_split().
Definition at line 7016 of file string.c.
References rb_str_dup(), and rb_str_squeeze_bang().
Referenced by Init_String().
Definition at line 6925 of file string.c.
References argc, Qnil, rb_enc_asciicompat, rb_enc_check(), rb_enc_codepoint_len(), rb_enc_mbcput, RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), STR_ENC_GET, str_modify_keep_cr(), STR_SET_LEN, StringValue, TERM_FILL, TERM_LEN, tr_find(), tr_setup_table(), and TR_TABLE_SIZE.
Referenced by Init_String(), and rb_str_squeeze().
Definition at line 9011 of file string.c.
References argc, memcmp(), Qfalse, Qtrue, rb_enc_check(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_String().
Definition at line 8434 of file string.c.
References lstrip_offset(), rb_str_dup(), rb_str_subseq(), RSTRING_GETMEM, rstrip_offset(), and STR_ENC_GET.
Referenced by Init_String().
Definition at line 8391 of file string.c.
References lstrip_offset(), memmove(), Qnil, rb_enc_mbminlen, RSTRING_GETMEM, rstrip_offset(), STR_ENC_GET, str_modify_keep_cr(), STR_SET_LEN, and TERM_FILL.
Referenced by Init_String().
long rb_str_strlen | ( | VALUE | str | ) |
Definition at line 1735 of file string.c.
References NULL, and str_strlen().
Referenced by ibf_dump_pos().
Definition at line 4878 of file string.c.
References rb_str_dup(), and rb_str_sub_bang().
Referenced by Init_String().
Definition at line 4724 of file string.c.
References BEG, coderange_scan(), ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, END, FL_SET_RAW, get_pat_quoted(), hash(), len, match(), memcpy, memmove(), NIL_P, OBJ_TAINTED_RAW, Qnil, rb_backref_get(), rb_block_given_p(), rb_check_arity, rb_check_frozen, rb_check_hash_type(), rb_eEncCompatError, rb_enc_associate(), rb_enc_compatible(), rb_enc_name, rb_hash_aref(), rb_obj_as_string(), rb_pat_search(), rb_raise(), rb_reg_nth_match(), rb_reg_regsub(), rb_str_modify(), rb_str_subseq(), RB_TYPE_P, rb_yield(), RESIZE_CAPA, RMATCH_REGS, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, str_mod_check(), str_modifiable(), STR_SET_LEN, StringValue, T_STRING, TERM_FILL, and TERM_LEN.
Referenced by Init_String(), and rb_str_sub().
long rb_str_sublen | ( | VALUE | str, |
long | pos | ||
) |
Definition at line 2313 of file string.c.
References ENC_CODERANGE, enc_strlen(), RSTRING_PTR, single_byte_optimizable(), and STR_ENC_GET.
Referenced by rb_reg_match(), rb_reg_match2(), rb_str_aset(), rb_str_index_m(), rb_str_rindex_m(), rb_str_rpartition(), and readline_attempted_completion_function().
Definition at line 4200 of file string.c.
References match(), Qnil, rb_backref_get(), rb_reg_backref_number(), rb_reg_nth_match(), and rb_reg_search().
Referenced by rb_str_aref(), rb_str_aref_m(), and rb_str_partition().
Definition at line 4443 of file string.c.
References BEG, END, len, match(), re_registers::num_regs, rb_backref_get(), rb_eIndexError, rb_enc_associate(), rb_enc_check_str(), rb_raise(), rb_reg_backref_number(), rb_reg_search(), rb_str_splice_0(), RMATCH_REGS, and StringValue.
Referenced by rb_str_aset(), and rb_str_aset_m().
char* rb_str_subpos | ( | VALUE | str, |
long | beg, | ||
long * | lenp | ||
) |
Definition at line 2348 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_VALID, L, len, rb_enc_mbmaxlen, rb_enc_mbminlen, rb_enc_prev_char, RB_GC_GUARD, rb_utf8_encoding(), RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), STR_ENC_GET, str_nth_len(), str_offset(), str_strlen(), and str_substr().
Referenced by rb_reg_match_p(), and str_substr().
Definition at line 2324 of file string.c.
References len, OBJ_INFECT, rb_enc_cr_str_copy_for_substr(), RB_GC_GUARD, rb_str_new_frozen(), rb_str_new_shared(), rb_str_new_with_class(), RSTRING, RSTRING_LEN, RSTRING_PTR, SHARABLE_SUBSTRING_P, STR_EMBEDDABLE_P, and TERM_LEN.
Referenced by check_dirname(), enc_subseq(), features_index_add(), fole_missing(), lex_get_str(), match_array(), olerecord_ivar_set(), path_sub_ext(), rb_f_kill(), rb_file_s_extname(), rb_mod_const_defined(), rb_mod_const_get(), rb_path_to_class(), rb_realpath_internal(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_nth_match(), rb_reg_regsub(), rb_str_chomp(), rb_str_chop(), rb_str_ellipsize(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_lstrip(), rb_str_partition(), rb_str_rpartition(), rb_str_rstrip(), rb_str_split_m(), rb_str_strip(), rb_str_sub_bang(), rb_threadptr_error_print(), realpath_rec(), search_required(), str_gsub(), and trap_signm().
Definition at line 2435 of file string.c.
References str_substr(), and TRUE.
Referenced by rb_io_putc(), rb_str_aref(), rb_str_aref_m(), rb_str_chr(), set_state_ivars(), strio_putc(), and zstream_discard_input().
Definition at line 3889 of file string.c.
References OBJ_INFECT, rb_enc_cr_str_copy_for_substr(), rb_str_new_with_class(), RSTRING_LEN, RSTRING_PTR, and str_succ().
Referenced by Init_String(), and sym_succ().
Definition at line 3996 of file string.c.
References rb_str_modify(), and str_succ().
Referenced by Init_String().
Definition at line 8692 of file string.c.
References CHAR_BIT, FIXNUM_MAX, idLTLT, INT2FIX, len, LONG2FIX, mod, NUM2INT, RString::ptr, rb_funcall(), rb_scan_args(), RSTRING_LEN, RSTRING_PTR, and str_mod_check().
Referenced by Init_String().
Definition at line 6361 of file string.c.
References rb_str_dup(), and rb_str_swapcase_bang().
Referenced by Init_String(), and sym_swapcase().
Definition at line 6327 of file string.c.
References check_case_options(), ONIGENC_CASE_ASCII_ONLY, ONIGENC_CASE_DOWNCASE, ONIGENC_CASE_MODIFIED, ONIGENC_CASE_UPCASE, Qnil, rb_str_ascii_casemap(), rb_str_casemap(), rb_str_check_dummy_enc(), STR_ENC_GET, str_modify_keep_cr(), and str_shared_replace().
Referenced by Init_String(), and rb_str_swapcase().
int rb_str_symname_p | ( | VALUE | sym | ) |
Definition at line 9600 of file string.c.
References FALSE, len, NULL, RString::ptr, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_symname_p(), rb_str_is_ascii_only_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, strlen(), sym_printable(), and TRUE.
Referenced by id_to_name(), and sym_inspect().
Definition at line 1842 of file string.c.
References INT2FIX, len, LONG_MAX, memcpy, NUM2LONG, OBJ_INFECT, rb_eArgError, rb_enc_copy(), rb_enc_cr_str_copy_for_substr(), rb_obj_class(), rb_raise(), rb_str_dup(), RSTRING_LEN, RSTRING_PTR, str_alloc(), str_new0(), STR_SET_LEN, TERM_FILL, and TERM_LEN.
Referenced by Init_String().
Definition at line 1135 of file string.c.
References OBJ_FROZEN_RAW, OBJ_INFECT, and str_new_frozen().
Referenced by io_fwrite(), and rb_io_syswrite().
Definition at line 1148 of file string.c.
References RString::as, assert, FL_TEST_RAW, FL_UNSET_RAW, OBJ_FROZEN_RAW, rb_gc_force_recycle(), RBASIC, RBASIC_CLASS, RSTRING, RUBY_FL_FREEZE, RString::shared, STR_EMBED_P, STR_IS_SHARED_M, STR_NOFREE, STR_SHARED, and STR_TMPLOCK.
Referenced by io_fwrite(), and rb_io_syswrite().
VALUE rb_str_tmp_new | ( | long | len | ) |
Definition at line 1275 of file string.c.
References str_new().
Referenced by check_gid_switch(), ISEQ_ORIGINAL_ISEQ_ALLOC(), iseq_set_arguments_keywords(), moreswitches(), mustbe_callable(), rb_feature_p(), rb_find_file_ext_safe(), rb_find_file_safe(), rb_str_concat_multi(), rb_str_prepend_multi(), str_transcode0(), and VpAlloc().
Definition at line 5515 of file string.c.
References DBL2NUM, FALSE, and rb_str_to_dbl().
Referenced by Init_String().
Definition at line 5482 of file string.c.
References FALSE, NUM2INT, rb_eArgError, rb_raise(), rb_scan_args(), and rb_str_to_inum().
Referenced by Init_String().
Definition at line 5532 of file string.c.
References rb_cString, rb_enc_codelen(), rb_enc_mbcput, rb_enc_str_buf_cat(), rb_obj_class(), RUBY_MAX_CHAR_LEN, and str_duplicate().
Referenced by Init_String().
Definition at line 1305 of file string.c.
References rb_convert_type(), str_discard(), str_shared_replace(), and T_STRING.
Referenced by new_struct(), rb_gzfile_set_comment(), rb_gzfile_set_orig_name(), rb_string_value(), and reg_operand().
Definition at line 6729 of file string.c.
References rb_str_dup(), and tr_trans().
Referenced by Init_String().
Definition at line 7053 of file string.c.
References rb_str_dup(), and tr_trans().
Referenced by Init_String().
Definition at line 2528 of file string.c.
References FL_TEST, FL_UNSET, rb_eRuntimeError, rb_raise(), RUBY_FUNC_EXPORTED, and STR_TMPLOCK.
Referenced by rb_io_sysread(), rb_str_locktmp_ensure(), and readline_readline().
Definition at line 6143 of file string.c.
References rb_str_dup(), and rb_str_upcase_bang().
Referenced by Init_String(), and sym_upcase().
Definition at line 6096 of file string.c.
References check_case_options(), ENC_CODERANGE, ENC_CODERANGE_7BIT, ONIGENC_CASE_ASCII_ONLY, ONIGENC_CASE_FOLD_TURKISH_AZERI, ONIGENC_CASE_MODIFIED, ONIGENC_CASE_UPCASE, Qnil, rb_enc_isascii, rb_enc_mbmaxlen, rb_str_ascii_casemap(), rb_str_casemap(), rb_str_check_dummy_enc(), rb_utf8_encoding(), RSTRING_END, RSTRING_PTR, STR_ENC_GET, str_modify_keep_cr(), and str_shared_replace().
Referenced by Init_String(), and rb_str_upcase().
Definition at line 4396 of file string.c.
References assert, ENC_CODERANGE, ENC_CODERANGE_AND, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, rb_eIndexError, rb_enc_associate(), rb_enc_check(), rb_raise(), rb_str_splice_0(), RSTRING_END, RSTRING_PTR, single_byte_optimizable(), str_modify_keep_cr(), str_nth(), str_strlen(), and StringValue.
Referenced by rb_str_prepend_multi().
Definition at line 4055 of file string.c.
References Qnil, rb_scan_args(), RETURN_ENUMERATOR, RTEST, str_upto_each(), and str_upto_i().
Referenced by Init_String().
Definition at line 9129 of file string.c.
References ENC_CODERANGE_BROKEN, Qfalse, Qtrue, and rb_enc_str_coderange().
Referenced by Init_String().
Definition at line 2041 of file string.c.
References RString::ptr, rb_str_to_str(), RB_TYPE_P, and T_STRING.
Referenced by rb_string_value_cstr(), and rb_string_value_ptr().
char* rb_string_value_cstr | ( | volatile VALUE * | ptr | ) |
Definition at line 2132 of file string.c.
References len, rb_eArgError, rb_enc_get(), rb_enc_mbminlen, rb_raise(), rb_string_value(), RSTRING_LEN, RSTRING_PTR, str_fill_term(), and str_null_char().
char* rb_string_value_ptr | ( | volatile VALUE * | ptr | ) |
Definition at line 2052 of file string.c.
References rb_string_value(), and RSTRING_PTR.
Definition at line 3286 of file string.c.
References is_broken_string, len, rb_enc_check(), rb_enc_right_char_head, rb_memsearch(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), str_offset(), and str_strlen().
Referenced by rb_pat_search().
Definition at line 9716 of file string.c.
References rb_eArgError, rb_funcall_with_block(), rb_raise(), rb_sym_to_proc(), and sym.
Referenced by vm_yield_with_symbol(), and yield_under().
Definition at line 9693 of file string.c.
References rb_cString, rb_sym2str, and str_new_shared().
Referenced by Init_String().
Definition at line 853 of file string.c.
References OBJ_TAINT, and rb_str_new().
Referenced by env_rassoc(), fdbm_delete(), fdbm_delete_if(), fdbm_each_key(), fdbm_each_pair(), fdbm_each_value(), fdbm_fetch(), fdbm_invert(), fdbm_key(), fdbm_keys(), fdbm_select(), fdbm_shift(), fdbm_to_a(), fdbm_to_hash(), fdbm_values(), pack_unpack_internal(), rb_fiddle_ptr_aref(), rb_fiddle_ptr_to_s(), rb_fiddle_ptr_to_str(), and rsock_strbuf().
Definition at line 871 of file string.c.
References len, OBJ_TAINT, RString::ptr, rb_str_new_cstr(), and str_cat_conv_enc_opts().
Referenced by addrinfo_firstonly_new(), addrinfo_list_new(), and init_addrinfo_getaddrinfo().
|
static |
Definition at line 862 of file string.c.
References OBJ_TAINT, and rb_enc_str_new().
Referenced by rb_external_str_new_with_enc().
Definition at line 9979 of file string.c.
References rb_intern_str, string_for_symbol(), SYM2ID, and SYMBOL_P.
Referenced by enumerator_init(), lazy_add_method(), new_struct(), num_sadded(), ole_search_handler_method(), rb_f_trace_var(), rb_mod_alias_method(), rb_mod_autoload(), rb_mod_define_method(), rb_mod_modfunc(), and rb_thread_aset().
Definition at line 9989 of file string.c.
References name, rb_str_intern(), string_for_symbol(), and SYMBOL_P.
Referenced by obj_respond_to(), rb_struct_s_def(), rb_thread_variable_get(), and rb_thread_variable_set().
Definition at line 742 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, rb_str_new(), and rb_usascii_encindex().
Referenced by arg_ambiguous_gen(), big2str_alloc(), big2str_base_poweroftwo(), date__strptime(), flo_to_s(), hexencode_str_new(), int_chr(), nil_to_s(), pack_unpack_internal(), rb_ary_join(), rb_big2str_generic(), rb_fix2str(), rb_io_getline_0(), rb_str_ellipsize(), and strftimev().
Definition at line 777 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, rb_str_new_cstr(), and rb_usascii_encindex().
Referenced by eval_string_with_cref(), flo_to_s(), inspect_ary(), pruby_eval(), rb_locale_charmap(), str_upto_each(), and time_zone().
Definition at line 835 of file string.c.
References ENCINDEX_US_ASCII, rb_cString, and str_new_static().
Definition at line 750 of file string.c.
References rb_cString, rb_enc_associate_index(), rb_utf8_encindex(), and str_new().
Referenced by env_enc_str_new(), and ruby_init_loadpath_safe().
Definition at line 785 of file string.c.
References rb_enc_associate_index(), rb_str_new_cstr(), and rb_utf8_encindex().
Referenced by external_str_new_cstr(), and push_pattern().
Definition at line 841 of file string.c.
References ENCINDEX_UTF_8, rb_cString, and str_new_static().
Definition at line 332 of file string.c.
References assert, FL_EXIVAR, FL_TAINT, FL_TEST_RAW, fstr_update_callback(), OBJ_FROZEN, Qundef, rb_cString, rb_vm_fstring_table(), RBASIC_CLASS, st_data_t, st_update(), and STR_FAKESTR.
Referenced by mustnot_wchar(), rb_fstring(), rb_fstring_enc_new(), and rb_fstring_new().
|
static |
Definition at line 8287 of file string.c.
References ascii_isspace, NULL, rb_enc_codepoint, rb_enc_prev_char, rb_isspace(), rb_str_check_dummy_enc(), and single_byte_optimizable().
Referenced by rb_str_rstrip(), rb_str_rstrip_bang(), rb_str_strip(), and rb_str_strip_bang().
RUBY_ALIAS_FUNCTION | ( | rb_str_dup_frozen(VALUE str) | , |
rb_str_new_frozen | , | ||
(str) | |||
) |
Definition at line 2514 of file string.c.
References FL_SET, FL_TEST, rb_eRuntimeError, rb_raise(), and STR_TMPLOCK.
RUBY_ALIAS_FUNCTION | ( | rb_str_buf_cat(VALUE str, const char *ptr, long len) | , |
rb_str_cat | , | ||
(str, ptr, len) | |||
) |
Definition at line 2680 of file string.c.
References coderange_scan(), ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAN_P, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, ENCODING_CODERANGE_SET, ENCODING_GET, ENCODING_IS_ASCII8BIT, rb_eArgError, rb_eEncCompatError, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_name, rb_enc_str_coderange(), rb_raise(), rb_str_buf_cat(), RSTRING_LEN, and str_buf_cat().
Definition at line 8449 of file string.c.
References BEG, END, match(), re_registers::num_regs, Qnil, rb_ary_new2, rb_ary_push(), rb_backref_get(), rb_enc_fast_mbclen(), rb_pat_search(), rb_reg_nth_match(), result, RMATCH_REGS, RSTRING_END, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
Referenced by rb_str_scan().
Definition at line 438 of file string.c.
References nlz_intptr(), ntz_intptr(), NULL, UNALIGNED_WORD_ACCESS, and UNREACHABLE.
Referenced by coderange_scan(), enc_str_scrub(), enc_strlen(), rb_enc_cr_str_copy_for_substr(), rb_enc_strlen_cr(), rb_str_coderange_scan_restartable(), and str_nth_len().
|
static |
Definition at line 352 of file string.c.
References RString::basic, ENCODING_SET_INLINED, RBasic::flags, len, rb_cString, RBASIC_SET_CLASS_RAW, RSTRING_NOEMBED, STR_FAKESTR, STR_NOFREE, and T_STRING.
Referenced by rb_fstring_new(), and rb_setup_fake_str().
|
inlinestatic |
Definition at line 418 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, rb_enc_mbmaxlen, and STR_ENC_GET.
Referenced by lstrip_offset(), rb_str_casecmp(), rb_str_enumerate_codepoints(), rb_str_index_m(), rb_str_justify(), rb_str_offset(), rb_str_reverse(), rb_str_reverse_bang(), rb_str_rindex(), rb_str_rindex_m(), rb_str_squeeze_bang(), rb_str_sublen(), rb_str_subpos(), rb_str_update(), rb_strseq_index(), rstrip_offset(), str_strlen(), and tr_trans().
Definition at line 688 of file string.c.
References FL_WB_PROTECTED, NEWOBJ_OF, RGENGC_WB_PROTECTED_STRING, and T_STRING.
Referenced by empty_str_alloc(), rb_str_b(), rb_str_buf_new(), rb_str_times(), str_duplicate(), str_new0(), str_new_frozen(), str_new_shared(), and str_new_static().
Definition at line 2614 of file string.c.
References assert, RString::capa, len, LONG_MAX, memcpy, rb_eArgError, rb_raise(), rb_str_modify(), RESIZE_CAPA_TERM, RSTRING, RSTRING_EMBED_LEN, RSTRING_EMBED_LEN_MAX, RSTRING_GETMEM, RSTRING_PTR, STR_EMBED_P, STR_SET_LEN, TERM_FILL, and TERM_LEN.
Referenced by rb_str_cat(), rb_str_escape(), rb_str_inspect(), and RUBY_ALIAS_FUNCTION().
Definition at line 5281 of file string.c.
References FALSE, FIX2LONG, FIXNUM_P, NUM2LONG, Qfalse, Qnil, rb_range_beg_len(), RSTRING_LEN, str_byte_substr(), and TRUE.
Referenced by rb_str_byteslice().
Definition at line 5225 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, len, OBJ_INFECT_RAW, Qnil, rb_enc_asciicompat, rb_obj_class(), rb_str_new_frozen(), rb_str_new_with_class(), RSTRING, RSTRING_LEN, RSTRING_PTR, SHARABLE_SUBSTRING_P, STR_EMBEDDABLE_P, str_enc_copy(), STR_ENC_GET, str_new_shared(), and TERM_LEN.
Referenced by rb_str_byteslice(), and str_byte_aref().
Definition at line 660 of file string.c.
References FL_TEST, RSTRING, RSTRING_EMBED_LEN_MAX, STR_EMBED_P, STR_NOFREE, and STR_SHARED.
Referenced by rb_str_capacity(), rb_str_change_terminator_length(), rb_str_set_len(), and str_fill_term().
|
static |
Definition at line 935 of file string.c.
References DATA_PTR, dp, econv_destination_buffer_full, econv_finished, LONG_MAX, OnigEncodingTypeST::name, Qnil, rb_cEncodingConverter, rb_econv_close(), rb_econv_convert(), rb_econv_open_opts(), rb_enc_associate(), rb_gc_force_recycle(), rb_obj_alloc(), rb_str_capacity(), rb_str_resize(), rb_str_set_len(), RBASIC_CLEAR_CLASS, and RSTRING_PTR.
Referenced by rb_str_cat_conv_enc_opts(), rb_str_conv_enc_opts(), and rb_tainted_str_new_cstr().
|
static |
Definition at line 9206 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, enc_str_scrub(), PRIsVALUE, rb_eArgError, rb_eEncCompatError, rb_enc_mbminlen, rb_enc_name, rb_enc_str_coderange(), rb_raise(), STR_ENC_GET, and StringValue.
Referenced by enc_str_scrub().
|
inlinestatic |
Definition at line 1931 of file string.c.
References FL_TEST, STR_EMBED_P, STR_NOFREE, and STR_SHARED.
Referenced by rb_str_change_terminator_length(), str_fill_term(), and str_independent().
|
inlinestatic |
Definition at line 2021 of file string.c.
References FL_TEST, RSTRING, ruby_sized_xfree(), STR_EMBED_P, STR_HEAP_PTR, STR_HEAP_SIZE, str_modifiable(), STR_NOFREE, and STR_SHARED.
Referenced by rb_str_clear(), rb_str_replace(), rb_str_to_str(), and str_shared_replace().
Definition at line 1404 of file string.c.
References RString::as, ENC_CODERANGE_MASK, ENCODING_MASK, FL_FREEZE, FL_SET_RAW, FL_TAINT, FL_TEST_RAW, MEMCPY, RB_OBJ_WRITE, RSTRING, RSTRING_EMBED_LEN_MASK, RSTRING_EMBED_LEN_MAX, RSTRING_NOEMBED, str_alloc(), str_new_frozen(), STR_NOEMBED, STR_SHARED, and UNLIKELY.
Referenced by rb_str_dup(), rb_str_resurrect(), and rb_str_to_s().
Definition at line 577 of file string.c.
References ENCODING_GET, and rb_enc_set_index().
Referenced by rb_enc_cr_str_copy_for_substr(), rb_enc_cr_str_exact_copy(), rb_str_casemap(), rb_str_reverse(), and str_byte_substr().
Definition at line 3077 of file string.c.
References memcmp(), Qfalse, Qtrue, rb_str_comparable(), RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_str_eql(), and rb_str_equal().
|
static |
Definition at line 2079 of file string.c.
References RString::capa, L, rb_check_lockedtmp(), RSTRING_PTR, str_capacity(), str_dependent_p(), str_make_independent_expand(), TERM_FILL, and zero_filled().
Referenced by rb_str_fill_terminator(), and rb_string_value_cstr().
Definition at line 4886 of file string.c.
References BEG, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, END, FL_SET_RAW, get_pat_quoted(), hash(), last, len, match(), NIL_P, OBJ_TAINTED_RAW, Qnil, rb_backref_get(), rb_check_arity, rb_check_hash_type(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_fast_mbclen(), rb_enc_str_buf_cat(), rb_eRuntimeError, rb_hash_aref(), rb_obj_as_string(), rb_obj_class(), rb_pat_search(), rb_raise(), rb_reg_nth_match(), rb_reg_regsub(), rb_str_buf_append(), rb_str_buf_new(), rb_str_dup(), rb_str_subseq(), RB_TYPE_P, rb_yield(), RBASIC_SET_CLASS, RETURN_ENUMERATOR, RMATCH_REGS, RSTRING_END, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, str_mod_check(), str_shared_replace(), StringValue, T_STRING, and val.
Referenced by rb_str_gsub(), and rb_str_gsub_bang().
|
inlinestatic |
Definition at line 1942 of file string.c.
References str_dependent_p(), and str_modifiable().
Referenced by rb_str_modify(), rb_str_modify_expand(), rb_str_resize(), rb_str_setbyte(), and str_modify_keep_cr().
|
inlinestatic |
Definition at line 186 of file string.c.
References L, len, RSTRING_LEN, str_make_independent_expand(), and TERM_LEN.
Referenced by fstr_update_callback(), rb_str_modify(), rb_str_setbyte(), and str_modify_keep_cr().
|
static |
Definition at line 1949 of file string.c.
References ALLOC_N, RString::as, RString::capa, FL_UNSET, len, memcpy, RString::ptr, RSTRING, RSTRING_PTR, STR_EMBED_P, STR_EMBEDDABLE_P, STR_NOFREE, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, STR_SHARED, and TERM_FILL.
Referenced by rb_str_change_terminator_length(), rb_str_modify_expand(), rb_str_resize(), str_fill_term(), and str_make_independent().
Definition at line 652 of file string.c.
References rb_eRuntimeError, rb_raise(), RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_str_enumerate_lines(), rb_str_scan(), rb_str_sub_bang(), rb_str_sum(), and str_gsub().
|
inlinestatic |
Definition at line 1924 of file string.c.
References rb_check_frozen, and rb_check_lockedtmp().
Referenced by rb_str_concat_multi(), rb_str_drop_bytes(), rb_str_force_encoding(), rb_str_init(), rb_str_prepend_multi(), rb_str_replace(), rb_str_set_len(), rb_str_sub_bang(), str_discard(), and str_independent().
|
static |
Definition at line 2011 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_BROKEN, ENC_CODERANGE_CLEAR, str_independent(), and str_make_independent().
Referenced by rb_str_capitalize_bang(), rb_str_chomp_bang(), rb_str_chop_bang(), rb_str_delete_bang(), rb_str_downcase_bang(), rb_str_gsub_bang(), rb_str_lstrip_bang(), rb_str_reverse_bang(), rb_str_rstrip_bang(), rb_str_slice_bang(), rb_str_squeeze_bang(), rb_str_strip_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), rb_str_update(), and tr_trans().
Definition at line 730 of file string.c.
References str_new0().
Referenced by rb_str_new(), rb_str_tmp_new(), rb_utf8_str_new(), and str_new_frozen().
Definition at line 702 of file string.c.
References ALLOC_N, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, len, memcpy, rb_eArgError, rb_raise(), RSTRING, RSTRING_PTR, RUBY_DTRACE_CREATE_HOOK, str_alloc(), STR_EMBEDDABLE_P, STR_SET_LEN, STR_SET_NOEMBED, STRING, and TERM_FILL.
Referenced by rb_enc_str_new(), rb_str_justify(), rb_str_new_with_class(), rb_str_plus(), rb_str_times(), str_new(), and str_new_static().
Definition at line 1236 of file string.c.
References OBJ_INFECT, rb_enc_copy(), and rb_str_new_with_class().
Referenced by rb_str_partition(), rb_str_rpartition(), and rb_str_split_m().
Definition at line 1174 of file string.c.
References assert, ENCODING_GET, FL_SET_RAW, FL_TAINT, FL_TEST_RAW, FL_UNSET_RAW, memcpy, OBJ_FREEZE, OBJ_FROZEN, rb_enc_cr_str_exact_copy(), RBASIC, RBASIC_CLASS, RSTRING, RSTRING_END, RSTRING_LEN, RSTRING_PTR, RString::shared, str_alloc(), STR_EMBED_P, STR_EMBEDDABLE_P, STR_IS_SHARED_M, str_new(), str_new_shared(), STR_NOFREE, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, STR_SET_SHARED, STR_SHARED, TERM_FILL, and TERM_LEN.
Referenced by fstr_update_callback(), rb_str_new_frozen(), rb_str_tmp_frozen_acquire(), and str_duplicate().
Definition at line 1108 of file string.c.
References str_alloc(), and str_replace_shared().
Referenced by rb_str_new_shared(), rb_sym_to_s(), str_byte_substr(), str_new_frozen(), and str_substr().
Definition at line 803 of file string.c.
References len, rb_eArgError, rb_enc_associate_index(), rb_enc_get_from_index(), rb_enc_mbminlen, rb_raise(), RBASIC, RSTRING, RUBY_DTRACE_CREATE_HOOK, str_alloc(), str_new0(), STR_NOFREE, STR_SET_NOEMBED, and STRING.
Referenced by fstr_update_callback(), rb_enc_str_new_static(), rb_str_new_static(), rb_usascii_str_new_static(), and rb_utf8_str_new_static().
|
static |
Definition at line 2244 of file string.c.
References str_nth_len().
Referenced by rb_str_rindex(), rb_str_update(), and str_offset().
|
static |
Definition at line 2188 of file string.c.
References ISASCII, rb_enc_asciicompat, rb_enc_mbclen(), rb_enc_mbmaxlen, rb_enc_mbminlen, and search_nonascii().
Referenced by rb_enc_nth(), rb_str_subpos(), and str_nth().
|
static |
Definition at line 2068 of file string.c.
References len, rb_enc_mbclen(), and zero_filled().
Referenced by rb_string_value_cstr().
|
static |
Definition at line 2258 of file string.c.
References str_nth().
Referenced by rb_str_index_m(), rb_str_justify(), rb_str_offset(), rb_str_rindex_m(), rb_str_subpos(), and rb_strseq_index().
Definition at line 1381 of file string.c.
References assert, len, OBJ_FROZEN, OBJ_INFECT, rb_enc_cr_str_exact_copy(), RSTRING, RSTRING_LEN, RSTRING_PTR, RString::shared, str_replace_shared(), STR_SET_NOEMBED, STR_SET_SHARED, and STR_SHARED_P.
Referenced by rb_str_replace().
Definition at line 1100 of file string.c.
References rb_enc_cr_str_exact_copy(), and str_replace_shared_without_enc().
Referenced by str_new_shared(), and str_replace().
Definition at line 1074 of file string.c.
References FL_SET, len, memcpy, RString::ptr, rb_str_new_frozen(), RSTRING, RSTRING_GETMEM, RSTRING_PTR, STR_EMBEDDABLE_P, STR_NOEMBED, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_SHARED, TERM_FILL, and TERM_LEN.
Referenced by rb_fstring(), rb_str_b(), and str_replace_shared().
|
static |
Definition at line 3438 of file string.c.
References memcmp(), rb_enc_prev_char, RSTRING_END, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_str_index_m(), and rb_str_rindex().
Definition at line 9509 of file string.c.
References NIL_P, Qnil, rb_check_arity, rb_str_dup(), and rb_str_scrub().
Referenced by Init_String().
Definition at line 9531 of file string.c.
References NIL_P, Qnil, rb_check_arity, rb_str_replace(), and rb_str_scrub().
Referenced by Init_String().
Definition at line 1320 of file string.c.
References ASSUME, ENC_CODERANGE, ENC_CODERANGE_SET, FL_TEST, FL_UNSET, memcpy, OBJ_INFECT, rb_enc_associate(), rb_enc_mbminlen, RSTRING, RSTRING_LEN, RSTRING_PTR, RString::shared, str_discard(), STR_EMBEDDABLE_P, STR_ENC_GET, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, STR_SET_SHARED, and STR_SHARED.
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), rb_str_reverse_bang(), rb_str_shared_replace(), rb_str_swapcase_bang(), rb_str_to_str(), rb_str_upcase_bang(), and str_gsub().
|
static |
Definition at line 1713 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, enc_strlen(), rb_enc_strlen_cr(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), and STR_ENC_GET.
Referenced by rb_str_aref(), rb_str_aset(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_index_m(), rb_str_justify(), rb_str_length(), rb_str_rindex(), rb_str_rindex_m(), rb_str_strlen(), rb_str_subpos(), rb_str_update(), and rb_strseq_index().
Definition at line 2441 of file string.c.
References len, OBJ_INFECT, Qnil, rb_enc_cr_str_copy_for_substr(), RB_GC_GUARD, rb_obj_class(), rb_str_new_frozen(), rb_str_new_with_class(), rb_str_subpos(), RSTRING, RSTRING_END, RSTRING_PTR, SHARABLE_SUBSTRING_P, STR_EMBEDDABLE_P, str_new_shared(), and TERM_LEN.
Referenced by rb_str_aref(), rb_str_subpos(), and rb_str_substr().
Definition at line 3899 of file string.c.
References enc_succ_alnum_char(), enc_succ_char(), ISALPHA, ISDIGIT, MEMCPY, memmove(), NEIGHBOR_FOUND, NEIGHBOR_NOT_CHAR, NEIGHBOR_WRAPPED, ONIGENC_CODE_TO_MBC_MAXLEN, ONIGENC_MBCLEN_CHARFOUND_LEN, ONIGENC_MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_prev_char, rb_enc_str_coderange(), RESIZE_CAPA, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, STR_SET_LEN, and TERM_FILL.
Referenced by enc_succ_alnum_char(), rb_str_succ(), and rb_str_succ_bang().
Definition at line 2504 of file string.c.
References OBJ_FROZEN, rb_str_dup(), and rb_str_freeze().
Referenced by Init_String().
Definition at line 2484 of file string.c.
References OBJ_FROZEN, and rb_str_dup().
Referenced by Init_String().
|
static |
Definition at line 4065 of file string.c.
References all_digits_p(), CONST_ID, FALSE, FIX2LONG, FIXNUM_P, idLE, INT2FIX, is_ascii_string, ISDIGIT, NIL_P, numberof, Qnil, rb_enc_check(), rb_enc_sprintf(), rb_enc_str_new(), rb_funcall(), rb_funcallv, rb_obj_freeze(), rb_str_cmp(), rb_str_dup(), rb_str_equal(), rb_str_format(), rb_str_to_inum(), rb_usascii_encoding(), rb_usascii_str_new_cstr(), RSTRING_LEN, RSTRING_LENINT, RSTRING_PTR, and StringValue.
Referenced by all_digits_p(), rb_str_include_range_p(), and rb_str_upto().
Definition at line 9965 of file string.c.
References name, NIL_P, PRIsVALUE, rb_check_string_type(), rb_eTypeError, rb_raise(), RB_TYPE_P, and T_STRING.
Referenced by rb_to_id(), and rb_to_symbol().
Definition at line 9867 of file string.c.
References rb_str_aref_m(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9933 of file string.c.
References rb_str_capitalize(), rb_str_intern(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9791 of file string.c.
References Qnil, rb_str_casecmp(), rb_sym2str, and SYMBOL_P.
Referenced by Init_String().
Definition at line 9809 of file string.c.
References Qnil, rb_str_casecmp_p(), rb_sym2str, and SYMBOL_P.
Referenced by Init_String().
Definition at line 9772 of file string.c.
References Qnil, rb_str_cmp_m(), rb_sym2str, and SYMBOL_P.
Referenced by Init_String().
Definition at line 9920 of file string.c.
References rb_str_downcase(), rb_str_intern(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9894 of file string.c.
References rb_str_empty(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9959 of file string.c.
References rb_obj_encoding(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9655 of file string.c.
References len, memcpy, memmove(), RString::ptr, rb_enc_str_new(), rb_str_inspect(), rb_str_resize(), rb_str_symname_p(), rb_sym2str, RSTRING_GETMEM, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
Referenced by Init_String().
Definition at line 9881 of file string.c.
References rb_str_length(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9825 of file string.c.
References rb_str_match(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9838 of file string.c.
References rb_str_match_m(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9851 of file string.c.
References rb_str_match_m_p().
Referenced by Init_String().
|
static |
Definition at line 9584 of file string.c.
References FALSE, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_enc_isprint, rb_enc_mbc_to_codepoint, rb_enc_precise_mbclen(), and TRUE.
Referenced by rb_str_quote_unprintable(), and rb_str_symname_p().
Definition at line 9752 of file string.c.
References rb_str_intern(), rb_str_succ(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9946 of file string.c.
References rb_str_intern(), rb_str_swapcase(), and rb_sym2str.
Referenced by Init_String().
Definition at line 9907 of file string.c.
References rb_str_intern(), rb_str_upcase(), and rb_sym2str.
Referenced by Init_String().
|
static |
Definition at line 6802 of file string.c.
References FALSE, NIL_P, rb_hash_lookup(), TRUE, and UINT2NUM.
Referenced by rb_str_count(), rb_str_delete_bang(), and rb_str_squeeze_bang().
|
static |
Definition at line 6738 of file string.c.
References buf, tr::gen, key, tr::max, NIL_P, tr::now, tr::p, tr::pend, Qtrue, rb_enc_ascget(), rb_hash_aref(), rb_hash_aset(), rb_hash_new(), RSTRING_LEN, RSTRING_PTR, trnext(), and UINT2NUM.
Referenced by rb_str_count(), rb_str_delete_bang(), and rb_str_squeeze_bang().
Definition at line 6433 of file string.c.
References ALLOC_N, buf, CHECK_IF_ASCII, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, tr::gen, hash(), last, max(), tr::max, memcmp(), NIL_P, tr::now, NUM2INT, tr::p, tr::pend, Qnil, Qtrue, rb_enc_ascget(), rb_enc_associate(), rb_enc_check(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_mbcput, rb_enc_mbmaxlen, rb_enc_mbminlen, rb_hash_aset(), rb_hash_lookup(), rb_hash_new(), rb_str_delete_bang(), REALLOC_N, RSTRING, RSTRING_END, RSTRING_LEN, RSTRING_PTR, ruby_sized_xfree(), single_byte_optimizable(), STR_EMBED_P, STR_HEAP_PTR, STR_HEAP_SIZE, str_modify_keep_cr(), STR_SET_NOEMBED, StringValue, TERM_FILL, trnext(), and UINT2NUM.
Referenced by rb_str_tr(), rb_str_tr_bang(), rb_str_tr_s(), and rb_str_tr_s_bang().
|
static |
Definition at line 6377 of file string.c.
References tr::gen, tr::max, tr::now, ONIGENC_CODE_TO_MBCLEN, tr::p, tr::pend, rb_eArgError, rb_enc_ascget(), rb_enc_codepoint_len(), rb_raise(), and rb_str_delete_bang().
Referenced by tr_setup_table(), and tr_trans().
|
static |
Definition at line 2059 of file string.c.
Referenced by str_fill_term(), and str_null_char().
|
static |
VALUE rb_cString |
Definition at line 65 of file string.c.
Referenced by fstr_update_callback(), Init_String(), rb_enc_str_new(), rb_enc_str_new_static(), rb_str_b(), rb_str_buf_new(), rb_str_new(), rb_str_new_static(), rb_str_plus(), rb_str_resurrect(), rb_str_to_s(), rb_sym_to_s(), rb_usascii_str_new_static(), rb_utf8_str_new(), rb_utf8_str_new_static(), register_fstring(), and setup_fake_str().
VALUE rb_cSymbol |
Definition at line 66 of file string.c.
Referenced by Init_String().
VALUE rb_fs |
Definition at line 435 of file string.c.
Referenced by Init_String(), and rb_str_split_m().
const struct st_hash_type rb_fstring_hash_type |
|
static |
Definition at line 194 of file string.c.
Referenced by check_case_options(), and Init_String().
|
static |
Definition at line 194 of file string.c.
Referenced by check_case_options(), Init_String(), and rb_str_casecmp_p().
|
static |
Definition at line 194 of file string.c.
Referenced by check_case_options(), and Init_String().
|
static |
Definition at line 194 of file string.c.
Referenced by check_case_options(), and Init_String().