Ruby: include/ruby/io/buffer.h File Reference

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

Macros | Enumerations | Functions | Variables
buffer.h File Reference
`#include "ruby/ruby.h"`
`#include "ruby/internal/config.h"`

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 }
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)
int | 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

Copyright
  Copyright (C) 2021 Samuel Williams
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

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 55 of file buffer.h.

## ◆ rb_io_buffer_flags

enum rb_io_buffer_flags

Definition at line 30 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 2367 of file io_buffer.c.

## ◆ rb_io_buffer_free()

VALUE rb_io_buffer_free | ( | VALUE | self | ) |

Definition at line 1205 of file io_buffer.c.

## ◆ rb_io_buffer_get_bytes()

int rb_io_buffer_get_bytes | ( | VALUE | self,
|  | void ** | base,
|  | size_t * | size )

Definition at line 1319 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 1387 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 1361 of file io_buffer.c.

## ◆ rb_io_buffer_lock()

VALUE rb_io_buffer_lock | ( | VALUE | self | ) |

Definition at line 1081 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 535 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 522 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 2647 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 2863 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 2543 of file io_buffer.c.

## ◆ rb_io_buffer_resize()

void rb_io_buffer_resize | ( | VALUE | self,
|  | size_t | size )

Definition at line 1462 of file io_buffer.c.

## ◆ rb_io_buffer_transfer()

VALUE rb_io_buffer_transfer | ( | VALUE | self | ) |

Definition at line 1415 of file io_buffer.c.

## ◆ rb_io_buffer_try_unlock()

int rb_io_buffer_try_unlock | ( | VALUE | self | ) |

Definition at line 1113 of file io_buffer.c.

## ◆ rb_io_buffer_unlock()

VALUE rb_io_buffer_unlock | ( | VALUE | self | ) |

Definition at line 1102 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 2766 of file io_buffer.c.

## Variable Documentation

## ◆ rb_cIOBuffer

VALUE rb_cIOBuffer
| extern

Definition at line 21 of file io_buffer.c.

## ◆ RUBY_IO_BUFFER_DEFAULT_SIZE

size_t RUBY_IO_BUFFER_DEFAULT_SIZE
| extern

Definition at line 29 of file io_buffer.c.

## ◆ RUBY_IO_BUFFER_PAGE_SIZE

size_t RUBY_IO_BUFFER_PAGE_SIZE
| extern

Definition at line 28 of file io_buffer.c.