Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Defines struct RString. More...
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/long.h"
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/core/rbasic.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/fl_type.h"
#include "ruby/internal/value_type.h"
#include "ruby/internal/warning_push.h"
#include "ruby/assert.h"
Go to the source code of this file.
Data Structures | |
struct | RString |
Macros | |
#define | RSTRING(obj) RBIMPL_CAST((struct RString *)(obj)) |
#define | RSTRING_NOEMBED RSTRING_NOEMBED |
#define | RSTRING_EMBED_LEN_MASK RSTRING_EMBED_LEN_MASK |
#define | RSTRING_EMBED_LEN_SHIFT RSTRING_EMBED_LEN_SHIFT |
#define | RSTRING_EMBED_LEN_MAX RSTRING_EMBED_LEN_MAX |
#define | RSTRING_FSTR RSTRING_FSTR |
#define | StringValue(v) rb_string_value(&(v)) |
#define | StringValuePtr(v) rb_string_value_ptr(&(v)) |
#define | StringValueCStr(v) rb_string_value_cstr(&(v)) |
#define | SafeStringValue(v) StringValue(v) |
#define | ExportStringValue(v) |
#define | Check_SafeStr(v) rb_check_safe_str(RBIMPL_CAST((VALUE)(v))) |
#define | RSTRING_GETMEM(str, ptrvar, lenvar) |
Enumerations | |
enum | ruby_rstring_flags { RSTRING_NOEMBED = RUBY_FL_USER1 , RSTRING_EMBED_LEN_MASK , RSTRING_FSTR = RUBY_FL_USER17 } |
enum | ruby_rstring_consts { RSTRING_EMBED_LEN_SHIFT = RUBY_FL_USHIFT + 2 , RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 } |
Functions | |
VALUE | rb_str_to_str (VALUE) |
VALUE | rb_string_value (volatile VALUE *) |
char * | rb_string_value_ptr (volatile VALUE *) |
char * | rb_string_value_cstr (volatile VALUE *) |
VALUE | rb_str_export (VALUE) |
VALUE | rb_str_export_locale (VALUE) |
RBIMPL_ATTR_ERROR (("rb_check_safe_str() and Check_SafeStr() are obsolete; use StringValue() instead")) void rb_check_safe_str(VALUE) | |
Defines struct RString.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file rstring.h.
#define Check_SafeStr | ( | v | ) | rb_check_safe_str(RBIMPL_CAST((VALUE)(v))) |
#define ExportStringValue | ( | v | ) |
#define RSTRING | ( | obj | ) | RBIMPL_CAST((struct RString *)(obj)) |
#define RSTRING_GETMEM | ( | str, | |
ptrvar, | |||
lenvar | |||
) |
#define SafeStringValue | ( | v | ) | StringValue(v) |
#define StringValue | ( | v | ) | rb_string_value(&(v)) |
#define StringValueCStr | ( | v | ) | rb_string_value_cstr(&(v)) |
#define StringValuePtr | ( | v | ) | rb_string_value_ptr(&(v)) |
enum ruby_rstring_consts |
enum ruby_rstring_flags |
Definition at line 1193 of file string.c.
References rb_default_external_encoding(), rb_str_conv_enc(), str, and STR_ENC_GET.
Definition at line 1199 of file string.c.
References rb_locale_encoding(), rb_str_conv_enc(), str, and STR_ENC_GET.
Definition at line 1471 of file string.c.
References rb_convert_type_with_id(), str, and T_STRING.
Referenced by rb_string_value().
Definition at line 2323 of file string.c.
References ptr, rb_str_to_str(), 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 2439 of file string.c.
References ptr, rb_eArgError, rb_raise(), rb_string_value(), and str.
Referenced by rb_fiddle_value_to_generic().
char * rb_string_value_ptr | ( | volatile VALUE * | ptr | ) |
Definition at line 2334 of file string.c.
References ptr, rb_string_value(), RSTRING_PTR, and str.
RBIMPL_ATTR_ERROR | ( | ("rb_check_safe_str() and Check_SafeStr() are obsolete; use StringValue() instead") | ) |