Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Internal header for String. More...
#include "ruby/internal/config.h"
#include <stddef.h>
#include "internal/compilers.h"
#include "ruby/internal/stdbool.h"
#include "ruby/encoding.h"
#include "ruby/ruby.h"
Go to the source code of this file.
Macros | |
#define | STR_NOEMBED FL_USER1 |
#define | STR_SHARED FL_USER2 /* = ELTS_SHARED */ |
#define | rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str)) |
#define | rb_fstring_literal(str) rb_fstring_lit(str) |
#define | rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc)) |
#define | rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc) |
#define | rb_fstring_cstr(str) |
Internal header for String.
Definition in file string.h.
#define rb_fstring_cstr | ( | str | ) |
#define rb_fstring_enc_lit | ( | str, | |
enc | |||
) | rb_fstring_enc_new((str), rb_strlen_lit(str), (enc)) |
#define rb_fstring_enc_literal | ( | str, | |
enc | |||
) | rb_fstring_enc_lit(str, enc) |
#define rb_fstring_lit | ( | str | ) | rb_fstring_new((str), rb_strlen_lit(str)) |
#define rb_fstring_literal | ( | str | ) | rb_fstring_lit(str) |
#define STR_SHARED FL_USER2 /* = ELTS_SHARED */ |
VALUE rb_ec_str_resurrect | ( | struct rb_execution_context_struct * | ec, |
VALUE | str | ||
) |
Definition at line 1644 of file string.c.
References rb_cString, RSTRING_LEN, RUBY_DTRACE_CREATE_HOOK, and str.
int rb_enc_str_coderange_scan | ( | VALUE | str, |
rb_encoding * | enc | ||
) |
Definition at line 719 of file string.c.
References rb_enc_to_index(), and str.
VALUE rb_enc_str_scrub | ( | rb_encoding * | enc, |
VALUE | str, | ||
VALUE | repl | ||
) |
Definition at line 10587 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_UNKNOWN, str, and STR_ENC_GET.
VALUE rb_external_str_with_enc | ( | VALUE | str, |
rb_encoding * | eenc | ||
) |
Definition at line 1144 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 353 of file string.c.
References assert, BARE_STRING_P, FALSE, FL_TEST, FL_TEST_RAW, fstr_update_arg::fstr, OBJ_FREEZE_RAW, OBJ_FROZEN, rb_str_resize(), RSTRING_FSTR, RSTRING_LEN, str, STR_NOEMBED, STR_SHARED, STR_SHARED_ROOT, and T_STRING.
Referenced by rb_autoload_str(), rb_enc_reg_new(), rb_hash_key_str(), rb_iseq_pathobj_new(), rb_node_case_when_optimizable_literal(), rb_parser_lex_state_name(), rb_str_intern(), rb_str_to_interned_str(), and yyparse().
Definition at line 460 of file string.c.
References ptr, rb_fstring_new(), and strlen().
VALUE rb_fstring_enc_new | ( | const char * | ptr, |
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 446 of file string.c.
References ENCINDEX_US_ASCII, FALSE, len, and ptr.
Referenced by rb_deprecate_constant(), and rb_fstring_cstr().
Definition at line 11067 of file string.c.
References rb_id2str, rb_str_inspect(), rb_str_symname_p(), and str.
Definition at line 1541 of file string.c.
References rb_any_to_s(), 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 435 of file string.c.
References len, name, and rb_enc_to_index().
Referenced by rb_check_id_cstr(), rb_check_symbol_cstr(), rb_enc_interned_str(), rb_fstring_enc_new(), rb_intern3(), rb_sym_intern(), and ruby_require_internal().
Definition at line 6084 of file string.c.
References CHAR_ESC_LEN, int(), ISPRINT, rb_str_buf_cat, snprintf, and strlen().
Referenced by rb_str_escape(), and rb_str_inspect().
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 1013 of file string.c.
References len, ptr, rb_eIndexError, rb_enc_get(), rb_raise(), rb_str_cat(), rb_str_modify(), RSTRING_LEN, and STR_SET_LEN.
Referenced by rb_external_str_new_with_enc(), and rb_file_expand_path_internal().
Definition at line 2378 of file string.c.
References assert, RString::capa, FL_TEST, L, len, RSTRING, RSTRING_LEN, RSTRING_PTR, str, STR_SHARED, and TERM_FILL.
Referenced by rb_enc_associate_index().
Definition at line 9236 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, len, Qnil, RSTRING_LEN, RSTRING_PTR, str, STR_SET_LEN, TERM_FILL, and TERM_LEN.
Definition at line 3127 of file string.c.
References ENC_CODERANGE, ENCINDEX_US_ASCII, ENCODING_GET, ENCODING_GET_INLINED, len, LIKELY, MIN_PRE_ALLOC_SIZE, NULL, num, rb_enc_copy(), rb_enc_set_index(), rb_str_buf_new(), rb_str_new, rb_str_resurrect(), RSTRING_LEN, RSTRING_PTR, str, and UNLIKELY.
Definition at line 2454 of file string.c.
References len, RSTRING_LEN, RSTRING_PTR, and str.
VALUE rb_str_initialize | ( | VALUE | str, |
const char * | ptr, | ||
long | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 1034 of file string.c.
References len, ptr, rb_enc_associate(), rb_str_cat(), str, and STR_SET_LEN.
Referenced by rb_external_str_new_with_enc().
Definition at line 2835 of file string.c.
References rb_ensure(), rb_str_locktmp(), rb_str_unlocktmp(), and str.
Referenced by rsock_s_recvfrom().
size_t rb_str_memsize | ( | VALUE | str | ) |
Definition at line 1460 of file string.c.
References FL_TEST, str, STR_HEAP_SIZE, STR_NOEMBED, STR_NOFREE, and STR_SHARED.
Definition at line 2075 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 11046 of file string.c.
References len, NULL, ptr, rb_default_external_encoding(), rb_default_internal_encoding(), rb_str_inspect(), RSTRING_LEN, RSTRING_PTR, str, STR_ENC_GET, and T_STRING.
Definition at line 11027 of file string.c.
References FALSE, len, NULL, ptr, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_symname2_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, strlen(), sym, and TRUE.
Referenced by rb_id_quote_unprintable().
Definition at line 1287 of file string.c.
References FALSE, and OBJ_FROZEN_RAW.
Referenced by rb_str_format().
Definition at line 1294 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_NOFREE, STR_SHARED, and STR_TMPLOCK.
Referenced by rb_str_format().
char * rb_str_to_cstr | ( | VALUE | str | ) |
Definition at line 2432 of file string.c.
References str.
Referenced by rb_get_path_check_convert(), and rb_to_encoding_index().
Definition at line 4483 of file string.c.
References re_registers::beg, CONST_ID, re_registers::end, FALSE, FIX2LONG, FIXNUM_P, idLE, INT2FIX, ISDIGIT, NIL_P, numberof, Qnil, rb_cString, rb_enc_check(), rb_enc_sprintf(), rb_enc_str_new(), rb_fstring_lit, rb_funcall(), rb_funcallv, rb_str_cmp(), rb_str_equal(), rb_str_format(), rb_str_to_inum(), rb_usascii_encoding(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by rb_str_include_range_p().
Definition at line 4565 of file string.c.
References re_registers::beg, CONST_ID, FALSE, FIX2LONG, FIXABLE, FIXNUM_P, INT2FIX, ISDIGIT, LONG2NUM, numberof, rb_cString, rb_enc_sprintf(), rb_fstring_lit, rb_funcallv, rb_str_format(), rb_str_to_inum(), rb_usascii_encoding(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 11171 of file string.c.
References argc, argv, rb_eArgError, rb_funcall_with_block_kw(), and rb_raise().