Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Typedefs | Functions | Variables
stringio.c File Reference
#include "ruby.h"
#include "ruby/io.h"
#include "ruby/encoding.h"
Include dependency graph for stringio.c:

Go to the source code of this file.

Data Structures

struct  StringIO
 
struct  getline_arg
 

Macros

#define IS_STRIO(obj)   (rb_typeddata_is_kind_of((obj), &strio_data_type))
 
#define error_inval(msg)   (rb_syserr_fail(EINVAL, msg))
 
#define get_enc(ptr)   ((ptr)->enc ? (ptr)->enc : rb_enc_get((ptr)->string))
 
#define check_strio(self)   ((struct StringIO*)rb_check_typeddata((self), &strio_data_type))
 
#define StringIO(obj)   get_strio(obj)
 
#define STRIO_READABLE   FL_USER4
 
#define STRIO_WRITABLE   FL_USER5
 
#define STRIO_READWRITE   (STRIO_READABLE|STRIO_WRITABLE)
 
#define STRIO_MODE_SET_P(strio, mode)
 
#define CLOSED(strio)   (!STRIO_MODE_SET_P(strio, READWRITE))
 
#define READABLE(strio)   STRIO_MODE_SET_P(strio, READABLE)
 
#define WRITABLE(strio)   STRIO_MODE_SET_P(strio, WRITABLE)
 
#define strio_fcntl   strio_unimpl
 
#define strio_flush   strio_self
 
#define strio_fsync   strio_0
 
#define strio_set_sync   strio_first
 
#define strio_tell   strio_get_pos
 
#define strio_addstr   rb_io_addstr
 
#define strio_print   rb_io_print
 
#define strio_printf   rb_io_printf
 
#define strio_puts   rb_io_puts
 
#define strio_syswrite   rb_io_write
 
#define strio_isatty   strio_false
 
#define strio_pid   strio_nil
 
#define strio_fileno   strio_nil
 

Typedefs

typedef char strio_flags_check[(STRIO_READABLE/FMODE_READABLE==STRIO_WRITABLE/FMODE_WRITABLE) *2 - 1]
 

Functions

static VALUE strio_init (int, VALUE *, struct StringIO *, VALUE)
 
static VALUE strio_unget_bytes (struct StringIO *, const char *, long)
 
static struct StringIOstrio_alloc (void)
 
static void strio_mark (void *p)
 
static void strio_free (void *p)
 
static size_t strio_memsize (const void *p)
 
static struct StringIOget_strio (VALUE self)
 
static VALUE enc_subseq (VALUE str, long pos, long len, rb_encoding *enc)
 
static VALUE strio_substr (struct StringIO *ptr, long pos, long len)
 
static struct StringIOreadable (VALUE strio)
 
static struct StringIOwritable (VALUE strio)
 
static void check_modifiable (struct StringIO *ptr)
 
static VALUE strio_s_allocate (VALUE klass)
 
static VALUE strio_initialize (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_finalize (VALUE self)
 
static VALUE strio_s_open (int argc, VALUE *argv, VALUE klass)
 
static VALUE strio_s_new (int argc, VALUE *argv, VALUE klass)
 
static VALUE strio_false (VALUE self)
 
static VALUE strio_nil (VALUE self)
 
static VALUE strio_self (VALUE self)
 
static VALUE strio_0 (VALUE self)
 
static VALUE strio_first (VALUE self, VALUE arg)
 
static VALUE strio_unimpl (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_get_string (VALUE self)
 
static VALUE strio_set_string (VALUE self, VALUE string)
 
static VALUE strio_close (VALUE self)
 
static VALUE strio_close_read (VALUE self)
 
static VALUE strio_close_write (VALUE self)
 
static VALUE strio_closed (VALUE self)
 
static VALUE strio_closed_read (VALUE self)
 
static VALUE strio_closed_write (VALUE self)
 
static VALUE strio_eof (VALUE self)
 
static VALUE strio_copy (VALUE copy, VALUE orig)
 
static VALUE strio_get_lineno (VALUE self)
 
static VALUE strio_set_lineno (VALUE self, VALUE lineno)
 
static VALUE strio_binmode (VALUE self)
 
static VALUE strio_reopen (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_get_pos (VALUE self)
 
static VALUE strio_set_pos (VALUE self, VALUE pos)
 
static VALUE strio_rewind (VALUE self)
 
static VALUE strio_seek (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_get_sync (VALUE self)
 
static VALUE strio_each_byte (VALUE self)
 
static VALUE strio_bytes (VALUE self)
 
static VALUE strio_getc (VALUE self)
 
static VALUE strio_getbyte (VALUE self)
 
static void strio_extend (struct StringIO *ptr, long pos, long len)
 
static VALUE strio_ungetc (VALUE self, VALUE c)
 
static VALUE strio_ungetbyte (VALUE self, VALUE c)
 
static VALUE strio_readchar (VALUE self)
 
static VALUE strio_readbyte (VALUE self)
 
static VALUE strio_each_char (VALUE self)
 
static VALUE strio_chars (VALUE self)
 
static VALUE strio_each_codepoint (VALUE self)
 
static VALUE strio_codepoints (VALUE self)
 
static void bm_init_skip (long *skip, const char *pat, long m)
 
static long bm_search (const char *little, long llen, const char *big, long blen, const long *skip)
 
static struct getline_argprepare_getline_args (struct getline_arg *arg, int argc, VALUE *argv)
 
static int chomp_newline_width (const char *s, const char *e)
 
static VALUE strio_getline (struct getline_arg *arg, struct StringIO *ptr)
 
static VALUE strio_gets (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_readline (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_each (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_lines (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_readlines (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_write (VALUE self, VALUE str)
 
static VALUE strio_putc (VALUE self, VALUE ch)
 
static VALUE strio_read (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_sysread (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_read_nonblock (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_syswrite_nonblock (int argc, VALUE *argv, VALUE self)
 
static VALUE strio_size (VALUE self)
 
static VALUE strio_truncate (VALUE self, VALUE len)
 
static VALUE strio_external_encoding (VALUE self)
 
static VALUE strio_internal_encoding (VALUE self)
 
static VALUE strio_set_encoding (int argc, VALUE *argv, VALUE self)
 
void Init_stringio (void)
 

Variables

static const rb_data_type_t strio_data_type
 
static VALUE sym_exception
 

Macro Definition Documentation

◆ check_strio

#define check_strio (   self)    ((struct StringIO*)rb_check_typeddata((self), &strio_data_type))

Definition at line 85 of file stringio.c.

Referenced by get_strio(), strio_copy(), and strio_initialize().

◆ CLOSED

#define CLOSED (   strio)    (!STRIO_MODE_SET_P(strio, READWRITE))

Definition at line 128 of file stringio.c.

Referenced by strio_closed(), and strio_seek().

◆ error_inval

#define error_inval (   msg)    (rb_syserr_fail(EINVAL, msg))

Definition at line 36 of file stringio.c.

Referenced by strio_seek(), strio_set_pos(), and strio_truncate().

◆ get_enc

#define get_enc (   ptr)    ((ptr)->enc ? (ptr)->enc : rb_enc_get((ptr)->string))

◆ IS_STRIO

#define IS_STRIO (   obj)    (rb_typeddata_is_kind_of((obj), &strio_data_type))

Definition at line 35 of file stringio.c.

◆ READABLE

#define READABLE (   strio)    STRIO_MODE_SET_P(strio, READABLE)

Definition at line 129 of file stringio.c.

Referenced by readable(), and strio_closed_read().

◆ StringIO

#define StringIO (   obj)    get_strio(obj)

◆ strio_addstr

#define strio_addstr   rb_io_addstr

Definition at line 1302 of file stringio.c.

Referenced by Init_stringio().

◆ strio_fcntl

#define strio_fcntl   strio_unimpl

Definition at line 530 of file stringio.c.

Referenced by Init_stringio().

◆ strio_fileno

#define strio_fileno   strio_nil

Definition at line 1486 of file stringio.c.

Referenced by Init_stringio().

◆ strio_flush

#define strio_flush   strio_self

Definition at line 532 of file stringio.c.

Referenced by Init_stringio().

◆ strio_fsync

#define strio_fsync   strio_0

Definition at line 534 of file stringio.c.

Referenced by Init_stringio().

◆ strio_isatty

#define strio_isatty   strio_false

Definition at line 1482 of file stringio.c.

Referenced by Init_stringio().

◆ STRIO_MODE_SET_P

#define STRIO_MODE_SET_P (   strio,
  mode 
)
Value:
((RBASIC(strio)->flags & STRIO_##mode) && \
((struct StringIO*)DATA_PTR(strio))->flags & FMODE_##mode)
#define DATA_PTR(dta)
Definition: ruby.h:1113
#define RBASIC(obj)
Definition: ruby.h:1204

Definition at line 125 of file stringio.c.

◆ strio_pid

#define strio_pid   strio_nil

Definition at line 1484 of file stringio.c.

Referenced by Init_stringio().

◆ strio_print

#define strio_print   rb_io_print

Definition at line 1311 of file stringio.c.

Referenced by Init_stringio().

◆ strio_printf

#define strio_printf   rb_io_printf

Definition at line 1319 of file stringio.c.

Referenced by Init_stringio().

◆ strio_puts

#define strio_puts   rb_io_puts

Definition at line 1351 of file stringio.c.

Referenced by Init_stringio().

◆ STRIO_READABLE

#define STRIO_READABLE   FL_USER4

Definition at line 121 of file stringio.c.

Referenced by strio_close_read(), and strio_init().

◆ STRIO_READWRITE

#define STRIO_READWRITE   (STRIO_READABLE|STRIO_WRITABLE)

Definition at line 123 of file stringio.c.

Referenced by strio_close(), and strio_copy().

◆ strio_set_sync

#define strio_set_sync   strio_first

Definition at line 653 of file stringio.c.

Referenced by Init_stringio().

◆ strio_syswrite

#define strio_syswrite   rb_io_write

Definition at line 1471 of file stringio.c.

Referenced by Init_stringio(), and strio_syswrite_nonblock().

◆ strio_tell

#define strio_tell   strio_get_pos

Definition at line 655 of file stringio.c.

Referenced by Init_stringio().

◆ STRIO_WRITABLE

#define STRIO_WRITABLE   FL_USER5

Definition at line 122 of file stringio.c.

Referenced by strio_close_write().

◆ WRITABLE

#define WRITABLE (   strio)    STRIO_MODE_SET_P(strio, WRITABLE)

Definition at line 130 of file stringio.c.

Referenced by strio_binmode(), strio_closed_write(), strio_set_encoding(), and writable().

Typedef Documentation

◆ strio_flags_check

typedef char strio_flags_check[(STRIO_READABLE/FMODE_READABLE==STRIO_WRITABLE/FMODE_WRITABLE) *2 - 1]

Definition at line 124 of file stringio.c.

Function Documentation

◆ bm_init_skip()

static void bm_init_skip ( long *  skip,
const char *  pat,
long  m 
)
static

Definition at line 960 of file stringio.c.

References CHAR_BIT.

Referenced by strio_getline().

◆ bm_search()

static long bm_search ( const char *  little,
long  llen,
const char *  big,
long  blen,
const long *  skip 
)
static

Definition at line 973 of file stringio.c.

Referenced by strio_getline().

◆ check_modifiable()

static void check_modifiable ( struct StringIO ptr)
static

◆ chomp_newline_width()

static int chomp_newline_width ( const char *  s,
const char *  e 
)
inlinestatic

Definition at line 1043 of file stringio.c.

Referenced by strio_getline().

◆ enc_subseq()

static VALUE enc_subseq ( VALUE  str,
long  pos,
long  len,
rb_encoding enc 
)
static

Definition at line 99 of file stringio.c.

References rb_enc_associate(), and rb_str_subseq().

Referenced by strio_getc(), and strio_substr().

◆ get_strio()

static struct StringIO* get_strio ( VALUE  self)
static

Definition at line 88 of file stringio.c.

References check_strio, rb_eIOError, rb_io_taint_check(), and rb_raise().

◆ Init_stringio()

void Init_stringio ( void  )

◆ prepare_getline_args()

static struct getline_arg* prepare_getline_args ( struct getline_arg arg,
int  argc,
VALUE argv 
)
static

◆ readable()

static struct StringIO* readable ( VALUE  strio)
static

◆ strio_0()

static VALUE strio_0 ( VALUE  self)
static

Definition at line 299 of file stringio.c.

References INT2FIX, and StringIO.

◆ strio_alloc()

static struct StringIO* strio_alloc ( void  )
static

Definition at line 40 of file stringio.c.

References ALLOC, StringIO::count, StringIO::flags, StringIO::lineno, StringIO::pos, Qnil, and StringIO::string.

Referenced by strio_initialize().

◆ strio_binmode()

static VALUE strio_binmode ( VALUE  self)
static

◆ strio_bytes()

static VALUE strio_bytes ( VALUE  self)
static

Definition at line 682 of file stringio.c.

References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_warn(), and strio_each_byte().

Referenced by Init_stringio().

◆ strio_chars()

static VALUE strio_chars ( VALUE  self)
static

Definition at line 906 of file stringio.c.

References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_warn(), and strio_each_char().

Referenced by Init_stringio().

◆ strio_close()

static VALUE strio_close ( VALUE  self)
static

Definition at line 366 of file stringio.c.

References Qnil, RBASIC, StringIO, and STRIO_READWRITE.

Referenced by Init_stringio().

◆ strio_close_read()

static VALUE strio_close_read ( VALUE  self)
static

Definition at line 381 of file stringio.c.

References StringIO::flags, FMODE_READABLE, Qnil, rb_eIOError, rb_raise(), RBASIC, StringIO, and STRIO_READABLE.

Referenced by Init_stringio().

◆ strio_close_write()

static VALUE strio_close_write ( VALUE  self)
static

Definition at line 399 of file stringio.c.

References StringIO::flags, FMODE_WRITABLE, Qnil, rb_eIOError, rb_raise(), RBASIC, StringIO, and STRIO_WRITABLE.

Referenced by Init_stringio().

◆ strio_closed()

static VALUE strio_closed ( VALUE  self)
static

Definition at line 416 of file stringio.c.

References CLOSED, Qfalse, Qtrue, and StringIO.

Referenced by Init_stringio().

◆ strio_closed_read()

static VALUE strio_closed_read ( VALUE  self)
static

Definition at line 430 of file stringio.c.

References Qfalse, Qtrue, READABLE, and StringIO.

Referenced by Init_stringio().

◆ strio_closed_write()

static VALUE strio_closed_write ( VALUE  self)
static

Definition at line 444 of file stringio.c.

References Qfalse, Qtrue, StringIO, and WRITABLE.

Referenced by Init_stringio().

◆ strio_codepoints()

static VALUE strio_codepoints ( VALUE  self)
static

Definition at line 950 of file stringio.c.

References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_warn(), and strio_each_codepoint().

Referenced by Init_stringio().

◆ strio_copy()

static VALUE strio_copy ( VALUE  copy,
VALUE  orig 
)
static

◆ strio_each()

static VALUE strio_each ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_each_byte()

static VALUE strio_each_byte ( VALUE  self)
static

◆ strio_each_char()

static VALUE strio_each_char ( VALUE  self)
static

Definition at line 890 of file stringio.c.

References NIL_P, rb_yield(), RETURN_ENUMERATOR, and strio_getc().

Referenced by Init_stringio(), and strio_chars().

◆ strio_each_codepoint()

static VALUE strio_each_codepoint ( VALUE  self)
static

◆ strio_eof()

static VALUE strio_eof ( VALUE  self)
static

Definition at line 460 of file stringio.c.

References StringIO::pos, Qfalse, Qtrue, readable(), RSTRING_LEN, and StringIO::string.

Referenced by Init_stringio().

◆ strio_extend()

static void strio_extend ( struct StringIO ptr,
long  pos,
long  len 
)
static

◆ strio_external_encoding()

static VALUE strio_external_encoding ( VALUE  self)
static

Definition at line 1537 of file stringio.c.

References get_enc, rb_enc_from_encoding(), and StringIO.

Referenced by Init_stringio().

◆ strio_false()

static VALUE strio_false ( VALUE  self)
static

Definition at line 269 of file stringio.c.

References Qfalse, and StringIO.

◆ strio_finalize()

static VALUE strio_finalize ( VALUE  self)
static

Definition at line 229 of file stringio.c.

References StringIO::flags, FMODE_READWRITE, Qnil, StringIO::string, and StringIO.

Referenced by strio_s_open().

◆ strio_first()

static VALUE strio_first ( VALUE  self,
VALUE  arg 
)
static

Definition at line 309 of file stringio.c.

References StringIO.

◆ strio_free()

static void strio_free ( void *  p)
static

Definition at line 61 of file stringio.c.

References StringIO::count, and xfree().

Referenced by strio_copy().

◆ strio_get_lineno()

static VALUE strio_get_lineno ( VALUE  self)
static

Definition at line 498 of file stringio.c.

References StringIO::lineno, LONG2NUM, and StringIO.

Referenced by Init_stringio().

◆ strio_get_pos()

static VALUE strio_get_pos ( VALUE  self)
static

Definition at line 562 of file stringio.c.

References LONG2NUM, StringIO::pos, and StringIO.

Referenced by Init_stringio().

◆ strio_get_string()

static VALUE strio_get_string ( VALUE  self)
static

Definition at line 333 of file stringio.c.

References StringIO.

Referenced by Init_stringio().

◆ strio_get_sync()

static VALUE strio_get_sync ( VALUE  self)
static

Definition at line 647 of file stringio.c.

References Qtrue, and StringIO.

Referenced by Init_stringio().

◆ strio_getbyte()

static VALUE strio_getbyte ( VALUE  self)
static

Definition at line 722 of file stringio.c.

References CHR2FIX, StringIO::pos, Qnil, readable(), RSTRING_LEN, RSTRING_PTR, and StringIO::string.

Referenced by Init_stringio().

◆ strio_getc()

static VALUE strio_getc ( VALUE  self)
static

◆ strio_getline()

static VALUE strio_getline ( struct getline_arg arg,
struct StringIO ptr 
)
static

◆ strio_gets()

static VALUE strio_gets ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_init()

static VALUE strio_init ( int  argc,
VALUE argv,
struct StringIO ptr,
VALUE  self 
)
static

◆ strio_initialize()

static VALUE strio_initialize ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 174 of file stringio.c.

References check_strio, DATA_PTR, rb_call_super(), strio_alloc(), and strio_init().

Referenced by Init_stringio().

◆ strio_internal_encoding()

static VALUE strio_internal_encoding ( VALUE  self)
static

Definition at line 1552 of file stringio.c.

References Qnil.

Referenced by Init_stringio().

◆ strio_lines()

static VALUE strio_lines ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 1210 of file stringio.c.

References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_warn(), and strio_each().

Referenced by Init_stringio().

◆ strio_mark()

static void strio_mark ( void *  p)
static

Definition at line 52 of file stringio.c.

References rb_gc_mark(), and StringIO::string.

◆ strio_memsize()

static size_t strio_memsize ( const void *  p)
static

Definition at line 70 of file stringio.c.

◆ strio_nil()

static VALUE strio_nil ( VALUE  self)
static

Definition at line 279 of file stringio.c.

References Qnil, and StringIO.

◆ strio_putc()

static VALUE strio_putc ( VALUE  self,
VALUE  ch 
)
static

◆ strio_read()

static VALUE strio_read ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_read_nonblock()

static VALUE strio_read_nonblock ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_readbyte()

static VALUE strio_readbyte ( VALUE  self)
static

Definition at line 875 of file stringio.c.

References NIL_P, rb_eof_error(), rb_funcall2, and rb_intern.

Referenced by Init_stringio().

◆ strio_readchar()

static VALUE strio_readchar ( VALUE  self)
static

Definition at line 861 of file stringio.c.

References NIL_P, rb_eof_error(), rb_funcall2, and rb_intern.

Referenced by Init_stringio().

◆ strio_readline()

static VALUE strio_readline ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 1166 of file stringio.c.

References NIL_P, rb_eof_error(), rb_funcall2, and rb_intern.

Referenced by Init_stringio().

◆ strio_readlines()

static VALUE strio_readlines ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_reopen()

static VALUE strio_reopen ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 545 of file stringio.c.

References rb_io_taint_check(), RB_TYPE_P, StringIO, strio_copy(), strio_init(), and T_STRING.

Referenced by Init_stringio().

◆ strio_rewind()

static VALUE strio_rewind ( VALUE  self)
static

Definition at line 593 of file stringio.c.

References INT2FIX, StringIO::lineno, StringIO::pos, and StringIO.

Referenced by Init_stringio().

◆ strio_s_allocate()

static VALUE strio_s_allocate ( VALUE  klass)
static

Definition at line 163 of file stringio.c.

References TypedData_Wrap_Struct.

Referenced by Init_stringio().

◆ strio_s_new()

static VALUE strio_s_new ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 254 of file stringio.c.

References PRIsVALUE, rb_block_given_p(), rb_class_new_instance(), rb_obj_as_string(), and rb_warn().

Referenced by Init_stringio().

◆ strio_s_open()

static VALUE strio_s_open ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 245 of file stringio.c.

References rb_block_given_p(), rb_class_new_instance(), rb_ensure(), rb_yield(), and strio_finalize().

Referenced by Init_stringio().

◆ strio_seek()

static VALUE strio_seek ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_self()

static VALUE strio_self ( VALUE  self)
static

Definition at line 289 of file stringio.c.

References StringIO.

◆ strio_set_encoding()

static VALUE strio_set_encoding ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ strio_set_lineno()

static VALUE strio_set_lineno ( VALUE  self,
VALUE  lineno 
)
static

Definition at line 511 of file stringio.c.

References StringIO::lineno, NUM2LONG, and StringIO.

Referenced by Init_stringio().

◆ strio_set_pos()

static VALUE strio_set_pos ( VALUE  self,
VALUE  pos 
)
static

Definition at line 574 of file stringio.c.

References error_inval, NUM2LONG, StringIO::pos, and StringIO.

Referenced by Init_stringio().

◆ strio_set_string()

static VALUE strio_set_string ( VALUE  self,
VALUE  string 
)
static

◆ strio_size()

static VALUE strio_size ( VALUE  self)
static

Definition at line 1496 of file stringio.c.

References NIL_P, rb_eIOError, rb_raise(), RSTRING_LEN, StringIO, and ULONG2NUM.

Referenced by Init_stringio().

◆ strio_substr()

static VALUE strio_substr ( struct StringIO ptr,
long  pos,
long  len 
)
static

◆ strio_sysread()

static VALUE strio_sysread ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 1432 of file stringio.c.

References NIL_P, rb_eof_error(), rb_funcall2, rb_intern, and val.

Referenced by Init_stringio().

◆ strio_syswrite_nonblock()

static VALUE strio_syswrite_nonblock ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 1474 of file stringio.c.

References NULL, rb_scan_args(), and strio_syswrite.

Referenced by Init_stringio().

◆ strio_truncate()

static VALUE strio_truncate ( VALUE  self,
VALUE  len 
)
static

◆ strio_unget_bytes()

static VALUE strio_unget_bytes ( struct StringIO ptr,
const char *  cp,
long  cl 
)
static

◆ strio_ungetbyte()

static VALUE strio_ungetbyte ( VALUE  self,
VALUE  c 
)
static

◆ strio_ungetc()

static VALUE strio_ungetc ( VALUE  self,
VALUE  c 
)
static

◆ strio_unimpl()

static VALUE strio_unimpl ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 319 of file stringio.c.

References rb_notimplement(), StringIO, and UNREACHABLE.

◆ strio_write()

static VALUE strio_write ( VALUE  self,
VALUE  str 
)
static

◆ writable()

static struct StringIO* writable ( VALUE  strio)
static

Definition at line 145 of file stringio.c.

References rb_eIOError, rb_raise(), StringIO, and WRITABLE.

Referenced by strio_putc(), strio_truncate(), and strio_write().

Variable Documentation

◆ strio_data_type

const rb_data_type_t strio_data_type
static
Initial value:
= {
"strio",
{
},
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static void strio_free(void *p)
Definition: stringio.c:61
static void strio_mark(void *p)
Definition: stringio.c:52
static size_t strio_memsize(const void *p)
Definition: stringio.c:70

Definition at line 75 of file stringio.c.

◆ sym_exception

VALUE sym_exception
static

Definition at line 132 of file stringio.c.

Referenced by Init_stringio(), and strio_read_nonblock().