Ruby 3.5.0dev (2025-04-04 revision cd8c203ffb50fe41852f90936b701b97a0fa77e7)
Macros | Enumerations | Functions | Variables
buffer.h File Reference

(cd8c203ffb50fe41852f90936b701b97a0fa77e7)

#include "ruby/ruby.h"
#include "ruby/internal/config.h"
Include dependency graph for buffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RB_IO_BUFFER_EXPERIMENTAL   1
 
#define RUBY_IO_BUFFER_VERSION   2
 

Enumerations

enum  rb_io_buffer_flags {
  RB_IO_BUFFER_EXTERNAL = 1 , RB_IO_BUFFER_INTERNAL = 2 , RB_IO_BUFFER_MAPPED = 4 , RB_IO_BUFFER_SHARED = 8 ,
  RB_IO_BUFFER_LOCKED = 32 , RB_IO_BUFFER_PRIVATE = 64 , RB_IO_BUFFER_READONLY = 128 , RB_IO_BUFFER_FILE = 256
}
 
enum  rb_io_buffer_endian { RB_IO_BUFFER_LITTLE_ENDIAN = 4 , RB_IO_BUFFER_BIG_ENDIAN = 8 , RB_IO_BUFFER_HOST_ENDIAN = RB_IO_BUFFER_LITTLE_ENDIAN , RB_IO_BUFFER_NETWORK_ENDIAN = RB_IO_BUFFER_BIG_ENDIAN }
 

Functions

VALUE rb_io_buffer_new (void *base, size_t size, enum rb_io_buffer_flags flags)
 
VALUE rb_io_buffer_map (VALUE io, size_t size, rb_off_t offset, enum rb_io_buffer_flags flags)
 
VALUE rb_io_buffer_lock (VALUE self)
 
VALUE rb_io_buffer_unlock (VALUE self)
 
int rb_io_buffer_try_unlock (VALUE self)
 
VALUE rb_io_buffer_free (VALUE self)
 
VALUE rb_io_buffer_free_locked (VALUE self)
 
enum rb_io_buffer_flags rb_io_buffer_get_bytes (VALUE self, void **base, size_t *size)
 
void rb_io_buffer_get_bytes_for_reading (VALUE self, const void **base, size_t *size)
 
void rb_io_buffer_get_bytes_for_writing (VALUE self, void **base, size_t *size)
 
VALUE rb_io_buffer_transfer (VALUE self)
 
void rb_io_buffer_resize (VALUE self, size_t size)
 
void rb_io_buffer_clear (VALUE self, uint8_t value, size_t offset, size_t length)
 
VALUE rb_io_buffer_read (VALUE self, VALUE io, size_t length, size_t offset)
 
VALUE rb_io_buffer_pread (VALUE self, VALUE io, rb_off_t from, size_t length, size_t offset)
 
VALUE rb_io_buffer_write (VALUE self, VALUE io, size_t length, size_t offset)
 
VALUE rb_io_buffer_pwrite (VALUE self, VALUE io, rb_off_t from, size_t length, size_t offset)
 

Variables

VALUE rb_cIOBuffer
 
size_t RUBY_IO_BUFFER_PAGE_SIZE
 
size_t RUBY_IO_BUFFER_DEFAULT_SIZE
 

Detailed Description

Author
Samuel Williams
Date
Fri 2 Jul 2021 16:29:01 NZST

Definition in file buffer.h.

Macro Definition Documentation

◆ RB_IO_BUFFER_EXPERIMENTAL

#define RB_IO_BUFFER_EXPERIMENTAL   1

Definition at line 22 of file buffer.h.

◆ RUBY_IO_BUFFER_VERSION

#define RUBY_IO_BUFFER_VERSION   2

Definition at line 24 of file buffer.h.

Enumeration Type Documentation

◆ rb_io_buffer_endian

enum rb_io_buffer_endian

Definition at line 67 of file buffer.h.

◆ rb_io_buffer_flags

enum rb_io_buffer_flags

Definition at line 38 of file buffer.h.

Function Documentation

◆ rb_io_buffer_clear()

void rb_io_buffer_clear ( VALUE  self,
uint8_t  value,
size_t  offset,
size_t  length 
)

Definition at line 2620 of file io_buffer.c.

◆ rb_io_buffer_free()

VALUE rb_io_buffer_free ( VALUE  self)

Definition at line 1451 of file io_buffer.c.

◆ rb_io_buffer_free_locked()

VALUE rb_io_buffer_free_locked ( VALUE  self)

Definition at line 1465 of file io_buffer.c.

◆ rb_io_buffer_get_bytes()

enum rb_io_buffer_flags rb_io_buffer_get_bytes ( VALUE  self,
void **  base,
size_t *  size 
)

Definition at line 825 of file io_buffer.c.

◆ rb_io_buffer_get_bytes_for_reading()

void rb_io_buffer_get_bytes_for_reading ( VALUE  self,
const void **  base,
size_t *  size 
)

Definition at line 893 of file io_buffer.c.

◆ rb_io_buffer_get_bytes_for_writing()

void rb_io_buffer_get_bytes_for_writing ( VALUE  self,
void **  base,
size_t *  size 
)

Definition at line 868 of file io_buffer.c.

◆ rb_io_buffer_lock()

VALUE rb_io_buffer_lock ( VALUE  self)

Definition at line 1331 of file io_buffer.c.

◆ rb_io_buffer_map()

VALUE rb_io_buffer_map ( VALUE  io,
size_t  size,
rb_off_t  offset,
enum rb_io_buffer_flags  flags 
)

Definition at line 621 of file io_buffer.c.

◆ rb_io_buffer_new()

VALUE rb_io_buffer_new ( void *  base,
size_t  size,
enum rb_io_buffer_flags  flags 
)

Definition at line 608 of file io_buffer.c.

◆ rb_io_buffer_pread()

VALUE rb_io_buffer_pread ( VALUE  self,
VALUE  io,
rb_off_t  from,
size_t  length,
size_t  offset 
)

Definition at line 2916 of file io_buffer.c.

◆ rb_io_buffer_pwrite()

VALUE rb_io_buffer_pwrite ( VALUE  self,
VALUE  io,
rb_off_t  from,
size_t  length,
size_t  offset 
)

Definition at line 3145 of file io_buffer.c.

◆ rb_io_buffer_read()

VALUE rb_io_buffer_read ( VALUE  self,
VALUE  io,
size_t  length,
size_t  offset 
)

Definition at line 2799 of file io_buffer.c.

◆ rb_io_buffer_resize()

void rb_io_buffer_resize ( VALUE  self,
size_t  size 
)

Definition at line 1681 of file io_buffer.c.

◆ rb_io_buffer_transfer()

VALUE rb_io_buffer_transfer ( VALUE  self)

Definition at line 1634 of file io_buffer.c.

◆ rb_io_buffer_try_unlock()

int rb_io_buffer_try_unlock ( VALUE  self)

Definition at line 1363 of file io_buffer.c.

◆ rb_io_buffer_unlock()

VALUE rb_io_buffer_unlock ( VALUE  self)

Definition at line 1352 of file io_buffer.c.

◆ rb_io_buffer_write()

VALUE rb_io_buffer_write ( VALUE  self,
VALUE  io,
size_t  length,
size_t  offset 
)

Definition at line 3036 of file io_buffer.c.

Variable Documentation

◆ rb_cIOBuffer

VALUE rb_cIOBuffer
extern

Definition at line 24 of file io_buffer.c.

◆ RUBY_IO_BUFFER_DEFAULT_SIZE

size_t RUBY_IO_BUFFER_DEFAULT_SIZE
extern

Definition at line 32 of file io_buffer.c.

◆ RUBY_IO_BUFFER_PAGE_SIZE

size_t RUBY_IO_BUFFER_PAGE_SIZE
extern

Definition at line 31 of file io_buffer.c.