Ruby
2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
|
#include "ruby/encoding.h"
#include "ruby/re.h"
#include "internal.h"
#include "encindex.h"
#include "probes.h"
#include "gc.h"
#include "ruby_assert.h"
#include "id.h"
#include "debug_counter.h"
#include "ruby/util.h"
#include <errno.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 | RUBY_MAX_CHAR_LEN 16 |
#define | STR_SHARED_ROOT FL_USER5 |
#define | STR_BORROWED 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_EXIVAR) && RBASIC_CLASS(str) == rb_cString) |
#define | aligned_ptr(value) (uintptr_t *)(value) |
#define | STR_BUF_MIN_SIZE 63 |
#define | rb_str_dup_frozen rb_str_new_frozen |
#define | str_buf_cat2(str, ptr) str_buf_cat((str), (ptr), strlen(ptr)) |
#define | MIN_PRE_ALLOC_SIZE 48 |
#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 | SPLIT_STR(beg, len) (empty_count = split_string(result, str, beg, len, empty_count)) |
#define | WANTARRAY(m, size) (!rb_block_given_p() ? rb_ary_new_capa(size) : 0) |
#define | ENUM_ELEM(ary, e) enumerator_element(ary, e) |
#define | CHARS_16BE(x) (OnigUChar)((x)>>8), (OnigUChar)(x) |
#define | CHARS_16LE(x) (OnigUChar)(x), (OnigUChar)((x)>>8) |
#define | CHARS_32BE(x) CHARS_16BE((x)>>16), CHARS_16BE(x) |
#define | CHARS_32LE(x) CHARS_16LE(x), CHARS_16LE((x)>>16) |
#define | CASE_UTF(e) |
#define | CRYPT_END() ALLOCV_END(databuf) |
#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 |
const struct st_hash_type | rb_fstring_hash_type |
VALUE | rb_fs |
#define aligned_ptr | ( | value | ) | (uintptr_t *)(value) |
#define BARE_STRING_P | ( | str | ) | (!FL_ANY_RAW(str, FL_EXIVAR) && RBASIC_CLASS(str) == rb_cString) |
#define CASE_UTF | ( | e | ) |
#define CHARS_32BE | ( | x | ) | CHARS_16BE((x)>>16), CHARS_16BE(x) |
#define CHARS_32LE | ( | x | ) | CHARS_16LE(x), CHARS_16LE((x)>>16) |
#define CHECK_IF_ASCII | ( | c | ) |
#define CRYPT_END | ( | ) | ALLOCV_END(databuf) |
#define DEFAULT_REPLACE_CHAR | ( | str | ) |
#define IS_EVSTR | ( | p, | |
e | |||
) | ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{')) |
#define rb_intern | ( | str | ) | rb_intern_const(str) |
#define rb_str_dup_frozen rb_str_new_frozen |
#define rb_str_splice | ( | str, | |
beg, | |||
len, | |||
val | |||
) | rb_str_update(str, beg, len, val) |
#define RESIZE_CAPA | ( | str, | |
capacity | |||
) |
#define RESIZE_CAPA_TERM | ( | str, | |
capacity, | |||
termlen | |||
) |
#define STR_DEC_LEN | ( | str | ) |
#define STR_EMBEDDABLE_P | ( | len, | |
termlen | |||
) | ((len) <= RSTRING_EMBED_LEN_MAX + 1 - (termlen)) |
#define STR_SET_EMBED | ( | str | ) | FL_UNSET((str), (STR_NOEMBED|STR_NOFREE)) |
#define STR_SET_NOEMBED | ( | str | ) |
#define STR_SET_SHARED | ( | str, | |
shared_str | |||
) |
#define TERM_FILL | ( | ptr, | |
termlen | |||
) |
#define TERM_LEN | ( | str | ) | rb_enc_mbminlen(rb_enc_get(str)) |
#define WANTARRAY | ( | m, | |
size | |||
) | (!rb_block_given_p() ? rb_ary_new_capa(size) : 0) |
typedef struct mapping_buffer mapping_buffer |
enum neighbor_char |
Definition at line 11201 of file string.c.
References assert, rb_cObject, rb_cString, rb_define_class(), rb_vm_fstring_table(), and st_foreach().
Definition at line 2314 of file string.c.
References idTo_str, rb_check_convert_type_with_id(), str, and T_STRING.
Referenced by rb_check_id(), rb_str_include_range_p(), rb_String(), and rb_time_zone_abbreviation().
Definition at line 2388 of file string.c.
Referenced by rb_str_ellipsize().
Definition at line 678 of file string.c.
References ENC_CODERANGE_7BIT, FALSE, rb_enc_asciicompat, rb_enc_str_coderange(), str, STR_ENC_GET, and TRUE.
Referenced by rb_inspect(), and rb_reg_quote().
Definition at line 2919 of file string.c.
References ENC_CODERANGE_UNKNOWN, len, NULL, ptr, rb_enc_to_index(), and str.
Referenced by rb_reg_regsub().
Definition at line 657 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_UNKNOWN, ENCODING_GET, rb_enc_dummy_p(), rb_enc_from_index(), rb_enc_mbminlen, and str.
Referenced by rb_enc_str_asciionly_p(), rb_external_str_with_enc(), rb_str_comparable(), and rb_str_hash().
VALUE rb_enc_str_new | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 796 of file string.c.
References len, ptr, rb_str_new(), and str.
Referenced by rb_enc_uint_chr(), rb_external_str_new_with_enc(), rb_syntax_error_append(), and rb_w32_conv_from_wchar().
VALUE rb_enc_str_new_cstr | ( | const char * | ptr, |
rb_encoding * | enc | ||
) |
VALUE rb_enc_str_new_static | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
VALUE rb_enc_str_scrub | ( | rb_encoding * | enc, |
VALUE | str, | ||
VALUE | repl | ||
) |
Definition at line 10255 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_UNKNOWN, str, and STR_ENC_GET.
Definition at line 1749 of file string.c.
References rb_enc_mbmaxlen, and rb_enc_mbminlen.
Definition at line 1087 of file string.c.
References len, ptr, rb_default_external_encoding(), and rb_external_str_new_with_enc().
Definition at line 1093 of file string.c.
References ptr, rb_default_external_encoding(), rb_external_str_new_with_enc(), and strlen().
VALUE rb_external_str_new_with_enc | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | eenc | ||
) |
Definition at line 1036 of file string.c.
References len, ptr, rb_ascii8bit_encindex(), rb_enc_str_new(), rb_enc_to_index(), rb_usascii_encindex(), and str.
Referenced by 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 1074 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(), rb_usascii_encindex(), and str.
Definition at line 1111 of file string.c.
References len, ptr, rb_external_str_new_with_enc(), and rb_filesystem_encoding().
Definition at line 1117 of file string.c.
References ptr, rb_external_str_new_with_enc(), rb_filesystem_encoding(), and strlen().
Referenced by rb_parser_compile_string().
RUBY_FUNC_EXPORTED VALUE rb_fstring | ( | VALUE | str | ) |
Definition at line 312 of file string.c.
References assert, BARE_STRING_P, Check_Type, FL_TEST, FL_TEST_RAW, OBJ_FREEZE_RAW, OBJ_FROZEN, rb_str_resize(), RSTRING_FSTR, RSTRING_LEN, str, STR_EMBED_P, STR_NOEMBED, STR_SHARED, STR_SHARED_ROOT, and T_STRING.
Referenced by rb_hash_key_str(), rb_iseq_pathobj_new(), rb_node_case_when_optimizable_literal(), and rb_parser_lex_state_name().
Definition at line 410 of file string.c.
References ptr, rb_fstring_new(), and strlen().
VALUE rb_fstring_enc_new | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
MJIT_FUNC_EXPORTED VALUE rb_fstring_new | ( | const char * | ptr, |
long | len | ||
) |
Definition at line 396 of file string.c.
Referenced by rb_fstring_cstr().
MJIT_FUNC_EXPORTED VALUE rb_id_quote_unprintable | ( | ID | id | ) |
Definition at line 10735 of file string.c.
References rb_id2str, rb_str_inspect(), rb_str_symname_p(), and str.
Definition at line 1099 of file string.c.
References len, ptr, rb_external_str_new_with_enc(), and rb_locale_encoding().
Definition at line 1105 of file string.c.
References ptr, rb_external_str_new_with_enc(), rb_locale_encoding(), and strlen().
Definition at line 2166 of file string.c.
References rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, rb_raise(), and str.
Referenced by rb_str_convert_to_inum().
Definition at line 1440 of file string.c.
References idTo_s, obj, rb_funcall, rb_obj_as_string_result(), RB_TYPE_P, str, and T_STRING.
Referenced by rb_inspect(), and rb_p().
MJIT_FUNC_EXPORTED VALUE rb_obj_as_string_result | ( | VALUE | str, |
VALUE | obj | ||
) |
Definition at line 1452 of file string.c.
References obj, rb_any_to_s(), RB_TYPE_P, str, and T_STRING.
Referenced by rb_obj_as_string().
VALUE rb_setup_fake_str | ( | struct RString * | fake_str, |
const char * | name, | ||
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 385 of file string.c.
Referenced by rb_check_id_cstr(), rb_check_symbol_cstr(), rb_intern3(), rb_sym_intern(), ruby_marshal_read_long(), and ruby_require_internal().
Definition at line 2965 of file string.c.
References rb_str_buf_append(), str, and StringValue().
Referenced by rb_keyword_error_new(), rb_load_fail(), rb_str_concat(), and rb_str_ellipsize().
Definition at line 2950 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, ENCODING_GET, RSTRING_LEN, RSTRING_PTR, and str.
Referenced by rb_str_append().
Definition at line 2926 of file string.c.
References ALLOCA_N, buf, char, ENC_CODERANGE_7BIT, ENC_CODERANGE_VALID, ENCODING_GET, len, ptr, rb_enc_asciicompat, rb_enc_codelen(), rb_enc_from_index(), rb_enc_mbcput, rb_enc_mbmaxlen, str, and strlen().
Definition at line 1315 of file string.c.
References str.
Referenced by rb_econv_append(), rb_reg_regsub(), rb_str_buf_new_cstr(), and rb_str_concat_literals().
Definition at line 1331 of file string.c.
References len, ptr, rb_str_buf_cat, rb_str_buf_new(), str, and strlen().
Definition at line 712 of file string.c.
Referenced by rb_econv_append(), and rb_str_vcatf().
Definition at line 2812 of file string.c.
References len, rb_eArgError, rb_raise(), and str.
Referenced by rb_str_cat_conv_enc_opts(), rb_str_concat(), rb_str_ellipsize(), rb_str_initialize(), and rsock_inspect_sockaddr().
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 943 of file string.c.
References len, ptr, rb_eIndexError, rb_raise(), rb_str_cat(), rb_str_modify(), RSTRING_LEN, and STR_SET_LEN.
Definition at line 2230 of file string.c.
References RString::capa.
Definition at line 8921 of file string.c.
References len, RSTRING_LEN, and str.
Definition at line 3228 of file string.c.
References ENCODING_GET, lesser, memcmp(), rb_str_comparable(), and RSTRING_GETMEM.
Referenced by rb_iseq_pathobj_new().
long rb_str_coderange_scan_restartable | ( | const char * | s, |
const char * | e, | ||
rb_encoding * | enc, | ||
int * | cr | ||
) |
Definition at line 567 of file string.c.
References ENC_CODERANGE_BROKEN, ENC_CODERANGE_VALID, rb_ascii8bit_encindex(), and rb_enc_to_index().
Definition at line 3203 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(), and rb_str_hash_cmp().
Definition at line 3065 of file string.c.
References ALLOCA_N, buf, char, 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 make_inspect(), and rb_iseq_disasm_insn().
MJIT_FUNC_EXPORTED VALUE rb_str_concat_literals | ( | size_t | num, |
const VALUE * | strary | ||
) |
Definition at line 2974 of file string.c.
References ENC_CODERANGE, ENCINDEX_US_ASCII, ENCODING_GET, ENCODING_GET_INLINED, i, len, LIKELY, MIN_PRE_ALLOC_SIZE, NULL, rb_enc_copy(), rb_enc_set_index(), rb_str_buf_new(), rb_str_new(), rb_str_resurrect(), RSTRING_LEN, RSTRING_PTR, str, UNLIKELY, and v.
VALUE rb_str_conv_enc | ( | VALUE | str, |
rb_encoding * | from, | ||
rb_encoding * | to | ||
) |
Definition at line 1030 of file string.c.
References Qnil, rb_str_conv_enc_opts(), and str.
Referenced by rb_dir_getwd(), rb_external_str_with_enc(), rb_str_encode_ospath(), rb_str_export(), rb_str_export_locale(), and rb_str_export_to_enc().
VALUE rb_str_conv_enc_opts | ( | VALUE | str, |
rb_encoding * | from, | ||
rb_encoding * | to, | ||
int | ecflags, | ||
VALUE | ecopts | ||
) |
Definition at line 914 of file string.c.
References is_ascii_string, len, ptr, rb_ascii8bit_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_str_dup(), RSTRING_GETMEM, str, and STR_ENC_GET.
Referenced by rb_str_conv_enc(), and rb_w32_conv_from_wchar().
Definition at line 4573 of file string.c.
References ptr, RSTRING_LEN, RSTRING_PTR, and str.
Definition at line 6042 of file string.c.
References len, rb_enc_from_index(), rb_enc_get_index(), and str.
Definition at line 1516 of file string.c.
Referenced by rb_str_conv_enc_opts(), rb_str_times(), rb_vm_set_progname(), rsock_ipaddr(), and ruby_set_script_name().
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 10185 of file string.c.
References len, 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, RSTRING_PTR, and str.
MJIT_FUNC_EXPORTED VALUE rb_str_eql | ( | VALUE | str1, |
VALUE | str2 | ||
) |
Definition at line 3267 of file string.c.
References idTo_str, Qfalse, Qtrue, rb_equal(), rb_respond_to(), RB_TYPE_P, and T_STRING.
Definition at line 1123 of file string.c.
References rb_default_external_encoding(), rb_str_conv_enc(), str, and STR_ENC_GET.
Definition at line 1129 of file string.c.
References rb_locale_encoding(), rb_str_conv_enc(), str, and STR_ENC_GET.
VALUE rb_str_export_to_enc | ( | VALUE | str, |
rb_encoding * | enc | ||
) |
Definition at line 1135 of file string.c.
References rb_str_conv_enc(), str, and STR_ENC_GET.
Definition at line 2306 of file string.c.
References len, RSTRING_LEN, RSTRING_PTR, and str.
Definition at line 1349 of file string.c.
References FL_TEST, NULL, RB_DEBUG_COUNTER_INC, RB_DEBUG_COUNTER_INC_IF, rb_vm_fstring_table(), RSTRING_FSTR, ruby_sized_xfree, st_data_t, st_delete(), str, STR_EMBED_P, STR_HEAP_PTR, STR_HEAP_SIZE, STR_NOFREE, STR_SHARED, and void.
Definition at line 2616 of file string.c.
References OBJ_FROZEN, rb_obj_freeze(), rb_str_resize(), RSTRING_LEN, and str.
st_index_t rb_str_hash | ( | VALUE | str | ) |
Definition at line 3163 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, rb_enc_str_coderange(), rb_memhash(), RSTRING_LEN, RSTRING_PTR, and str.
Definition at line 3173 of file string.c.
References memcmp(), rb_str_comparable(), and RSTRING_GETMEM.
Definition at line 4398 of file string.c.
References bp, 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, StringValue(), and v.
Definition at line 964 of file string.c.
References len, ptr, rb_enc_associate(), rb_str_cat(), str, and STR_SET_LEN.
Definition at line 5930 of file string.c.
References buf, CHAR_ESC_LEN, ENCODING_GET, rb_enc_from_index(), and str.
Referenced by rb_id_quote_unprintable().
Definition at line 2685 of file string.c.
References arg, rb_ensure(), rb_str_locktmp(), rb_str_unlocktmp(), and str.
RUBY_FUNC_EXPORTED size_t rb_str_memsize | ( | VALUE | str | ) |
Definition at line 1371 of file string.c.
References FL_TEST, str, STR_HEAP_SIZE, STR_NOEMBED, STR_NOFREE, and STR_SHARED.
Definition at line 2114 of file string.c.
Referenced by rb_str_cat_conv_enc_opts(), and rb_str_vcatf().
Definition at line 2122 of file string.c.
References len, LONG_MAX, rb_eArgError, rb_raise(), RSTRING_LEN, str, and TERM_LEN.
Definition at line 774 of file string.c.
Referenced by rb_enc_str_new(), rb_str_concat_literals(), rb_tainted_str_new(), and rb_usascii_str_new().
Definition at line 808 of file string.c.
Referenced by rb_str_split(), rb_tainted_str_new_cstr(), rb_usascii_str_new_cstr(), and rb_utf8_str_new_cstr().
Definition at line 1203 of file string.c.
References OBJ_FROZEN.
Referenced by rb_econv_substr_append(), rb_hash_key_str(), rb_str_include_range_p(), and rb_str_subseq().
Definition at line 1197 of file string.c.
Referenced by rb_str_subseq().
Definition at line 1298 of file string.c.
Referenced by rb_str_ellipsize(), rb_str_subseq(), and rb_str_succ().
MJIT_FUNC_EXPORTED VALUE rb_str_opt_plus | ( | VALUE | str1, |
VALUE | str2 | ||
) |
Definition at line 1925 of file string.c.
References assert, LONG_MAX, MAYBE_UNUSED, Qundef, rb_cString, rb_enc_get_index(), rb_str_plus(), RBASIC_CLASS, and RSTRING_GETMEM.
Definition at line 9527 of file string.c.
References rb_enc_codepoint, RSTRING_END, RSTRING_PTR, STR_ENC_GET, and UINT2NUM.
Definition at line 1894 of file string.c.
References LONG_MAX, rb_eArgError, rb_enc_check_str(), rb_enc_mbminlen, rb_raise(), RSTRING_GETMEM, and StringValue().
Referenced by rb_str_opt_plus().
Definition at line 10714 of file string.c.
References Check_Type, len, NULL, ptr, rb_default_external_encoding(), rb_default_internal_encoding(), RSTRING_LEN, RSTRING_PTR, str, STR_ENC_GET, and T_STRING.
Definition at line 2709 of file string.c.
References len, rb_eArgError, and rb_raise().
Referenced by rb_econv_append(), rb_fstring(), rb_reg_quote(), rb_str_concat(), rb_str_freeze(), ruby_init_loadpath(), and VpAlloc().
Definition at line 1522 of file string.c.
References RSTRING_LEN, RUBY_DTRACE_CREATE_HOOK, and str.
Referenced by rb_str_concat_literals().
str | the string to be scrubbed |
repl | the replacement character |
Definition at line 10248 of file string.c.
References str, and STR_ENC_GET.
Definition at line 2692 of file string.c.
References RString::capa, str, and TERM_LEN.
Referenced by rb_econv_append().
Definition at line 10077 of file string.c.
References NIL_P, PRIsVALUE, rb_eTypeError, rb_id2str, rb_raise(), RB_TYPE_P, and T_STRING.
Definition at line 8116 of file string.c.
References rb_str_new_cstr(), str, and StringValue().
Definition at line 2463 of file string.c.
Referenced by rb_reg_match2().
Definition at line 2497 of file string.c.
References L, len, RSTRING_LEN, RSTRING_PTR, str, and STR_ENC_GET.
Definition at line 2474 of file string.c.
References len, 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, STR_EMBEDDABLE_P, and TERM_LEN.
Referenced by rb_path_to_class(), rb_reg_regsub(), rb_str_ellipsize(), and ruby_init_loadpath().
Definition at line 4090 of file string.c.
References rb_str_new_with_class(), RSTRING_LEN, RSTRING_PTR, and str.
Definition at line 10695 of file string.c.
References len, NULL, ptr, rb_default_external_encoding(), rb_default_internal_encoding(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, and sym.
Referenced by rb_id_quote_unprintable().
Definition at line 1210 of file string.c.
References OBJ_FROZEN_RAW.
Definition at line 1217 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_BORROWED, STR_EMBED_P, STR_NOFREE, STR_SHARED, and STR_TMPLOCK.
Definition at line 1382 of file string.c.
References idTo_str, rb_convert_type_with_id(), str, and T_STRING.
Referenced by rb_string_value().
Definition at line 2675 of file string.c.
References FL_TEST, FL_UNSET, rb_eRuntimeError, rb_raise(), str, and STR_TMPLOCK.
Referenced by rb_str_locktmp_ensure().
Definition at line 2175 of file string.c.
References ptr, rb_str_to_str(), RB_TYPE_P, and T_STRING.
Referenced by rb_string_value_cstr(), and rb_string_value_ptr().
Definition at line 2291 of file string.c.
References ptr, rb_string_value(), and str.
Definition at line 2186 of file string.c.
References ptr, rb_string_value(), RSTRING_PTR, and str.
MJIT_FUNC_EXPORTED VALUE rb_sym_proc_call | ( | ID | mid, |
int | argc, | ||
const VALUE * | argv, | ||
int | kw_splat, | ||
VALUE | passed_proc | ||
) |
Definition at line 10816 of file string.c.
References argc, argv, obj, rb_eArgError, rb_funcall_with_block_kw(), and rb_raise().
Definition at line 896 of file string.c.
References len, ptr, rb_str_new(), and rb_warning().
Definition at line 903 of file string.c.
References ptr, rb_str_new_cstr(), and rb_warning().
Definition at line 780 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, len, ptr, rb_str_new(), rb_usascii_encindex(), and str.
Referenced by rb_str_ellipsize().
Definition at line 820 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, ptr, rb_str_new_cstr(), rb_usascii_encindex(), and str.
Definition at line 828 of file string.c.
References ptr, rb_enc_associate_index(), rb_str_new_cstr(), rb_utf8_encindex(), and str.
RUBY_ALIAS_FUNCTION | ( | rb_str_buf_cat(VALUE str, const char *ptr, long len) | , |
rb_str_cat | , | ||
(str, ptr, len) | |||
) |
Definition at line 2828 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_UNKNOWN, ENCODING_GET, RSTRING_LEN, and str.
RUBY_ALIAS_FUNCTION | ( | rb_str_dup_frozen(VALUE str) | , |
rb_str_new_frozen | , | ||
(str) | |||
) |
Definition at line 2661 of file string.c.
References FL_SET, FL_TEST, rb_eRuntimeError, rb_raise(), str, and STR_TMPLOCK.
STATIC_ASSERT | ( | STR_BUF_MIN_SIZE | , |
STR_BUF_MIN_SIZE | , | ||
RSTRING_EMBED_LEN_MAX | |||
) |
const struct st_hash_type rb_fstring_hash_type |
Definition at line 258 of file string.c.
Referenced by Init_vm_objects().