1#ifndef RBIMPL_RSTRING_H
2#define RBIMPL_RSTRING_H
35#define RSTRING(obj) RBIMPL_CAST((struct RString *)(obj))
36#define RSTRING_NOEMBED RSTRING_NOEMBED
37#define RSTRING_EMBED_LEN_MASK RSTRING_EMBED_LEN_MASK
38#define RSTRING_EMBED_LEN_SHIFT RSTRING_EMBED_LEN_SHIFT
39#define RSTRING_EMBED_LEN_MAX RSTRING_EMBED_LEN_MAX
40#define RSTRING_FSTR RSTRING_FSTR
43#define RSTRING_EMBED_LEN RSTRING_EMBED_LEN
44#define RSTRING_LEN RSTRING_LEN
45#define RSTRING_LENINT RSTRING_LENINT
46#define RSTRING_PTR RSTRING_PTR
47#define RSTRING_END RSTRING_END
50#define StringValue(v) rb_string_value(&(v))
51#define StringValuePtr(v) rb_string_value_ptr(&(v))
52#define StringValueCStr(v) rb_string_value_cstr(&(v))
53#define SafeStringValue(v) StringValue(v)
54#define ExportStringValue(v) do { \
56 (v) = rb_str_export(v); \
62 RUBY_FL_USER5 | RUBY_FL_USER6,
97void rb_check_safe_str(
VALUE);
98#define Check_SafeStr(v) rb_check_safe_str(RBIMPL_CAST((VALUE)(v)))
112 return RBIMPL_CAST((
long)
f);
116#if RBIMPL_COMPILER_IS(Intel)
117RBIMPL_WARNING_IGNORED(413)
166 fprintf(stderr,
"%s\n",
167 "RSTRING_PTR is returning NULL!! "
168 "SIGSEGV is highly expected to follow immediately. "
169 "If you could reproduce, attach your debugger here, "
170 "and look at the passed string."
185 fprintf(stderr,
"%s\n",
186 "RSTRING_END is returning NULL!! "
187 "SIGSEGV is highly expected to follow immediately. "
188 "If you could reproduce, attach your debugger here, "
189 "and look at the passed string."
193 return &
buf.as.heap.ptr[
buf.as.heap.len];
203#ifdef HAVE_STMT_AND_DECL_IN_EXPR
204# define RSTRING_GETMEM(str, ptrvar, lenvar) \
206 struct RString rbimpl_str = rbimpl_rstring_getmem(str); \
207 (ptrvar) = rbimpl_str.as.heap.ptr; \
208 (lenvar) = rbimpl_str.as.heap.len; \
211# define RSTRING_GETMEM(str, ptrvar, lenvar) \
212 ((ptrvar) = RSTRING_PTR(str), \
213 (lenvar) = RSTRING_LEN(str))
Defines RBIMPL_ATTR_ARTIFICIAL.
#define RBIMPL_ATTR_ARTIFICIAL()
Wraps (or simulates) __attribute__((artificial))
#define RBIMPL_ASSERT_OR_ASSUME(expr)
This is either RUBY_ASSERT or RBIMPL_ASSUME, depending on RUBY_DEBUG.
Tewaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
char str[HTML_ESCAPE_MAX_LEN+1]
#define RSTRING_LEN(string)
#define RSTRING_PTR(string)
Defines enum ruby_fl_type.
#define RBIMPL_ATTR_ERROR(msg)
Wraps (or simulates) __attribute__((error))
Thin wrapper to ruby/config.h.
Arithmetic conversion between C's long and Ruby's.
Defines RBIMPL_ATTR_PURE.
#define RBIMPL_ATTR_PURE_UNLESS_DEBUG()
Enables RBIMPL_ATTR_PURE iff.
VALUE rb_str_to_str(VALUE)
VALUE rb_str_export_locale(VALUE)
char * rb_string_value_ptr(volatile VALUE *)
VALUE rb_str_export(VALUE)
#define RSTRING_EMBED_LEN_MAX
#define RSTRING_EMBED_LEN_SHIFT
VALUE rb_string_value(volatile VALUE *)
char * rb_string_value_cstr(volatile VALUE *)
#define RSTRING_EMBED_LEN_MASK
struct RString::@100::@101 heap
Defines enum ruby_value_type.
Defines RBIMPL_WARNING_PUSH.