Ruby: rb_io_internal_buffer Struct Reference

Ruby 3.4.4p34 (2025-05-14 revision a38531fd3f617bf734ef7d6c595325f69985ea1d)

Data Fields
rb_io_internal_buffer Struct Reference

IO buffers. More...

`#include <io.h>`

## Data Fields
char * | ptr
| Pointer to the underlying memory region, of at least `capa` bytes.
int | off
| Offset inside of `ptr`.
int | len
| Length of the buffer.
int | capa
| Designed capacity of the buffer.

## Detailed Description

IO buffers.

This is an implementation detail of rb_io_t::wbuf and rb_io_t::rbuf. People don't manipulate it directly.

Definition at line 94 of file io.h.

## Field Documentation

## ◆ capa

int rb_io_internal_buffer::capa

Designed capacity of the buffer.

Definition at line 106 of file io.h.

Referenced by rb_io_ungetc().

## ◆ len

int rb_io_internal_buffer::len

Length of the buffer.

Definition at line 103 of file io.h.

Referenced by rb_io_check_char_readable(), rb_io_check_writable(), rb_io_getbyte(), and rb_io_ungetc().

## ◆ off

int rb_io_internal_buffer::off

Offset inside of `ptr`.

Definition at line 100 of file io.h.

Referenced by rb_io_getbyte(), and rb_io_ungetc().

## ◆ ptr

char* rb_io_internal_buffer::ptr

Pointer to the underlying memory region, of at least `capa` bytes.

Definition at line 97 of file io.h.

Referenced by rb_io_getbyte(), and rb_io_ungetc().

The documentation for this struct was generated from the following file:

- include/ruby/io.h