Module uncategorized

Module uncategorized 

Source
Expand description

Contains all items that are not yet categorized by ABI stability. These items are candidates for promotion to stable or unstable in the future.

Structs§

OnigCaseFoldCodeItem

OnigCompileInfo

OnigEncodingTypeST

OnigErrorInfo

OnigMetaCharTableType

OnigRepeatRange

OnigSyntaxType

RArray__bindgen_ty_1__bindgen_ty_1
Arrays that use separated memory region for elements use this pattern.
RBasic
Ruby’s object’s, base components. Every single ruby objects have them in common.
RClass

RFile
Ruby’s File and IO. Ruby’s IO are not just file descriptors. They have buffers. They also have encodings. Various information are controlled using this struct.
RMatch
Regular expression execution context. When a regular expression “matches” to a string, it generates capture groups etc. This struct holds that info. Visible from Ruby as an instance of MatchData.
RObject
Ruby’s ordinal objects. Unless otherwise special cased, all predefined and user-defined classes share this struct to hold their instances.
RObject__bindgen_ty_1__bindgen_ty_1
Object that use separated memory region for instance variables use this pattern.
RRegexp
Ruby’s regular expression. A regexp is compiled into its own intermediate representation. This one holds that info. Regexp “match” operation then executes that IR.
RString__bindgen_ty_1__bindgen_ty_1
Strings that use separated memory region for contents use this pattern.
RString__bindgen_ty_1__bindgen_ty_2
Embedded contents.
_IO_FILE

_IO_codecvt

_IO_marker

_IO_wide_data

__BindgenBitfieldUnit

__atomic_wide_counter__bindgen_ty_1

__va_list_tag

fd_set

rb_arithmetic_sequence_components_t
Decomposed Enumerator::ArithmeicSequence. This is a subclass of ::rb_cEnumerator, which represents a sequence of numbers with common difference. Internal data structure of the class is opaque to users, but you can obtain a decomposed one using rb_arithmetic_sequence_extract.
rb_data_type_struct
@copydoc rb_data_type_t
rb_data_type_struct__bindgen_ty_1
Function pointers. Resembles C++ vtbl.
rb_debug_inspector_struct

rb_econv_t

rb_fdset_t
The data structure which wraps the fd_set bitmap used by select(2). This allows Ruby to use FD sets larger than that allowed by historic limitations on modern platforms.
rb_id_table
This is a table that holds instance variable name to index mapping. Used when accessing instance variables using names.
rb_internal_thread_event_hook

rb_io_buffer_t
IO buffers. This is an implementation detail of ::rb_io_t::wbuf and ::rb_io_t::rbuf. People don’t manipulate it directly.
rb_io_enc_t
Decomposed encoding flags (e.g. "enc:enc2"").
rb_io_t
Ruby’s IO, metadata and buffers.
rb_memory_view_entry
Operations applied to a specific kind of a memory view.
rb_memory_view_item_component_t
Memory view component metadata.
rb_memory_view_t
A MemoryView structure, [rb_memory_view_t], is used for exporting objects’ MemoryView.
rb_memory_view_t__bindgen_ty_1
Description of each components.
rb_ractor_local_key_struct

rb_ractor_local_storage_type
Type that defines a ractor-local storage.
rb_random_interface_t
PRNG algorithmic interface, analogous to Ruby level classes.
rb_random_interface_t__bindgen_ty_1
Major/minor versions of this interface
rb_random_struct
Base components of the random interface.
rb_trace_arg_struct

rb_vm_struct

re_patter_buffer
@endcond
re_pattern_buffer

re_registers

rmatch
Represents a match.
rmatch_offset
Represents the region of a capture group. This is basically for caching purpose. re_registers have similar concepts (beg and end) but they are in ptrdiff_t*. In order for us to implement MatchData#offset that info has to be converted to offset integers. This is the struct to hold such things.
st_hash_type

st_table

st_table_entry

stat

timespec

timeval
@endcond

Enums§

_bindgen_ty_24

rb_econv_result_t
return value of rb_econv_convert
rb_event_hook_flag_t
@cond INTERNAL_MACRO
rb_io_buffer_endian

rb_io_buffer_flags

rb_io_event_t
Type of events that an IO can wait.
rb_io_wait_readwrite
for rb_readwrite_sys_fail first argument
rb_warning_category_t
Warning categories. A warning issued using this API can be selectively requested / suppressed by the end-users. For instance passing -W:no-deprecated to the ruby process would suppress those warnings in deprecated category.
ruby_coderange_type
What rb_enc_str_coderange returns.
ruby_econv_flag_type
This enum is kind of omnibus. Gathers various constants.
ruby_encoding_consts

ruby_fl_type
The flags. Each ruby objects have their own characteristics apart from their classes. For instance whether an object is frozen or not is not controlled by its class. This is the type that represents such properties.
ruby_fl_ushift
This is an enum because GDB wants it (rather than a macro). People need not bother.
ruby_memory_view_flags
Flags passed to rb_memory_view_get, then to ::rb_memory_view_get_func_t.
ruby_rarray_consts
This is an enum because GDB wants it (rather than a macro). People need not bother.
ruby_rarray_flags

ruby_rmodule_flags

ruby_robject_flags

ruby_rstring_flags

ruby_rvalue_flags
This is an enum because GDB wants it (rather than a macro). People need not bother.
ruby_special_consts
special constants - i.e. non-zero and non-fixnum constants
ruby_value_type
C-level type of an object.
st_retval

Constants§

ATAN2_INF_C99
CASEFOLD_FILESYSTEM
COROUTINE_H
DLEXT
DLEXT_MAXLEN
ENABLE_MULTIARCH
ENUM_OVER_INT
FALSE
FMODE_APPEND
FMODE_BINMODE
FMODE_CREATE
FMODE_DUPLEX
FMODE_EXCL
FMODE_READABLE
FMODE_READWRITE
FMODE_SETENC_BY_BOM
FMODE_SYNC
FMODE_TEXTMODE
FMODE_TRUNC
FMODE_TTY
FMODE_WRITABLE
HAVE_ACOSH
HAVE_ALLOCA
HAVE_ALLOCA_H
HAVE_ARC4RANDOM_BUF
HAVE_ATAN2F
HAVE_ATAN2L
HAVE_ATTRIBUTE_ERRORFUNC
HAVE_ATTRIBUTE_FUNCTION_ALIAS
HAVE_ATTRIBUTE_WARNINGFUNC
HAVE_BACKTRACE
HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN
HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED
HAVE_BUILTIN___BUILTIN_BSWAP16
HAVE_BUILTIN___BUILTIN_BSWAP32
HAVE_BUILTIN___BUILTIN_BSWAP64
HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR
HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
HAVE_BUILTIN___BUILTIN_CLZ
HAVE_BUILTIN___BUILTIN_CLZL
HAVE_BUILTIN___BUILTIN_CLZLL
HAVE_BUILTIN___BUILTIN_CONSTANT_P
HAVE_BUILTIN___BUILTIN_CTZ
HAVE_BUILTIN___BUILTIN_CTZLL
HAVE_BUILTIN___BUILTIN_EXPECT
HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
HAVE_BUILTIN___BUILTIN_POPCOUNT
HAVE_BUILTIN___BUILTIN_POPCOUNTLL
HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW
HAVE_BUILTIN___BUILTIN_TRAP
HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P
HAVE_CBRT
HAVE_CHMOD
HAVE_CHOWN
HAVE_CHROOT
HAVE_CLOCKID_T
HAVE_CLOCK_GETRES
HAVE_CLOCK_GETTIME
HAVE_CONST_PAGE_SIZE
HAVE_COPY_FILE_RANGE
HAVE_COSH
HAVE_CRYPT
HAVE_CRYPT_H
HAVE_CRYPT_R
HAVE_DAYLIGHT
HAVE_DECL_GETENV
HAVE_DECL_SYS_NERR
HAVE_DEV_T
HAVE_DIRENT_H
HAVE_DIRFD
HAVE_DLADDR
HAVE_DLOPEN
HAVE_DL_ITERATE_PHDR
HAVE_DUP
HAVE_DUP2
HAVE_DUP3
HAVE_EACCESS
HAVE_ELF_H
HAVE_ENDGRENT
HAVE_ERF
HAVE_EVENTFD
HAVE_EXECL
HAVE_EXECLE
HAVE_EXECV
HAVE_EXECVE
HAVE_EXPLICIT_BZERO
HAVE_FCHMOD
HAVE_FCHOWN
HAVE_FCNTL
HAVE_FCNTL_H
HAVE_FDATASYNC
HAVE_FDOPENDIR
HAVE_FFS
HAVE_FINITE
HAVE_FLOAT_H
HAVE_FLOCK
HAVE_FMOD
HAVE_FORK
HAVE_FSTATAT
HAVE_FSYNC
HAVE_FTRUNCATE
HAVE_FTRUNCATE64
HAVE_FUNC_WEAK
HAVE_GCC_ATOMIC_BUILTINS
HAVE_GCC_SYNC_BUILTINS
HAVE_GETCONTEXT
HAVE_GETCWD
HAVE_GETEGID
HAVE_GETENTROPY
HAVE_GETEUID
HAVE_GETGID
HAVE_GETGRNAM
HAVE_GETGRNAM_R
HAVE_GETGROUPS
HAVE_GETLOGIN
HAVE_GETLOGIN_R
HAVE_GETPGID
HAVE_GETPGRP
HAVE_GETPPID
HAVE_GETPRIORITY
HAVE_GETPWNAM
HAVE_GETPWNAM_R
HAVE_GETPWUID
HAVE_GETPWUID_R
HAVE_GETRANDOM
HAVE_GETRESGID
HAVE_GETRESUID
HAVE_GETRLIMIT
HAVE_GETSID
HAVE_GETTIMEOFDAY
HAVE_GETUID
HAVE_GID_T
HAVE_GMP_H
HAVE_GMTIME_R
HAVE_GNU_QSORT_R
HAVE_GRANTPT
HAVE_GRP_H
HAVE_HYPOT
HAVE_INITGROUPS
HAVE_INT8_T
HAVE_INT16_T
HAVE_INT32_T
HAVE_INT64_T
HAVE_INT128_T
HAVE_INTPTR_T
HAVE_INTTYPES_H
HAVE_IOCTL
HAVE_ISFINITE
HAVE_KILL
HAVE_KILLPG
HAVE_LANGINFO_H
HAVE_LCHMOD
HAVE_LCHOWN
HAVE_LGAMMA_R
HAVE_LIBCRYPT
HAVE_LIBDL
HAVE_LIBGMP
HAVE_LIBPTHREAD
HAVE_LIBRT
HAVE_LIBZ
HAVE_LIMITS_H
HAVE_LINK
HAVE_LLABS
HAVE_LOCALE_H
HAVE_LOCKF
HAVE_LOG2
HAVE_LONG_LONG
HAVE_LSTAT
HAVE_LUTIMES
HAVE_MALLOC_H
HAVE_MALLOC_USABLE_SIZE
HAVE_MBLEN
HAVE_MEMALIGN
HAVE_MEMMEM
HAVE_MEMMOVE
HAVE_MEMRCHR
HAVE_MKFIFO
HAVE_MKNOD
HAVE_MKTIME
HAVE_MMAP
HAVE_MODE_T
HAVE_MREMAP
HAVE_NAN
HAVE_NEXTAFTER
HAVE_NULLPTR
HAVE_OFF_T
HAVE_OPENAT
HAVE_PCLOSE
HAVE_PID_T
HAVE_PIPE
HAVE_PIPE2
HAVE_POLL
HAVE_POPEN
HAVE_POSIX_FADVISE
HAVE_POSIX_MADVISE
HAVE_POSIX_MEMALIGN
HAVE_PPOLL
HAVE_PREAD
HAVE_PROTOTYPES
HAVE_PTHREAD_ATTR_GETGUARDSIZE
HAVE_PTHREAD_ATTR_GETSTACK
HAVE_PTHREAD_ATTR_SETINHERITSCHED
HAVE_PTHREAD_CONDATTR_SETCLOCK
HAVE_PTHREAD_GETATTR_NP
HAVE_PTHREAD_H
HAVE_PTHREAD_SETNAME_NP
HAVE_PTHREAD_SIGMASK
HAVE_PWD_H
HAVE_PWRITE
HAVE_QSORT_R
HAVE_RB_DATA_TYPE_T_FUNCTION
HAVE_RB_DATA_TYPE_T_PARENT
HAVE_RB_DEFINE_ALLOC_FUNC
HAVE_RB_EXT_RACTOR_SAFE
HAVE_RB_FD_INIT
HAVE_RB_IO_T
HAVE_RB_REG_NEW_STR
HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
HAVE_READLINK
HAVE_REALPATH
HAVE_RLIM_T
HAVE_ROUND
HAVE_RUBY_ATOMIC_H
HAVE_RUBY_DEBUG_H
HAVE_RUBY_DEFINES_H
HAVE_RUBY_ENCODING_H
HAVE_RUBY_FIBER_SCHEDULER_H
HAVE_RUBY_INTERN_H
HAVE_RUBY_IO_H
HAVE_RUBY_MEMORY_VIEW_H
HAVE_RUBY_MISSING_H
HAVE_RUBY_ONIGMO_H
HAVE_RUBY_ONIGURUMA_H
HAVE_RUBY_RACTOR_H
HAVE_RUBY_RANDOM_H
HAVE_RUBY_REGEX_H
HAVE_RUBY_RE_H
HAVE_RUBY_RUBY_H
HAVE_RUBY_ST_H
HAVE_RUBY_THREAD_H
HAVE_RUBY_THREAD_NATIVE_H
HAVE_RUBY_UTIL_H
HAVE_RUBY_VERSION_H
HAVE_RUBY_VM_H
HAVE_SANITIZER_ASAN_INTERFACE_H
HAVE_SCHED_GETAFFINITY
HAVE_SCHED_YIELD
HAVE_SEEKDIR
HAVE_SENDFILE
HAVE_SETCONTEXT
HAVE_SETEGID
HAVE_SETENV
HAVE_SETEUID
HAVE_SETGID
HAVE_SETGROUPS
HAVE_SETPGID
HAVE_SETPGRP
HAVE_SETREGID
HAVE_SETRESGID
HAVE_SETRESUID
HAVE_SETREUID
HAVE_SETRLIMIT
HAVE_SETSID
HAVE_SETUID
HAVE_SHUTDOWN
HAVE_SIGACTION
HAVE_SIGALTSTACK
HAVE_SIGNBIT
HAVE_SIGPROCMASK
HAVE_SIG_T
HAVE_SINH
HAVE_SSIZE_T
HAVE_STATX
HAVE_STDALIGN_H
HAVE_STDARG_PROTOTYPES
HAVE_STDBOOL_H
HAVE_STDINT_H
HAVE_STDIO_H
HAVE_STDLIB_H
HAVE_STMT_AND_DECL_IN_EXPR
HAVE_STRCHR
HAVE_STRERROR
HAVE_STRINGS_H
HAVE_STRING_H
HAVE_STRLCAT
HAVE_STRLCPY
HAVE_STRSTR
HAVE_STRUCT_CRYPT_DATA_INITIALIZED
HAVE_STRUCT_STATX_STX_BTIME
HAVE_STRUCT_STAT_ST_ATIM
HAVE_STRUCT_STAT_ST_BLKSIZE
HAVE_STRUCT_STAT_ST_BLOCKS
HAVE_STRUCT_STAT_ST_CTIM
HAVE_STRUCT_STAT_ST_MTIM
HAVE_STRUCT_STAT_ST_RDEV
HAVE_STRUCT_TIMESPEC
HAVE_STRUCT_TIMEVAL
HAVE_STRUCT_TIMEZONE
HAVE_STRUCT_TM_TM_GMTOFF
HAVE_STRUCT_TM_TM_ZONE
HAVE_SYMLINK
HAVE_SYSCALL
HAVE_SYSCALL_H
HAVE_SYSCONF
HAVE_SYSTEM
HAVE_SYS_EVENTFD_H
HAVE_SYS_FCNTL_H
HAVE_SYS_FILE_H
HAVE_SYS_IOCTL_H
HAVE_SYS_PARAM_H
HAVE_SYS_PRCTL_H
HAVE_SYS_RANDOM_H
HAVE_SYS_RESOURCE_H
HAVE_SYS_SELECT_H
HAVE_SYS_SENDFILE_H
HAVE_SYS_SOCKET_H
HAVE_SYS_STAT_H
HAVE_SYS_SYSCALL_H
HAVE_SYS_SYSMACROS_H
HAVE_SYS_TIMES_H
HAVE_SYS_TIME_H
HAVE_SYS_TYPES_H
HAVE_SYS_UIO_H
HAVE_SYS_USER_H
HAVE_SYS_WAIT_H
HAVE_TANH
HAVE_TELLDIR
HAVE_TGAMMA
HAVE_TIMEGM
HAVE_TIMER_CREATE
HAVE_TIMER_SETTIME
HAVE_TIMES
HAVE_TIME_H
HAVE_TIME_T
HAVE_TM_ZONE
HAVE_TRUE_LONG_LONG
HAVE_TRUNCATE
HAVE_TRUNCATE64
HAVE_TYPEOF
HAVE_TYPE_RB_DATA_TYPE_T
HAVE_TZSET
HAVE_UCONTEXT_H
HAVE_UID_T
HAVE_UINT8_T
HAVE_UINT16_T
HAVE_UINT32_T
HAVE_UINT64_T
HAVE_UINT128_T
HAVE_UINTPTR_T
HAVE_UMASK
HAVE_UNISTD_H
HAVE_UNSETENV
HAVE_UTIMENSAT
HAVE_UTIMES
HAVE_UTIME_H
HAVE_VA_ARGS_MACRO
HAVE_VFORK
HAVE_WAIT4
HAVE_WAITPID
HAVE_WCHAR_H
HAVE_WORKING_FORK
HAVE_WORKING_VFORK
HAVE_WRITEV
HAVE_X86INTRIN_H
HAVE__ALIGNOF
HAVE__BOOL
HAVE__LONGJMP
HAVE__SC_CLK_TCK
HAVE__SETJMP
HAVE___BUILTIN_UNREACHABLE
INCLUDE_RUBY_CONFIG_H
INTEGER_PACK_2COMP
INTEGER_PACK_BIG_ENDIAN
INTEGER_PACK_FORCE_BIGNUM
INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION
INTEGER_PACK_LITTLE_ENDIAN
INTEGER_PACK_LSBYTE_FIRST
INTEGER_PACK_LSWORD_FIRST
INTEGER_PACK_MSBYTE_FIRST
INTEGER_PACK_MSWORD_FIRST
INTEGER_PACK_NATIVE_BYTE_ORDER
INTEGER_PACK_NEGATIVE
INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
LIBDIR_BASENAME
NEGATIVE_TIME_T
ONIGENC_CASE_ASCII_ONLY
ONIGENC_CASE_DOWNCASE
ONIGENC_CASE_DOWN_SPECIAL
ONIGENC_CASE_FOLD
ONIGENC_CASE_FOLD_LITHUANIAN
ONIGENC_CASE_FOLD_MIN
ONIGENC_CASE_FOLD_TURKISH_AZERI
ONIGENC_CASE_IS_TITLECASE
ONIGENC_CASE_MODIFIED
ONIGENC_CASE_SPECIAL_OFFSET
ONIGENC_CASE_TITLECASE
ONIGENC_CASE_UPCASE
ONIGENC_CASE_UP_SPECIAL
ONIGENC_CODE_TO_MBC_MAXLEN
ONIGENC_CTYPE_ALNUM
ONIGENC_CTYPE_ALPHA
ONIGENC_CTYPE_ASCII
ONIGENC_CTYPE_BLANK
ONIGENC_CTYPE_CNTRL
ONIGENC_CTYPE_DIGIT
ONIGENC_CTYPE_GRAPH
ONIGENC_CTYPE_LOWER
ONIGENC_CTYPE_NEWLINE
ONIGENC_CTYPE_PRINT
ONIGENC_CTYPE_PUNCT
ONIGENC_CTYPE_SPACE
ONIGENC_CTYPE_UPPER
ONIGENC_CTYPE_WORD
ONIGENC_CTYPE_XDIGIT
ONIGENC_FLAG_NONE
ONIGENC_FLAG_UNICODE
ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM
ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN
ONIGENC_MAX_STD_CTYPE
ONIGENC_MBC_CASE_FOLD_MAXLEN
ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE
ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE
ONIGERR_CONTROL_CODE_SYNTAX
ONIGERR_DEFAULT_ENCODING_IS_NOT_SET
ONIGERR_EMPTY_CHAR_CLASS
ONIGERR_EMPTY_GROUP_NAME
ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS
ONIGERR_END_PATTERN_AT_CONTROL
ONIGERR_END_PATTERN_AT_ESCAPE
ONIGERR_END_PATTERN_AT_LEFT_BRACE
ONIGERR_END_PATTERN_AT_LEFT_BRACKET
ONIGERR_END_PATTERN_AT_META
ONIGERR_END_PATTERN_IN_GROUP
ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS
ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY
ONIGERR_INVALID_ARGUMENT
ONIGERR_INVALID_BACKREF
ONIGERR_INVALID_CHAR_IN_GROUP_NAME
ONIGERR_INVALID_CHAR_PROPERTY_NAME
ONIGERR_INVALID_CODE_POINT_VALUE
ONIGERR_INVALID_COMBINATION_OF_OPTIONS
ONIGERR_INVALID_CONDITION_PATTERN
ONIGERR_INVALID_GROUP_NAME
ONIGERR_INVALID_LOOK_BEHIND_PATTERN
ONIGERR_INVALID_POSIX_BRACKET_TYPE
ONIGERR_INVALID_REPEAT_RANGE_PATTERN
ONIGERR_INVALID_WIDE_CHAR_VALUE
ONIGERR_MATCH_STACK_LIMIT_OVER
ONIGERR_MEMORY
ONIGERR_META_CODE_SYNTAX
ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE
ONIGERR_MULTIPLEX_DEFINED_NAME
ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL
ONIGERR_NESTED_REPEAT_OPERATOR
ONIGERR_NEVER_ENDING_RECURSION
ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION
ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED
ONIGERR_PARSER_BUG
ONIGERR_PARSE_DEPTH_LIMIT_OVER
ONIGERR_PREMATURE_END_OF_CHAR_CLASS
ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR
ONIGERR_STACK_BUG
ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID
ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED
ONIGERR_TOO_BIG_BACKREF_NUMBER
ONIGERR_TOO_BIG_NUMBER
ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE
ONIGERR_TOO_BIG_WIDE_CHAR_VALUE
ONIGERR_TOO_LONG_WIDE_CHAR_VALUE
ONIGERR_TOO_MANY_CAPTURE_GROUPS
ONIGERR_TOO_MANY_MULTI_BYTE_RANGES
ONIGERR_TOO_SHORT_DIGITS
ONIGERR_TOO_SHORT_MULTI_BYTE_STRING
ONIGERR_TYPE_BUG
ONIGERR_UNDEFINED_BYTECODE
ONIGERR_UNDEFINED_GROUP_OPTION
ONIGERR_UNDEFINED_GROUP_REFERENCE
ONIGERR_UNDEFINED_NAME_REFERENCE
ONIGERR_UNEXPECTED_BYTECODE
ONIGERR_UNMATCHED_CLOSE_PARENTHESIS
ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS
ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE
ONIGMO_VERSION_MAJOR
ONIGMO_VERSION_MINOR
ONIGMO_VERSION_TEENY
ONIGURUMA_REGEX_H
ONIGURUMA_VERSION_MAJOR
ONIGURUMA_VERSION_MINOR
ONIGURUMA_VERSION_TEENY
ONIG_CHAR_TABLE_SIZE
ONIG_INEFFECTIVE_META_CHAR
ONIG_MAX_BACKREF_NUM
ONIG_MAX_CAPTURE_GROUP_NUM
ONIG_MAX_CAPTURE_HISTORY_GROUP
ONIG_MAX_ERROR_MESSAGE_LEN
ONIG_MAX_MULTI_BYTE_RANGES_NUM
ONIG_MAX_REPEAT_NUM
ONIG_META_CHAR_ANYCHAR
ONIG_META_CHAR_ANYCHAR_ANYTIME
ONIG_META_CHAR_ANYTIME
ONIG_META_CHAR_ESCAPE
ONIG_META_CHAR_ONE_OR_MORE_TIME
ONIG_META_CHAR_ZERO_OR_ONE_TIME
ONIG_MISMATCH
ONIG_NORMAL
ONIG_NO_SUPPORT_CONFIG
ONIG_NREGION
ONIG_OPTION_ASCII_RANGE
ONIG_OPTION_CAPTURE_GROUP
ONIG_OPTION_DONT_CAPTURE_GROUP
ONIG_OPTION_DOTALL
ONIG_OPTION_EXTEND
ONIG_OPTION_FIND_LONGEST
ONIG_OPTION_FIND_NOT_EMPTY
ONIG_OPTION_IGNORECASE
ONIG_OPTION_MAXBIT
ONIG_OPTION_MULTILINE
ONIG_OPTION_NEGATE_SINGLELINE
ONIG_OPTION_NEWLINE_CRLF
ONIG_OPTION_NONE
ONIG_OPTION_NOTBOL
ONIG_OPTION_NOTBOS
ONIG_OPTION_NOTEOL
ONIG_OPTION_NOTEOS
ONIG_OPTION_POSIX_BRACKET_ALL_RANGE
ONIG_OPTION_SINGLELINE
ONIG_OPTION_WORD_BOUND_ALL_RANGE
ONIG_REGION_NOTPOS
ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC
ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC
ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV
ONIG_SYN_ALLOW_INVALID_INTERVAL
ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME
ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL
ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP
ONIG_SYN_BACKSLASH_ESCAPE_IN_CC
ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP
ONIG_SYN_CONTEXT_INDEP_ANCHORS
ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS
ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS
ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND
ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY
ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC
ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY
ONIG_SYN_OP2_CCLASS_SET_OP
ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL
ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP
ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META
ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE
ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK
ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER
ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR
ONIG_SYN_OP2_ESC_G_BRACE_BACKREF
ONIG_SYN_OP2_ESC_G_SUBEXP_CALL
ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE
ONIG_SYN_OP2_ESC_H_XDIGIT
ONIG_SYN_OP2_ESC_K_NAMED_BACKREF
ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY
ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT
ONIG_SYN_OP2_ESC_U_HEX4
ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE
ONIG_SYN_OP2_ESC_V_VTAB
ONIG_SYN_OP2_INEFFECTIVE_ESCAPE
ONIG_SYN_OP2_OPTION_PERL
ONIG_SYN_OP2_OPTION_RUBY
ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL
ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT
ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP
ONIG_SYN_OP2_QMARK_GROUP_EFFECT
ONIG_SYN_OP2_QMARK_LPAREN_CONDITION
ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP
ONIG_SYN_OP2_QMARK_SUBEXP_CALL
ONIG_SYN_OP2_QMARK_TILDE_ABSENT
ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET
ONIG_SYN_OP_ASTERISK_ZERO_INF
ONIG_SYN_OP_BRACE_INTERVAL
ONIG_SYN_OP_BRACKET_CC
ONIG_SYN_OP_DECIMAL_BACKREF
ONIG_SYN_OP_DOT_ANYCHAR
ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF
ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR
ONIG_SYN_OP_ESC_BRACE_INTERVAL
ONIG_SYN_OP_ESC_B_WORD_BOUND
ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR
ONIG_SYN_OP_ESC_CONTROL_CHARS
ONIG_SYN_OP_ESC_C_CONTROL
ONIG_SYN_OP_ESC_D_DIGIT
ONIG_SYN_OP_ESC_LPAREN_SUBEXP
ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END
ONIG_SYN_OP_ESC_OCTAL3
ONIG_SYN_OP_ESC_O_BRACE_OCTAL
ONIG_SYN_OP_ESC_PLUS_ONE_INF
ONIG_SYN_OP_ESC_QMARK_ZERO_ONE
ONIG_SYN_OP_ESC_S_WHITE_SPACE
ONIG_SYN_OP_ESC_VBAR_ALT
ONIG_SYN_OP_ESC_W_WORD
ONIG_SYN_OP_ESC_X_BRACE_HEX8
ONIG_SYN_OP_ESC_X_HEX2
ONIG_SYN_OP_LINE_ANCHOR
ONIG_SYN_OP_LPAREN_SUBEXP
ONIG_SYN_OP_PLUS_ONE_INF
ONIG_SYN_OP_POSIX_BRACKET
ONIG_SYN_OP_QMARK_NON_GREEDY
ONIG_SYN_OP_QMARK_ZERO_ONE
ONIG_SYN_OP_VARIABLE_META_CHARACTERS
ONIG_SYN_OP_VBAR_ALT
ONIG_SYN_STRICT_CHECK_BACKREF
ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP
ONIG_SYN_WARN_CC_DUP
ONIG_SYN_WARN_CC_OP_NOT_ESCAPED
ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT
ONIG_TRAVERSE_CALLBACK_AT_BOTH
ONIG_TRAVERSE_CALLBACK_AT_FIRST
ONIG_TRAVERSE_CALLBACK_AT_LAST
OnigCodePointMask
OnigCodePointMaskWidth
OnigSpecialIndexShift
OnigSpecialIndexWidth
PATH_ENV
PATH_SEP
POSIX_SIGNAL
PRIXPTRDIFF
PRIXSIZE
PRIXVALUE
PRI_64_PREFIX
PRI_INT_PREFIX
PRI_LL_PREFIX
PRI_LONG_PREFIX
PRI_PTRDIFF_PREFIX
PRI_SHORT_PREFIX
PRI_SIZE_PREFIX
PRI_VALUE_PREFIX
PRIdPTRDIFF
PRIdSIZE
PRIdVALUE
PRIiPTRDIFF
PRIiSIZE
PRIoPTRDIFF
PRIoSIZE
PRIoVALUE
PRIsVALUE
PRIuPTRDIFF
PRIuSIZE
PRIuVALUE
PRIxPTRDIFF
PRIxSIZE
PRIxVALUE
RB_BLOCK_CALL_FUNC_STRICT
RB_DEBUG_H
RB_EVENT_HOOKS_HAVE_CALLBACK_DATA
RB_IO_BUFFER_EXPERIMENTAL
RB_NOGVL_INTR_FAIL
RB_NOGVL_UBF_ASYNC_SAFE
RB_NO_KEYWORDS
RB_NUM_COERCE_FUNCS_NEED_OPID
RB_PASS_KEYWORDS
RB_SCAN_ARGS_KEYWORDS
RB_SCAN_ARGS_LAST_HASH_KEYWORDS
RB_SCAN_ARGS_PASS_CALLED_KEYWORDS
RB_WAITFD_IN
RB_WAITFD_OUT
RB_WAITFD_PRI
RGENGC_WB_PROTECTED_ARRAY
RGENGC_WB_PROTECTED_BIGNUM
RGENGC_WB_PROTECTED_CLASS
RGENGC_WB_PROTECTED_COMPLEX
RGENGC_WB_PROTECTED_FLOAT
RGENGC_WB_PROTECTED_HASH
RGENGC_WB_PROTECTED_NODE_CREF
RGENGC_WB_PROTECTED_OBJECT
RGENGC_WB_PROTECTED_RATIONAL
RGENGC_WB_PROTECTED_REGEXP
RGENGC_WB_PROTECTED_STRING
RGENGC_WB_PROTECTED_STRUCT
ROBJECT_OFFSET_AS_ARY
ROBJECT_OFFSET_AS_HEAP_IVPTR
ROBJECT_OFFSET_AS_HEAP_IV_INDEX_TBL
RUBY_ALLOCV_LIMIT
RUBY_API_VERSION_CODE
RUBY_API_VERSION_MAJOR
RUBY_API_VERSION_MINOR
RUBY_API_VERSION_TEENY
RUBY_ATOMIC_GENERIC_MACRO
RUBY_AUTHOR
RUBY_BIRTH_DAY
RUBY_BIRTH_MONTH
RUBY_BIRTH_YEAR
RUBY_BLOCK_CALL_FUNC_TAKES_BLOCKARG
RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER
RUBY_DEBUG
RUBY_DEFINES_H
RUBY_ENCODING_H
RUBY_EVENT_ALL
RUBY_EVENT_B_CALL
RUBY_EVENT_B_RETURN
RUBY_EVENT_CALL
RUBY_EVENT_CLASS
RUBY_EVENT_C_CALL
RUBY_EVENT_C_RETURN
RUBY_EVENT_END
RUBY_EVENT_FIBER_SWITCH
RUBY_EVENT_LINE
RUBY_EVENT_NONE
RUBY_EVENT_RAISE
RUBY_EVENT_RESERVED_FOR_INTERNAL_USE
RUBY_EVENT_RETURN
RUBY_EVENT_SCRIPT_COMPILED
RUBY_EVENT_SWITCH
RUBY_EVENT_THREAD_BEGIN
RUBY_EVENT_THREAD_END
RUBY_EVENT_TRACEPOINT_ALL
RUBY_FIBER_SCHEDULER_VERSION
RUBY_FL_DUPPED
RUBY_H
RUBY_INTEGER_UNIFICATION
RUBY_INTERNAL_EVENT_FREEOBJ
RUBY_INTERNAL_EVENT_GC_END_MARK
RUBY_INTERNAL_EVENT_GC_END_SWEEP
RUBY_INTERNAL_EVENT_GC_ENTER
RUBY_INTERNAL_EVENT_GC_EXIT
RUBY_INTERNAL_EVENT_GC_START
RUBY_INTERNAL_EVENT_MASK
RUBY_INTERNAL_EVENT_NEWOBJ
RUBY_INTERNAL_EVENT_OBJSPACE_MASK
RUBY_INTERNAL_EVENT_SWITCH
RUBY_INTERNAL_THREAD_EVENT_EXITED
RUBY_INTERNAL_THREAD_EVENT_MASK
RUBY_INTERNAL_THREAD_EVENT_READY
RUBY_INTERNAL_THREAD_EVENT_RESUMED
RUBY_INTERNAL_THREAD_EVENT_STARTED
RUBY_INTERNAL_THREAD_EVENT_SUSPENDED
RUBY_INTERN_H
RUBY_IO_BUFFER_VERSION
RUBY_IO_H
RUBY_MEMORY_VIEW_H
RUBY_MISSING_H
RUBY_NDEBUG
RUBY_PLATFORM
RUBY_PRI_VALUE_MARK
RUBY_RACTOR_H
RUBY_RANDOM_H
RUBY_RANDOM_INTERFACE_VERSION_MAJOR
RUBY_RANDOM_INTERFACE_VERSION_MAJOR_MAX
RUBY_RANDOM_INTERFACE_VERSION_MINOR
RUBY_RANDOM_INTERFACE_VERSION_MINOR_MAX
RUBY_RE_H
RUBY_RUBY_BACKWARD_H
RUBY_RUBY_H
RUBY_ST_H
RUBY_SUBST_H
RUBY_THREAD_H
RUBY_THREAD_NATIVE_H
RUBY_UNTYPED_DATA_WARNING
RUBY_UTIL_H
RUBY_VERSION_H
RUBY_VM
RUBY_VM_H
SIGNEDNESS_OF_CLOCKID_T
SIGNEDNESS_OF_DEV_T
SIGNEDNESS_OF_GID_T
SIGNEDNESS_OF_MODE_T
SIGNEDNESS_OF_OFF_T
SIGNEDNESS_OF_PID_T
SIGNEDNESS_OF_RLIM_T
SIGNEDNESS_OF_TIME_T
SIGNEDNESS_OF_UID_T
SIZEOF_CLOCK_T
SIZEOF_DEV_T
SIZEOF_DOUBLE
SIZEOF_FLOAT
SIZEOF_INT
SIZEOF_INT8_T
SIZEOF_INT16_T
SIZEOF_INT32_T
SIZEOF_INT64_T
SIZEOF_INT128_T
SIZEOF_INTPTR_T
SIZEOF_LONG
SIZEOF_LONG_LONG
SIZEOF_OFF_T
SIZEOF_PTRDIFF_T
SIZEOF_SHORT
SIZEOF_SIZE_T
SIZEOF_SSIZE_T
SIZEOF_STRUCT_STAT_ST_BLOCKS
SIZEOF_STRUCT_STAT_ST_DEV
SIZEOF_STRUCT_STAT_ST_INO
SIZEOF_STRUCT_STAT_ST_RDEV
SIZEOF_STRUCT_STAT_ST_SIZE
SIZEOF_STRUCT_TIMEVAL_TV_SEC
SIZEOF_ST_INDEX_T
SIZEOF_TIME_T
SIZEOF_UINT8_T
SIZEOF_UINT16_T
SIZEOF_UINT32_T
SIZEOF_UINT64_T
SIZEOF_UINT128_T
SIZEOF_UINTPTR_T
SIZEOF_VALUE
SIZEOF_VOIDP
SIZEOF___INT64
SIZEOF___INT128
STACK_GROW_DIRECTION
STDC_HEADERS
THREAD_IMPL_H
THREAD_IMPL_SRC
TRUE
UNALIGNED_WORD_ACCESS
UNLIMITED_ARGUMENTS
USE_COPY_FILE_RANGE
USE_ELF
USE_FLONUM
USE_GC_MALLOC_OBJ_INFO_DETAILS
USE_MJIT
USE_RGENGC
USE_RGENGC_LOGGING_WB_UNPROTECT
USE_RINCGC
USE_RVARGC
USE_SYMBOL_AS_METHOD_NAME
USE_TRANSIENT_HEAP
USE_UNALIGNED_MEMBER_ACCESS
USE_YJIT
_ALL_SOURCE
_DARWIN_C_SOURCE
_GNU_SOURCE
_HPUX_ALT_XOPEN_SOCKET_API
_NETBSD_SOURCE
_OPENBSD_SOURCE
_POSIX_PTHREAD_SEMANTICS
_REENTRANT
_TANDEM_SOURCE
_THREAD_SAFE
__EXTENSIONS__
__STDC_WANT_IEC_60559_ATTRIBS_EXT__
__STDC_WANT_IEC_60559_BFP_EXT__
__STDC_WANT_IEC_60559_DFP_EXT__
__STDC_WANT_IEC_60559_FUNCS_EXT__
__STDC_WANT_IEC_60559_TYPES_EXT__
__STDC_WANT_LIB_EXT2__
__STDC_WANT_MATH_SPEC_FUNCS__

Statics§

OnigDefaultCaseFoldFlag

OnigDefaultSyntax

OnigEncDefaultCharEncoding

OnigEncodingASCII

OnigSyntaxASIS

OnigSyntaxEmacs

OnigSyntaxGnuRegex

OnigSyntaxGrep

OnigSyntaxJava

OnigSyntaxPerl

OnigSyntaxPerl58

OnigSyntaxPerl58_NG

OnigSyntaxPosixBasic

OnigSyntaxPosixExtended

OnigSyntaxPython

OnigSyntaxRuby

RUBY_IO_BUFFER_DEFAULT_SIZE

RUBY_IO_BUFFER_PAGE_SIZE

rb_argv0
The value of $0 at process bootup.
rb_cArray
< Array class.
rb_cBasicObject
< BasicObject class.
rb_cBinding
< Binding class.
rb_cClass
< Class class.
rb_cComplex
< Complex class.
rb_cDir
< Dir class.
rb_cEncoding
< Encoding class.
rb_cEnumerator
< Enumerator class.
rb_cFalseClass
< FalseClass class.
rb_cFile
< File class.
rb_cFloat
< Float class.
rb_cHash
< Hash class.
rb_cIO
< IO class.
rb_cIOBuffer

rb_cInteger
< Module class.
rb_cMatch
< MatchData class.
rb_cMethod
< Method class.
rb_cModule
< Module class.
rb_cNameErrorMesg
< NameError::Message class.
rb_cNilClass
< NilClass class.
rb_cNumeric
< Numeric class.
rb_cObject

rb_cProc
< Proc class.
rb_cRactor
Ractor class.
rb_cRandom
< Random class.
rb_cRange
< Range class.
rb_cRational
< Rational class.
rb_cRefinement
< Refinement class.
rb_cRegexp
< Regexp class.
rb_cStat
< File::Stat class.
rb_cString
< String class.
rb_cStruct
< Struct class.
rb_cSymbol
< Sumbol class.
rb_cThread
< Thread class.
rb_cTime
< Time class.
rb_cTrueClass
< TrueClass class.
rb_cUnboundMethod
< UnboundMethod class.
rb_default_rs
This is the default value of ::rb_rs, i.e. "\n". It seems it has always been just a newline string since the beginning. Not sure why C codes has to use this, given there is no way for ruby programs to interface.
rb_eArgError
< ArgumentError exception.
rb_eEOFError
< EOFError exception.
rb_eEncCompatError
< Encoding::CompatibilityError exception.
rb_eEncodingError
< EncodingError exception.
rb_eException
< Mother of all exceptions.
rb_eFatal
< fatal exception.
rb_eFloatDomainError
< FloatDomainError exception.
rb_eFrozenError
< FrozenError exception.
rb_eIOError
< IOError exception.
rb_eIOTimeoutError
Indicates that a timeout has occurred while performing an IO operation.
rb_eIndexError
< IndexError exception.
rb_eInterrupt
< Interrupt exception.
rb_eKeyError
< KeyError exception.
rb_eLoadError
< LoadError exception.
rb_eLocalJumpError
< LocalJumpError exception.
rb_eMathDomainError
< Math::DomainError exception.
rb_eNameError
< NameError exception.
rb_eNoMatchingPatternError
< NoMatchingPatternError exception.
rb_eNoMatchingPatternKeyError
< NoMatchingPatternKeyError exception.
rb_eNoMemError
< NoMemoryError exception.
rb_eNoMethodError
< NoMethodError exception.
rb_eNotImpError
< NotImplementedError exception.
rb_eRangeError
< RangeError exception.
rb_eRegexpError
< RegexpError exception.
rb_eRuntimeError
< RuntimeError exception.
rb_eScriptError
< ScriptError exception.
rb_eSecurityError
< SecurityError exception.
rb_eSignal
< SignalException exception.
rb_eStandardError
< StandardError exception.
rb_eStopIteration
< StopIteration exception.
rb_eSyntaxError
< SyntaxError exception.
rb_eSysStackError
< SystemStackError exception.
rb_eSystemCallError
< SystemCallError exception.
rb_eSystemExit
< SystemExit exception.
rb_eThreadError
< ThreadError exception.
rb_eTypeError
< TypeError exception.
rb_eZeroDivError
< ZeroDivisionError exception.
rb_fs
The field separator character for inputs, or the $;. This affects how String#split works. You can set this via the -F command line option. You can also assign arbitrary ruby objects programmatically, but it makes best sense for you to assign a regular expression here.
rb_mComparable
< Comparable module.
rb_mEnumerable
< Enumerable module.
rb_mErrno
< Errno module.
rb_mFileTest
< FileTest module.
rb_mGC
< GC module.
rb_mKernel
< Kernel module.
rb_mMath
< Math module.
rb_mProcess
< Process module.
rb_mWaitReadable
< IO::WaitReadable module.
rb_mWaitWritable
< IO::WaitReadable module.
rb_memory_view_exported_object_registry
@cond INTERNAL_MACRO
rb_memory_view_exported_object_registry_data_type

rb_output_fsDeprecated
The field separator character for outputs, or the $,. This affects how Array#join works.
rb_output_rsDeprecated
The record separator character for outputs, or the $\. This affects how IO#print works.
rb_ractor_local_storage_type_free
A type of ractor-local storage that destructs itself using ::ruby_xfree.
rb_random_data_type_1_0
The data that holds the backend type of ::rb_cRandom. Used as your PRNG’s ::rb_data_type_struct::parent.
rb_rsDeprecated
The record separator character for inputs, or the $/. This affects how IO#gets works. You can set this via the -0 command line option.
rb_stderr
< STDERR constant.
rb_stdin
< STDIN constant.
rb_stdout
< STDOUT constant.
ruby_api_version
API versions, in { major, minor, teeny } order.
ruby_copyright
Copyright notice.
ruby_description
This is what ruby -v prints to the standard error. Something like: "ruby 2.5.9p229 (2021-04-05 revision 67829) [x86_64-linux]". This doesn’t include runtime options like a JIT being enabled.
ruby_digit36_to_number_table
Character to number mapping like 'a' -> 10, 'b' -> 11 etc. For punctuation etc., the value is -1. “36” terminology comes from the fact that this is the table behind str.to_i(36).
ruby_engine
This is just "ruby" for us. But different implementations can have different strings here.
ruby_hexdigits
Characters that Ruby accepts as hexadecimal digits. This is /\h/ expanded into an array.
ruby_patchlevel
This is a monotonic increasing integer that describes specific “patch” level. You can know the exact changeset your binary is running by this info (and ::ruby_version), unless this is -1. -1 means there is no release yet for the version; ruby is actively developed. 0 means the initial GA version.
ruby_platform
Target platform identifier, in a C string.
ruby_release_date
Date of release, in a C string.
ruby_version
Stringised version.

Functions§

onig_capture_tree_traverse

onig_check_linear_time

onig_copy_encoding

onig_copy_syntax

onig_copyright

onig_end

onig_error_code_to_str

onig_foreach_name

onig_free

onig_free_body

onig_get_case_fold_flag

onig_get_default_case_fold_flag

onig_get_encoding

onig_get_match_stack_limit_size

onig_get_options

onig_get_parse_depth_limit

onig_get_syntax

onig_get_syntax_behavior

onig_get_syntax_op

onig_get_syntax_op2

onig_get_syntax_options

onig_init

onig_initialize

onig_match

onig_name_to_backref_number

onig_name_to_group_numbers

onig_new

onig_new_deluxe

onig_new_without_alloc

onig_noname_group_capture_is_active

onig_null_warn

onig_number_of_capture_histories

onig_number_of_captures

onig_number_of_names

onig_reg_init

onig_region_clear

onig_region_copy

onig_region_free

onig_region_init

onig_region_new

onig_region_resize

onig_region_set

onig_scan

onig_search

onig_search_gpos

onig_set_default_case_fold_flag

onig_set_default_syntax

onig_set_match_stack_limit_size

onig_set_meta_char

onig_set_parse_depth_limit

onig_set_syntax_behavior

onig_set_syntax_op

onig_set_syntax_op2

onig_set_syntax_options

onig_set_verb_warn_func

onig_set_warn_func

onig_version

onigenc_ascii_only_case_map

onigenc_get_default_encoding

onigenc_get_left_adjust_char_head

onigenc_get_prev_char_head

onigenc_get_right_adjust_char_head

onigenc_get_right_adjust_char_head_with_prev

onigenc_init

onigenc_mbclen

onigenc_set_default_encoding

onigenc_step_back

onigenc_str_bytelen_null

onigenc_strlen

onigenc_strlen_null

rb_Array
This is the logic behind Kernel#Array. Arguments are converted by first trying #to_ary, then #to_a, and if both failed, returns an array of length 1 that contains the passed argument as the sole contents.
rb_Complex
Converts various values into a Complex. This function accepts:
rb_Float
This is the logic behind Kernel#Float. Numeric types are converted directly to the nearest value that a Float can represent. Strings are interpreted strictly; only leading/trailing whitespaces are allowed except what strtod understands. Anything else are converted using #to_f.
rb_Hash
This is the logic behind Kernel#Hash. Arguments are converted by first trying #to_hash. if it failed, and the argument is either ::RUBY_Qnil or an empty array, returns an empty hash. Otherwise an exception is raised.
rb_Integer
This is the logic behind Kernel#Integer. Numeric types are converted directly, with floating point numbers being truncated. Strings are interpreted strictly; only leading/trailing whitespaces, plus/minus sign, radix indicators such as 0x, digits, and underscores are allowed. Anything else are converted by first trying #to_int, then #to_i.
rb_Rational
Converts various values into a Rational. This function accepts:
rb_String
This is the logic behind Kernel#String. Arguments are converted by first trying #to_str, then #to_s.
rb_absint_numwords
Calculates the number of words needed represent the absolute value of the passed integer. Unlike rb_absint_size this function can overflow. It returns (size_t)-1 then.
rb_absint_singlebit_p
Tests abs(val) consists only of a bit or not.
rb_absint_size
Calculates the number of bytes needed to represent the absolute value of the passed integer.
rb_add_event_hook
Registers an event hook function.
rb_add_event_hook2

rb_alias
Resembles alias.
rb_alias_variable
Aliases a global variable. Did you know that you can alias a global variable? It is like aliasing methods:
rb_alloc_tmp_buffer

rb_alloc_tmp_buffer_with_count

rb_any_to_s
Generates a textual representation of the given object.
rb_apply
Identical to rb_funcallv, except it takes Ruby’s array instead of C’s. @param[in,out] recv Receiver of the method. @param[in] mid Name of the method to call. @param[in] args An instance of ::RArray. @exception rb_eNoMethodError No such method. @exception rb_eException Any exceptions happen inside. @return What the method evaluates to. @pre args must be an ::RArray. Call to_ary beforehand when necessary.
rb_arithmetic_sequence_beg_len_step
Identical to rb_range_beg_len, except it takes an instance of Enumerator::ArithmericSequence.
rb_arithmetic_sequence_extract
Extracts components of the passed arithmetic sequence. This can be seen as an extended version of rb_range_values.
rb_ary_aref
Queries element(s) of an array. This is complicated! Refer Array#slice document for the complete description of how it behaves.
rb_ary_assoc
Looks up the passed key, assuming the passed array is an alist. An “alist” here is a list of “association“s, much like that of Emacs. Emacs has assoc function that behaves exactly the same as this one.
rb_ary_cat
Destructively appends multiple elements at the end of the array.
rb_ary_clear
Destructively removes everything form an array.
rb_ary_cmp
Recursively compares each elements of the two arrays one-by-one using <=>.
rb_ary_concat
Destructively appends the contents of latter into the end of former.
rb_ary_delete
Destructively removes elements from the passed array, so that there would be no elements inside that satisfy == relationship with the passed object. Returns the last deleted element if any. But in case there was nothing to delete it gets complicated. It checks for the implicitly passed block. If there is a block the return value would be what the block evaluates to. Otherwise it resorts to ::RUBY_Qnil.
rb_ary_delete_at
Destructively removes an element which resides at the specific index of the passed array. Unlike [rb_ary_stre] the index can be negative, which means the index counts backwards from the array’s tail.
rb_ary_detransient
Destructively converts an array of transient backend into ordinal one.
rb_ary_dup
Duplicates an array.
rb_ary_each
Iteratively yields each element of the passed array to the implicitly passed block if any. In case there is no block given, an enumerator that does the thing is generated instead.
rb_ary_entry
Queries an element of an array. When passed offset is negative it counts backwards.
rb_ary_free
Destroys the given array for no reason.
rb_ary_freeze
@alias{rb_obj_freeze}
rb_ary_hidden_new
Allocates a hidden (no class) empty array.
rb_ary_includes
Queries if the passed array has the passed entry.
rb_ary_join
Recursively stringises the elements of the passed array, flattens that result, then joins the sequence using the passed separator.
rb_ary_modify
Declares that the array is about to be modified. This for instance let the array have a dedicated backend storage.
rb_ary_new
Allocates a new, empty array.
rb_ary_new_capa
Identical to rb_ary_new, except it additionally specifies how many rooms of objects it should allocate. This way you can create an array whose capacity is bigger than the length of it. If you can say that an array grows to a specific amount, this could be effective than resizing an array over and over again and again.
rb_ary_new_from_args
Constructs an array from the passed objects.
rb_ary_new_from_values
Identical to rb_ary_new_from_args, except how objects are passed.
rb_ary_plus
Creates a new array, concatenating the former to the latter.
rb_ary_pop
Destructively deletes an element from the end of the passed array and returns what was deleted.
rb_ary_ptr_use_end

rb_ary_ptr_use_start

rb_ary_push
Special case of rb_ary_cat that it adds only one element.
rb_ary_rassoc
Identical to rb_ary_assoc, except it scans the passed array from the opposite direction.
rb_ary_replace
Replaces the contents of the former object with the contents of the latter.
rb_ary_resize
Expands or shrinks the passed array to the passed length.
rb_ary_resurrect
I guess there is no use case of this function in extension libraries, but this is a routine identical to rb_ary_dup. This makes the most sense when the passed array is formerly hidden by rb_obj_hide.
rb_ary_reverse
Destructively reverses the passed array in-place.
rb_ary_rotate
Destructively rotates the passed array in-place to towards its end. The amount can be negative. Would rotate to the opposite direction then.
rb_ary_shared_with_p
Queries if the passed two arrays share the same backend storage. A use-case for knowing such property is to take a snapshot of an array (using e.g. rb_ary_replace, then check later if that snapshot still shares the storage with the original. Taking a snapshot is ultra-cheap. If nothing happens the impact shall be minimal. But if someone modifies the original, that entity shall pay the cost of copy-on-write. You can detect that using this API.
rb_ary_shift
Destructively deletes an element from the beginning of the passed array and returns what was deleted. It can also be seen as a routine identical to rb_ary_pop, except which side of the array to scrub.
rb_ary_sort
Creates a copy of the passed array, whose elements are sorted according to their <=> result.
rb_ary_sort_bang
Destructively sorts the passed array in-place, according to each elements’ <=> result.
rb_ary_store
Destructively stores the passed value to the passed array’s passed index. It also resizes the array’s backend storage so that the requested index is not out of bounds.
rb_ary_subseq
Obtains a part of the passed array.
rb_ary_to_ary
Force converts an object to an array. It first tries its #to_ary method. Takes the result if any. Otherwise creates an array of size 1 whose sole element is the passed object.
rb_ary_to_s
Converts an array into a human-readable string. Historically its behaviour changed over time. Currently it is identical to calling inspect method. This behaviour is from that of python (!!) circa 2006.
rb_ary_unshift
Destructively prepends the passed item at the beginning of the passed array. It can also be seen as a routine identical to rb_ary_push, except which side of the array to modify.
rb_ascii8bit_encindex
Identical to rb_ascii8bit_encoding, except it returns the encoding’s index instead of the encoding itself.
rb_ascii8bit_encoding
Queries the encoding that represents ASCII-8BIT a.k.a. binary.
rb_assert_failure

rb_assoc_new
Identical to rb_ary_new_from_values, except it expects exactly two parameters.
rb_attr
This function resembles now-deprecated Module#attr.
rb_attr_get
Identical to rb_ivar_get
rb_autoload_load
Kicks the autoload procedure as if it was “touched”.
rb_autoload_p
Queries if an autoload is defined at a point.
rb_backref_get
Queries the last match, or Regexp.last_match, or the $~. You don’t have to use it, because in reality you can get $~ using rb_gv_get as usual.
rb_backref_set
Updates $~. You don’t have to use it, because in reality you can set $~ using rb_gv_set as usual.
rb_backtrace
Prints the backtrace out to the standard error. This just confuses people for no reason. Evil souls must only use it.
rb_big2dbl
Converts a bignum into C’s double.
rb_big2ll
Converts a bignum into C’s long long.
rb_big2long
Converts a bignum into C’s long.
rb_big2str
Generates a place-value representation of the passed integer.
rb_big2ull
Converts a bignum into C’s unsigned long long.
rb_big2ulong
Converts a bignum into C’s unsigned long.
rb_big_2comp
Destructively modify the passed bignum into 2’s complement representation.
rb_big_and
Performs bitwise and of the passed two objects.
rb_big_clone
Duplicates the given bignum.
rb_big_cmp
Compares the passed two bignums.
rb_big_div
Performs division of the passed two objects.
rb_big_divmod
Performs “divmod” operation. The operation in bignum’s context is that it calculates rb_big_idiv and rb_big_modulo at once.
rb_big_eq
Equality, in terms of ==. This checks if the value is the same, not the identity. For instance 1 == 1.0 must hold.
rb_big_eql
Equality, in terms of eql?. Unlike rb_big_eq it does not convert ::rb_cFloat etc. This function returns ::RUBY_Qtrue if and only if both parameters are bignums, which represent the identical numerical value.
rb_big_idiv
Performs “integer division”. This is different from rb_big_div.
rb_big_lshift
Performs shift left.
rb_big_minus
Performs subtraction of the passed two objects.
rb_big_modulo
Performs modulo of the passed two objects.
rb_big_mul
Performs multiplication of the passed two objects.
rb_big_new
Allocates a bignum object.
rb_big_norm
Normalises the passed bignum. It for instance returns a fixnum of the same value if fixnum can represent that number.
rb_big_or
Performs bitwise or of the passed two objects.
rb_big_pack
Converts a bignum into a series of its parts.
rb_big_plus
Performs addition of the passed two objects.
rb_big_pow
Raises x to the powerof y.
rb_big_resize
Destructively resizes the backend storage of the passed bignum.
rb_big_rshift
Performs shift right.
rb_big_sign
The “sign” of a bignum.
rb_big_unpack
Constructs a (possibly very big) bignum from a series of integers. buf[0] would be the return value’s least significant word; buf[num_longs-1] would be that of most significant.
rb_big_xor
Performs exclusive or of the passed two objects.
rb_bigzero_p
Queries if the passed bignum instance is a “bigzro”. What is a bigzero? Well, bignums are for very big integers, but can also represent tiny ones like -1, 0, 1. Bigzero are instances of bignums whose values are zero. Knowing if a bignum is bigzero can be handy on occasions, like for instance detecting division by zero situation.
rb_binding_new
Snapshots the current execution context and turn it into an instance of ::rb_cBinding.
rb_block_call
Identical to rb_funcallv, except it additionally passes a function as a block. When the method yields, proc is called with the yielded value as its first argument, and data2 as the second. Yielded values would be packed into an array if multiple values are yielded at once.
rb_block_call_kw
Identical to rb_funcallv_kw, except it additionally passes a function as a block. It can also be seen as a routine identical to rb_block_call, except it handles keyword-ness of argv[argc-1].
rb_block_given_p
Determines if the current method is given a block.
rb_block_lambda
Identical to rb_proc_new, except it returns a lambda.
rb_block_proc
Constructs a Proc object from implicitly passed components. When a ruby method is called with a block, that block is not explicitly passed around using C level function parameters. This function gathers all the necessary info to turn them into a Ruby level instance of ::rb_cProc.
rb_bug
Interpreter panic switch. Immediate process termination without any synchronisations shall occur. LOTS of internal states, stack traces, and even machine registers are displayed if possible for debugging purposes then.
rb_bug_errno
This is a wrapper of rb_bug which automatically constructs appropriate message from the passed errno.
rb_call_super
This resembles ruby’s super.
rb_call_super_kw
Identical to rb_call_super, except you can specify how to handle the last element of the given array.
rb_catch
Executes the passed block and catches values thrown from inside of it.
rb_catch_obj
Identical to rb_catch, except it catches arbitrary Ruby objects.
rb_category_compile_warn
Identical to rb_compile_warn, except it also accepts category.
rb_category_warn
Identical to rb_category_warning, except it reports always regardless of runtime -W flag.
rb_category_warning
Identical to rb_warning, except it takes additional “category” parameter.
rb_char_to_option_kcode
Converts a character option to its encoding. It only supports a very limited set of Japanese encodings due to its Japanese origin. Ruby still has this in-core for backwards compatibility. But new codes must not bother such concept like one-character encoding option. Consider deprecated in practice.
rb_check_array_type
Try converting an object to its array representation using its to_ary method, if any. If there is no such thing, returns ::RUBY_Qnil.
rb_check_convert_type
Identical to rb_convert_type, except it returns ::RUBY_Qnil instead of raising exceptions, in case of conversion failure. It still raises exceptions for various reasons, like when the conversion method itself raises, though.
rb_check_copyable
Ensures that the passed object can be initialize_copy relationship. When you implement your own one you would better call this at the right beginning of your implementation.
rb_check_frozen
Queries if the passed object is frozen.
rb_check_funcall
Identical to rb_funcallv, except it returns ::RUBY_Qundef instead of raising ::rb_eNoMethodError.
rb_check_funcall_kw
Identical to rb_check_funcall, except you can specify how to handle the last element of the given array. It can also be seen as a routine identical to rb_funcallv_kw, except it returns ::RUBY_Qundef instead of raising ::rb_eNoMethodError.
rb_check_hash_type
Try converting an object to its hash representation using its to_hash method, if any. If there is no such thing, returns ::RUBY_Qnil.
rb_check_id
Detects if the given name is already interned or not. It first tries to convert the argument to an instance of ::rb_cString if it is neither an instance of ::rb_cString nor ::rb_cSymbol. The conversion result is written back to the variable. Then queries if that name was already interned before. If found it returns such id, otherwise zero.
rb_check_id_cstr
Identical to rb_check_id, except it takes a pointer to a memory region instead of Ruby’s string.
rb_check_inheritable
Asserts that the given class can derive a child class. A class might or might not be able to do so; for instance a singleton class cannot.
rb_check_safe_strDeprecated

rb_check_string_type
Try converting an object to its stringised representation using its to_str method, if any. If there is no such thing, returns ::RUBY_Qnil.
rb_check_symbol
Identical to rb_check_id, except it returns an instance of ::rb_cSymbol instead.
rb_check_symbol_cstr
Identical to rb_check_id_cstr, except for the return type. It can also be seen as a routine identical to rb_check_symbol, except it takes a pointer to a memory region instead of Ruby’s string.
rb_check_to_float
This is complicated.
rb_check_to_int
Identical to rb_check_to_integer, except it uses #to_int for conversion.
rb_check_to_integer
Identical to rb_check_convert_type, except the return value type is fixed to ::rb_cInteger.
rb_check_type

rb_check_typeddata
Identical to rb_typeddata_is_kind_of, except it raises exceptions instead of returning false.
rb_class2name
Queries the name of the passed class.
rb_class_attached_object
Returns the attached object for a singleton class. If the given class is not a singleton class, raises a TypeError.
rb_class_descendants
Queries the class’s descendants. This routine gathers classes that are subclasses of the given class (or subclasses of those subclasses, etc.), returning an array of classes that have the given class as an ancestor. The returned array does not include the given class or singleton classes.
rb_class_get_superclass
Returns the superclass of a class. @param[in] klass An object of RClass. @retval RUBY_Qfalse klass has no super class. @retval otherwise Raw superclass of klass @see rb_class_superclass
rb_class_inherited_p
Determines if the given two modules are relatives.
rb_class_instance_methods
Generates an array of symbols, which are the list of method names defined in the passed class.
rb_class_name
Queries the name of the given object’s class.
rb_class_new
Creates a new, anonymous class.
rb_class_new_instance
Allocates, then initialises an instance of the given class. It first calls the passed class’ allocator to obtain an uninitialised object, then calls its initialiser with the remaining arguments.
rb_class_new_instance_kw
Identical to rb_class_new_instance, except you can specify how to handle the last element of the given array.
rb_class_new_instance_pass_kw
Identical to rb_class_new_instance, except it passes the passed keywords if any to the #initialize method.
rb_class_path
Identical to rb_mod_name, except it returns #<Class: ...> style inspection for anonymous modules.
rb_class_path_cached
@alias{rb_mod_name}
rb_class_private_instance_methods
Identical to rb_class_instance_methods, except it returns names of methods that are private only.
rb_class_protected_instance_methods
Identical to rb_class_instance_methods, except it returns names of methods that are protected only.
rb_class_public_instance_methods
Identical to rb_class_instance_methods, except it returns names of methods that are public only.
rb_class_real
Finds a “real” class. As the name implies there are class objects that are surreal. This function takes a class, traverses its ancestry tree, and returns its nearest ancestor which is neither a module nor a singleton class.
rb_class_subclasses
Queries the class’s direct descendants. This routine gathers classes that are direct subclasses of the given class, returning an array of classes that have the given class as a superclass. The returned array does not include singleton classes.
rb_class_superclass
Queries the parent of the given class.
rb_clear_constant_cache

rb_clear_constant_cache_for_id
Clears the inline constant caches associated with a particular ID. Extension libraries should not bother with such things. Just forget about this API (or even, the presence of constant caches).
rb_cloexec_dup
Identical to rb_cloexec_fcntl_dupfd, except it implies minfd is 3.
rb_cloexec_dup2
Identical to rb_cloexec_dup, except you can specify the destination file descriptor. If the destination is already squatted by another file descriptor that gets silently closed without any warnings. (This is a spec requested by POSIX.)
rb_cloexec_fcntl_dupfd
Duplicates a file descriptor with closing on exec. In case of POSIX environments, a child process inherits its parent’s opened file descriptors. Which is nowadays considered as one of the UNIX mistakes. This function duplicates a file descriptor as dup(2) does, but additionally instructs the operating system that we don’t want the duplicated FD be seen from child processes.
rb_cloexec_open
Opens a file that closes on exec. In case of POSIX environments, a child process inherits its parent’s opened file descriptors. Which is nowadays considered as one of the UNIX mistakes. This function opens a file descriptor as open(2) does, but additionally instructs the operating system that we don’t want it be seen from child processes.
rb_cloexec_pipe
Opens a pipe with closing on exec. In case of POSIX environments, a child process inherits its parent’s opened file descriptors. Which is nowadays considered as one of the UNIX mistakes. This function opens a pipe as pipe(2) does, but additionally instructs the operating system that we don’t want the duplicated FDs be seen from child processes.
rb_close_before_exec
Closes everything. In case of POSIX environments, a child process inherits its parent’s opened file descriptors. Which is nowadays considered as one of the UNIX mistakes. This function closes such inherited file descriptors. When your C extension needs to have a child process, don’t forget to call this from your child process right before exec.
rb_cmperr
Raises “comparison failed” error.
rb_cmpint
Canonicalises the passed val, which is the return value of a <=> b, into C’s {-1, 0, 1}. This can be handy when you implement a callback function to pass to qsort(3) etc.
rb_compile_warn
Identical to rb_compile_warning, except it reports always regardless of runtime -W flag.
rb_compile_warning
Issues a compile-time warning that happens at __file__:__line__. Purpose of this function being exposed to CAPI is unclear.
rb_complex_abs
Queries the absolute (or the magnitude) of the passed object.
rb_complex_arg
Queries the argument (or the angle) of the passed object.
rb_complex_conjugate
Performs complex conjugation of the passed object.
rb_complex_div
Performs division of the passed two objects.
rb_complex_imag
Queries the imaginary part of the passed Complex.
rb_complex_minus
Performs subtraction of the passed two objects.
rb_complex_mul
Performs multiplication of the passed two objects.
rb_complex_new
Constructs a Complex, by first multiplying the imaginary part with 1i then adds it to the real part. This definition doesn’t need both arguments be real numbers. It can happily combine two instances of ::rb_cComplex (with rotating the latter one).
rb_complex_new_polar
Constructs a Complex using polar representations. Unlike rb_complex_new it makes no sense to pass non-real instances to this function.
rb_complex_plus
Performs addition of the passed two objects.
rb_complex_polar
@old{rb_complex_new_polar}
rb_complex_pow
Performs exponentiation of the passed two objects.
rb_complex_raw
Identical to rb_complex_new, except it assumes both arguments are not instances of ::rb_cComplex. It is thus dangerous for extension libraries.
rb_complex_real
Queries the real part of the passed Complex.
rb_complex_uminus
Performs negation of the passed object.
rb_const_defined
Queries if the constant is defined at the namespace.
rb_const_defined_at
Identical to rb_const_defined, except it doesn’t look for parent classes. For instance Array is a toplevel constant, which is visible from everywhere. But this function does not take such things into account. It concerns only what is directly defined inside of the given namespace.
rb_const_defined_from
Identical to rb_const_defined, except it returns false for private constants.
rb_const_get
Identical to rb_const_defined, except it returns the actual defined value.
rb_const_get_at
Identical to rb_const_defined_at, except it returns the actual defined value. It can also be seen as a routine identical to rb_const_get, except it doesn’t look for parent classes.
rb_const_get_from
Identical to rb_const_defined_at, except it returns the actual defined value. It can also be seen as a routine identical to rb_const_get, except it doesn’t return a private constant.
rb_const_list
This is another mysterious API that comes with no documents at all. It seems it expects some specific data structure for the passed pointer. But the details has never been made explicit. It seems nobody should use this API.
rb_const_remove
Identical to rb_mod_remove_const, except it takes the name as ::ID instead of ::VALUE.
rb_const_set
Names a constant.
rb_convert_type
Converts an object into another type. Calls the specified conversion method if necessary.
rb_copy_generic_ivar
Copies the list of instance variables. 3rd parties need not know, but there are several ways to store an object’s instance variables, depending on its internal structure. This function makes sense when either of the passed objects are using so-called “generic” backend storage. This distinction is purely an implementation detail of [rb_clone_setup]. People need not be aware of this working behind-the-scenes.
rb_cstr2inum
Identical to rb_cstr_to_inum, except the second argument controls the base and badcheck at once. It basically doesn’t raise for parse errors, unless the base is zero.
rb_cstr_to_dbl
Converts a textual representation of a real number into a numeric, which is the nearest value that the return type can represent, of the value that the argument represents. This is in fact a 2-in-1 function whose behaviour can be controlled using the second (mode) argument. If the mode is zero, this function is in “historical” mode which only understands “floating-constant” defined at ISO/IEC 9899:1990 section 6.1.3.1. If the mode is nonzero, it is in “extended” mode, which also accepts “hexadecimal-floating-constant” defined at ISO/IEC 9899:2018 section 6.4.4.2.
rb_cstr_to_inum
Parses C’s string to convert into a Ruby’s integer. It understands prefixes (e.g. 0x) and underscores.
rb_current_receiver
This resembles ruby’s self.
rb_cv_get
Identical to rb_cvar_get, except it accepts C’s string instead of ::ID.
rb_cv_set
Identical to rb_cvar_set, except it accepts C’s string instead of ::ID.
rb_cvar_defined
Queries if the given class has the given class variable.
rb_cvar_find
Identical to rb_cvar_get, except it takes additional “front” pointer. This extra parameter is a buffer, which will have the class where the queried class variable actually resides.
rb_cvar_get
Obtains a value from a class variable.
rb_cvar_set
Assigns a value to a class variable.
rb_data_object_wrap
This is the primitive way to wrap an existing C struct into ::RData.
rb_data_object_zalloc
Identical to rb_data_object_wrap, except it allocates a new data region internally instead of taking an existing one. The allocation is done using ruby_calloc(). Hence it makes no sense to pass anything other than ::RUBY_DEFAULT_FREE to the last argument.
rb_data_typed_object_wrap
This is the primitive way to wrap an existing C struct into ::RTypedData.
rb_data_typed_object_zalloc
Identical to rb_data_typed_object_wrap, except it allocates a new data region internally instead of taking an existing one. The allocation is done using ruby_calloc(). Hence it makes no sense for type->function.dfree to be anything other than ::RUBY_TYPED_DEFAULT_FREE.
rb_dbl2big
Converts a C’s double into a bignum.
rb_dbl_cmp
Compares two doubles. Handy when implementing a spaceship operator.
rb_dbl_complex_new
Identical to rb_complex_new, except it takes the arguments as C’s double instead of Ruby’s object.
rb_debug_inspector_backtrace_locations
Queries the backtrace object of the context. This is as if you call caller_locations at the point of debugger.
rb_debug_inspector_current_depth
Return current frmae depth.
rb_debug_inspector_frame_binding_get
Queries the binding of the passed context’s upper frame.
rb_debug_inspector_frame_class_get
Queries the current class of the passed context’s upper frame.
rb_debug_inspector_frame_depth
Queries the depth of the passed context’s upper frame.
rb_debug_inspector_frame_iseq_get
Queries the instruction sequence of the passed context’s upper frame.
rb_debug_inspector_frame_self_get
Queries the current receiver of the passed context’s upper frame.
rb_debug_inspector_open
Prepares, executes, then cleans up a debug session.
rb_debug_rstring_null_ptr

rb_default_external_encoding
Queries the “default external” encoding. This is used to interact with outer-process things such as File. Though not recommended, you can set this using rb_enc_set_default_external.
rb_default_internal_encoding
Queries the “default internal” encoding. This could be a null pointer. Otherwise, outer-process info are transcoded from default external encoding to this one during reading from an IO.
rb_define_alias
Defines an alias of a method.
rb_define_alloc_func
Sets the allocator function of a class.
rb_define_attr
Defines public accessor method(s) for an attribute.
rb_define_class
Defines a top-level class.
rb_define_class_id
This is a very badly designed API that creates an anonymous class.
rb_define_class_id_under
Identical to rb_define_class_under, except it takes the name in ::ID instead of C’s string.
rb_define_class_under
Defines a class under the namespace of outer.
rb_define_class_variable
@alias{rb_cv_set}
rb_define_const
Defines a Ruby level constant under a namespace.
rb_define_dummy_encoding
Creates a new “dummy” encoding. Roughly speaking, an encoding is dummy when it is stateful. Notable example of dummy encoding are those defined in ISO/IEC 2022
rb_define_finalizer
Assigns a finaliser for an object. Each objects can have objects (typically blocks) that run immediately after that object dies. They are called finalisers of an object. This function associates a finaliser object with a target object.
rb_define_global_const
Identical to rb_define_const, except it defines that of “global”, i.e. toplevel constant.
rb_define_global_function
Defines a global function.
rb_define_hooked_variable
Identical to rb_define_virtual_variable, but can also specify a storage. A programmer can use the storage for e.g. memoisation, storing intermediate computation result, etc.
rb_define_method
Defines a method.
rb_define_method_id
Identical to rb_define_method, except it takes the name of the method in ::ID instead of C’s string.
rb_define_module
Defines a top-level module.
rb_define_module_function
Defines a module function for a module.
rb_define_module_id
This is a very badly designed API that creates an anonymous module.
rb_define_module_id_under
Identical to rb_define_module_under, except it takes the name in ::ID instead of C’s string.
rb_define_module_under
Defines a module under the namespace of outer.
rb_define_private_method
Identical to rb_define_method, except it defines a private method.
rb_define_protected_method
Identical to rb_define_method, except it defines a protected method.
rb_define_readonly_variable
Identical to rb_define_variable, except it does not allow Ruby programs to assign values to such global variable. C codes can still set values at will. This could be handy for you when implementing an errno-like experience, where a method updates a read-only global variable as a side- effect.
rb_define_singleton_method
Identical to rb_define_method, except it defines a singleton method.
rb_define_variable
“Shares” a global variable between Ruby and C. Normally a Ruby-level global variable is stored somewhere deep inside of the interpreter’s execution context, but this way you can explicitly specify its storage.
rb_define_virtual_variable
Defines a global variable that is purely function-backended. By using this API a programmer can define a global variable that dynamically changes from time to time.
rb_deprecate_constant
Asserts that the given constant is deprecated. Attempt to refer such constant will produce a warning.
rb_detach_process
“Detaches” a subprocess. In POSIX systems every child processes that a process creates must be wait(2)-ed. A child process that died yet has not been waited so far is called a “zombie”, which more or less consumes resources. This function automates reclamation of such processes. Once after this function successfully returns you can basically forget about the child process.
rb_dir_getwd
Queries the path of the current working directory of the current process.
rb_during_gc
Queries if the GC is busy.
rb_each
This is a shorthand of calling obj.each.
rb_econv_append
Converts the passed C’s pointer according to the passed converter, then append the conversion result to the passed Ruby’s string. This way buffer overflow is properly avoided to resize the destination properly.
rb_econv_asciicompat_encoding
Queries the passed encoding’s corresponding ASCII compatible encoding. “The corresponding ASCII compatible encoding” in this context is an ASCII compatible encoding which can represent exactly the same character sets as the given ASCII incompatible encoding. For instance that of UTF-16LE is UTF-8.
rb_econv_binmode
This badly named function does not set the destination encoding to binary, but instead just nullifies newline conversion decorators if any. Other ordinal character conversions still happen after this; something non-binary would still be generated.
rb_econv_check_error
This is a rb_econv_make_exception + rb_exc_raise combo.
rb_econv_close
Destructs a converter. Note that a converter can have a buffer, and can be non-empty. Calling this would lose your data then.
rb_econv_convert
Converts a string from an encoding to another.
rb_econv_decorate_at_first
“Decorate“s a converter. There are special kind of converters that transforms the contents, like replacing CR into CRLF. You can add such decorators to a converter using this API. By using this function a decorator is prepended at the beginning of a conversion sequence: in case of CRLF conversion, newlines are converted before encodings are converted.
rb_econv_decorate_at_last
Identical to rb_econv_decorate_at_first, except it adds to the opposite direction. For instance CRLF conversion would run after encodings are converted.
rb_econv_encoding_to_insert_output
Queries an encoding name which best suits for rb_econv_insert_output’s last parameter. Strings in this encoding need no conversion when inserted; can be both time/space efficient.
rb_econv_has_convpath_p
Queries if there is more than one way to convert between the passed two encodings. Encoding conversion are has_and_belongs_to_many relationships. There could be no direct conversion defined for the passed pair. Ruby tries to find an indirect way to do so then. For instance ISO-8859-1 has no direct conversion to ISO-2022-JP. But there is ISO-8859-1 to UTF-8 conversion; then there is UTF-8 to EUC-JP conversion; finally there also is EUC-JP to ISO-2022-JP conversion. So in short ISO-8859-1 can be converted to ISO-2022-JP using that path. This function returns true. Obviously not everything that can be represented using UTF-8 can also be represented using EUC-JP. Conversions in practice can fail depending on the actual input, and that renders exceptions in case of rb_str_encode.
rb_econv_insert_output
Appends the passed string to the passed converter’s output buffer. This can be handy when an encoding needs bytes out of thin air; for instance ISO-2022-JP has “shift function” which does not correspond to any characters.
rb_econv_make_exception
This function makes sense right after rb_econv_convert returns. As listed in ::rb_econv_result_t, rb_econv_convert can bail out for various reasons. This function checks the passed converter’s internal state and convert it to an appropriate exception object.
rb_econv_open
Creates a new instance of struct ::rb_econv_t.
rb_econv_open_exc
Creates a [rb_eConverterNotFoundError] exception object (but does not raise).
rb_econv_open_opts
Identical to rb_econv_open, except it additionally takes a hash of optional strings.
rb_econv_prepare_options
Identical to rb_econv_prepare_opts, except it additionally takes the initial value of flags. The extra bits are bitwise-ORed to the return value.
rb_econv_prepare_opts
Splits a keyword arguments hash (that for instance String#encode took) into a set of enum ::ruby_econv_flag_type and a hash storing replacement characters etc.
rb_econv_putback
Puts back the bytes. In case of ::econv_invalid_byte_sequence, some of those invalid bytes are discarded and the others are buffered to be converted later. The latter bytes can be put back using this API.
rb_econv_putbackable
Queries if rb_econv_putback makes sense, i.e. there are invalid byte sequences remain in the buffer.
rb_econv_set_replacement
Assigns the replacement string. The string passed here would appear in converted string when it cannot represent its source counterpart. This can happen for instance you convert an emoji to ISO-8859-1.
rb_econv_str_append
Identical to rb_econv_str_convert, except it appends the conversion result to the additionally passed string instead of creating a new string. It can also be seen as a routine identical to rb_econv_append, except it takes a Ruby’s string instead of C’s pointer.
rb_econv_str_convert
Identical to rb_econv_convert, except it takes Ruby’s string instead of C’s pointer.
rb_econv_substr_append
Identical to rb_econv_str_append, except it appends only a part of the passed string with conversion. It can also be seen as a routine identical to rb_econv_substr_convert, except it appends the conversion result to the additionally passed string instead of creating a new string.
rb_econv_substr_convert
Identical to rb_econv_str_convert, except it converts only a part of the passed string. Can be handy when you for instance want to do line-buffered conversion.
rb_enc_alias
Registers an “alias” name. In the wild, an encoding can be called using multiple names. For instance an encoding known as "CP932" is also called "SJIS" on occasions. This API registers such relationships.
rb_enc_ascget
Queries the code point of character pointed by the passed pointer. If that code point is included in ASCII that code point is returned. Otherwise -1. This can be different from just looking at the first byte. For instance it reads 2 bytes in case of UTF-16BE.
rb_enc_associate
Identical to rb_enc_associate_index, except it takes an encoding itself instead of its index.
rb_enc_associate_index
Identical to rb_enc_set_index, except it additionally does contents fix-up depending on the passed object. It for instance changes the byte length of terminating U+0000 according to the passed encoding.
rb_enc_capable
Queries if the passed object can have its encoding.
rb_enc_check
Identical to rb_enc_compatible, except it raises an exception instead of returning NULL.
rb_enc_codelen
Queries the number of bytes requested to represent the passed code point using the passed encoding.
rb_enc_codepoint_len
Queries the code point of character pointed by the passed pointer. Exceptions happen in case of broken input.
rb_enc_compatible
Look for the “common” encoding between the two. One character can or cannot be expressed depending on an encoding. This function finds the super-set of encodings that satisfy contents of both arguments. If that is impossible returns NULL.
rb_enc_copy
Destructively copies the encoding of the latter object to that of former one. It can also be seen as a routine identical to rb_enc_associate_index, except it takes an object’s encoding instead of an encoding’s index.
rb_enc_default_external
Identical to rb_default_external_encoding, except it returns the Ruby-level counterpart instance of ::rb_cEncoding that corresponds to the default external encoding.
rb_enc_default_internal
Identical to rb_default_internal_encoding, except it returns the Ruby-level counterpart instance of ::rb_cEncoding that corresponds to the default internal encoding.
rb_enc_dummy_p
Queries if the passed encoding is dummy.
rb_enc_fast_mbclen
Identical to rb_enc_mbclen unless the character at p overruns e. That can happen for instance when you read from a socket and its partial read cuts a wide character in-between. In those situations this function “estimates” theoretical length of the character in question. Typically it tends to be possible to know how many bytes a character needs before actually reaching its end; for instance UTF-8 encodes a character’s length in the first byte of it. This function returns that info.
rb_enc_find
Identical to rb_find_encoding, except it takes a C’s string instead of Ruby’s.
rb_enc_find_index
Queries the index of the encoding.
rb_enc_from_encoding
Queries the Ruby-level counterpart instance of ::rb_cEncoding that corresponds to the passed encoding.
rb_enc_from_index
Identical to rb_find_encoding, except it takes an encoding index instead of a Ruby object.
rb_enc_get
Identical to rb_enc_get_index, except the return type.
rb_enc_get_index
Queries the index of the encoding of the passed object, if any.
rb_enc_interned_str
Identical to rb_enc_str_new, except it returns a “f“string. It can also be seen as a routine identical to rb_interned_str, except it additionally takes an encoding.
rb_enc_interned_str_cstr
Identical to rb_enc_str_new_cstr, except it returns a “f“string. It can also be seen as a routine identical to rb_interned_str_cstr, except it additionally takes an encoding.
rb_enc_mbclen
Queries the number of bytes of the character at the passed pointer.
rb_enc_nth
Queries the n-th character. Like rb_enc_strlen this function can be fast or slow depending on the contents. Don’t expect characters to be uniformly distributed across the entire string.
rb_enc_path_end
This just returns the passed end basically. It makes difference in case the passed string ends with tons of path separators like the following:
rb_enc_path_last_separator
Returns the last path component.
rb_enc_path_next
Returns a path component directly adjacent to the passed pointer.
rb_enc_path_skip_prefix
Seeks for non-prefix part of a pathname. This can be a no-op when the OS has no such concept like a path prefix. But there are OSes where path prefixes do exist.
rb_enc_precise_mbclen
Queries the number of bytes of the character at the passed pointer. This function returns 3 different types of information:
rb_enc_raise
Identical to rb_raise, except it additionally takes an encoding.
rb_enc_reg_new
Identical to rb_reg_new, except it additionally takes an encoding.
rb_enc_replicate
Creates a new encoding, using the passed one as a template.
rb_enc_set_default_external
Destructively assigns the passed encoding as the default external encoding. You should not use this API. It has process-global side effects. Also it doesn’t change encodings of strings that have already been read.
rb_enc_set_default_internal
Destructively assigns the passed encoding as the default internal encoding. You should not use this API. It has process-global side effects. Also it doesn’t change encodings of strings that have already been read.
rb_enc_set_index
Destructively assigns an encoding (via its index) to an object.
rb_enc_sprintf
Identical to rb_sprintf, except it additionally takes an encoding. The passed encoding rules both the incoming format specifier and the resulting string.
rb_enc_str_asciionly_p
Queries if the passed string is “ASCII only”. An ASCII only string is a string who doesn’t have any non-ASCII characters at all. This doesn’t necessarily mean the string is in ASCII encoding. For instance a String of CP932 encoding can quite much be ASCII only, depending on its contents.
rb_enc_str_buf_cat
Identical to rb_str_cat, except it additionally takes an encoding.
rb_enc_str_coderange
Scans the passed string to collect its code range. Because a Ruby’s string is mutable, its contents change from time to time; so does its code range. A long-lived string tends to fall back to ::RUBY_ENC_CODERANGE_UNKNOWN. This API scans it and re-assigns a fine-grained code range constant.
rb_enc_str_new
Identical to rb_enc_str_new, except it additionally takes an encoding.
rb_enc_str_new_cstr
Identical to rb_enc_str_new, except it assumes the passed pointer is a pointer to a C string. It can also be seen as a routine identical to rb_str_new_cstr, except it additionally takes an encoding.
rb_enc_str_new_static
Identical to rb_enc_str_new, except it takes a C string literal. It can also be seen as a routine identical to rb_str_new_static, except it additionally takes an encoding.
rb_enc_strlen
Counts the number of characters of the passed string, according to the passed encoding. This has to be complicated. The passed string could be invalid and/or broken. This routine would scan from the beginning til the end, byte by byte, to seek out character boundaries. Could be super slow.
rb_enc_symname2_p
Identical to rb_enc_symname_p, except it additionally takes the passed string’s length. This is needed for strings containing NUL bytes, like in case of UTF-32.
rb_enc_symname_p
Identical to rb_symname_p, except it additionally takes an encoding.
rb_enc_to_index
Queries the index of the encoding. An encoding’s index is a Ruby-local concept. It is a (sequential) number assigned to each encoding.
rb_enc_tolower
Identical to [rb_tolower], except it additionally takes an encoding.
rb_enc_toupper
Identical to [rb_toupper], except it additionally takes an encoding.
rb_enc_uint_chr
Encodes the passed code point into a series of bytes.
rb_enc_unicode_p
Queries if the passed encoding is either one of UTF-8/16/32.
rb_enc_vsprintf
Identical to rb_enc_sprintf, except it takes a va_list instead of variadic arguments. It can also be seen as a routine identical to rb_vsprintf, except it additionally takes an encoding.
rb_ensure
An equivalent to ensure clause. Calls the function b_proc with data1 as the argument, then calls e_proc with data2 when execution terminated.
rb_enum_values_pack
Basically identical to [rb_ary_new_form_values], except it returns something different when argc < 2.
rb_enumeratorize
Constructs an enumerator. This roughly resembles Object#enum_for.
rb_enumeratorize_with_size
Identical to rb_enumeratorize, except you can additionally specify the size function of return value.
rb_enumeratorize_with_size_kw
Identical to [rb_enumeratorize_with_func], except you can specify how to handle the last element of the given array.
rb_env_clear
Destructively removes every environment variables of the running process.
rb_eof_error
Utility function to raise ::rb_eEOFError.
rb_eql
Checks for equality of the passed objects, in terms of Object#eql?.
rb_equal
This function is an optimised version of calling #==. It checks equality between two objects by first doing a fast identity check using using C’s == (same as BasicObject#equal?). If that check fails, it calls #== dynamically. This optimisation actually affects semantics, because when #== returns false for the same object obj, [rb_equal]obj, obj) would still return true. This happens for Float::NAN, where Float::NAN == Float::NAN is false, but [rb_equal]Float::NAN, Float::NAN) is true.
rb_errinfo
This is the same as $! in Ruby.
rb_error_arity

rb_error_frozen
Identical to rb_frozen_error_raise, except its raising exception has a message like “can’t modify frozen /what/”.
rb_error_frozen_object
Identical to rb_error_frozen, except it takes arbitrary Ruby object instead of C’s string.
rb_eval_cmd_kw
This API is practically a variant of rb_proc_call_kw now. Historically when there still was a concept called $SAFE, this was an API for that. But we no longer have that. This function basically ended its role. It just remains here because of no harm.
rb_eval_string
Evaluates the given string.
rb_eval_string_protect
Identical to rb_eval_string, except it avoids potential global escapes. Such global escapes include exceptions, throw, break, for example.
rb_eval_string_wrap
Identical to rb_eval_string_protect, except it evaluates the given string under a module binding in an isolated binding. This is the same as a binding for loaded libraries on [rb_load]something, true).
rb_exc_fatal
Identical to rb_fatal, except it raises the passed exception instance as- is instead of creating new one.
rb_exc_new
Creates an instance of the passed exception class.
rb_exc_new_cstr
Identical to rb_exc_new, except it assumes the passed pointer is a pointer to a C string.
rb_exc_new_str
Identical to rb_exc_new_cstr, except it takes a Ruby’s string instead of C’s.
rb_exc_raise
Identical to rb_raise, except it raises the passed exception instance as- is instead of creating new one.
rb_exec_recursive
“Recursion” API entry point. This basically calls the given function with the given arguments, but additionally with recursion flag. The flag is set to 1 if the execution have already experienced the passed g parameter before.
rb_exec_recursive_outer
Identical to rb_exec_recursive, except it calls f for outermost recursion only. Inner recursions yield calls to rb_throw_obj.
rb_exec_recursive_paired
Identical to rb_exec_recursive, except it checks for the recursion on the ordered pair of { g, p } instead of just g.
rb_exec_recursive_paired_outer
Identical to rb_exec_recursive_outer, except it checks for the recursion on the ordered pair of { g, p } instead of just g. It can also be seen as a routine identical to rb_exec_recursive_paired, except it calls f for outermost recursion only. Inner recursions yield calls to rb_throw_obj.
rb_exit
Terminates the current execution context. This API is the entry point of a “well-mannered” termination sequence. When called from an extension library, it raises ::rb_eSystemExit exception. Programs could rescue that exception. Can cancel process exit then. Otherwise, that exception results in a process termination with the status passed to this function.
rb_ext_ractor_safe
Asserts that the extension library that calls this function is aware of Ractor. Multiple Ractors run without protecting each other. This doesn’t interface well with C programs, unless designed with an in-depth understanding of how Ractors work. Extension libraries are shut out from Ractors by default. This API is to bypass that restriction. Once after it was called, successive calls to rb_define_method etc. become definitions of methods that are aware of Ractors. The amendment would be in effect until the end of rb_require_string etc.
rb_extend_object
Extend the object with the module.
rb_external_str_new
Identical to rb_str_new, except it generates a string of “default external” encoding.
rb_external_str_new_cstr
Identical to rb_external_str_new, except it assumes the passed pointer is a pointer to a C string. It can also be seen as a routine identical to rb_str_new_cstr, except it generates a string of “default external” encoding.
rb_external_str_new_with_enc
Identical to rb_external_str_new, except it additionally takes an encoding. However the whole point of rb_external_str_new is to encode a string into default external encoding. Being able to specify arbitrary encoding just ruins the designed purpose the function meseems.
rb_extract_keywords
Splits a hash into two.
rb_f_abort
This is similar to rb_f_exit. In fact on some situation it internally calls rb_exit. But can be very esoteric on occasions.
rb_f_exec
Replaces the current process by running the given external command. This is the implementation of Kernel#exec.
rb_f_exit
Identical to rb_exit, except how arguments are passed.
rb_f_global_variables
Queries the list of global variables.
rb_f_kill
Sends a signal (“kills”) to processes.
rb_f_notimplement
Raises ::rb_eNotImpError. This function is used as an argument to rb_define_method etc.
rb_f_require
Identical to rb_require_string, except it ignores the first argument for no reason. There seems to be no reason for 3rd party extension libraries to use it.
rb_f_sprintf
Identical to rb_str_format, except how the arguments are arranged.
rb_f_trace_var
Traces a global variable.
rb_f_untrace_var
Deletes the passed tracer from the passed global variable, or if omitted, deletes everything.
rb_fatal
Raises the unsung “fatal” exception. This is considered severe. Nobody can rescue the exception. Once raised, process termination is inevitable. However ensure clauses still run, so that resources are properly cleaned up.
rb_fd_clr
Releases a specific FD from the given fdset.
rb_fd_copy
Destructively overwrites an fdset with another.
rb_fd_dup
Identical to rb_fd_copy, except it copies unlimited number of file descriptors.
rb_fd_fix_cloexec
Sets or clears the close-on-exec flag of the passed file descriptor to the desired state. STDIN, STDOUT, STDERR are the exceptional file descriptors that shall remain open. All others are to be closed on exec. When a C extension library opens a file descriptor using anything other than rb_cloexec_open etc., that file descriptor shall experience this function.
rb_fd_init
(Re-)initialises a fdset. One must be initialised before other [rb_fd_]* operations. Analogous to calling malloc(3) to allocate an fd_set.
rb_fd_isset
Queries if the given FD is in the given set.
rb_fd_select
Waits for multiple file descriptors at once.
rb_fd_set
Sets an fd to a fdset.
rb_fd_term
Destroys the ::rb_fdset_t, releasing any memory and resources it used. It must be reinitialised using rb_fd_init before future use. Analogous to calling free(3) to release memory for an fd_set.
rb_fd_zero
Wipes out the current set of FDs.
rb_fdopen
Identical to rb_io_stdio_file, except it takes file descriptors instead of Ruby’s IO. It can also be seen as a compatibility layer to wrap fdopen(3). Nowadays all supporting systems, including Windows, have fdopen. Why not use them.
rb_feature_provided
Identical to rb_provided, except it additionally returns the “canonical” name of the loaded feature. This can be handy when for instance you want to know the actually loaded library is either foo.rb or foo.so.
rb_fiber_alive_p
Queries the liveness of the passed fiber. “Alive” in this context means that the fiber can still be resumed. Once it reaches is its end of execution, this function returns ::RUBY_Qfalse.
rb_fiber_current
Queries the fiber which is calling this function. Any ruby execution context has its fiber, either explicitly or implicitly.
rb_fiber_new
Creates a Fiber instance from a C-backended block.
rb_fiber_new_storage
Creates a Fiber instance from a C-backended block with the specified storage.
rb_fiber_raise
Identical to rb_fiber_resume but instead of resuming normal execution of the passed fiber, it raises the given exception in it. From inside of the fiber this would be seen as if rb_fiber_yield raised.
rb_fiber_resume
Resumes the execution of the passed fiber, either from the point at which the last rb_fiber_yield was called if any, or at the beginning of the fiber body if it is the first call to this function.
rb_fiber_resume_kw
Identical to rb_fiber_resume, except you can specify how to handle the last element of the given array.
rb_fiber_scheduler_address_resolve
Non-blocking DNS lookup.
rb_fiber_scheduler_block
Non-blocking wait for the passed “blocker”, which is for instance Thread.join or Mutex.lock. Depending on scheduler implementation, this for instance switches to another fiber etc.
rb_fiber_scheduler_close
Closes the passed scheduler object. This expects the scheduler to wait for all fibers. Thus the scheduler’s main loop tends to start here.
rb_fiber_scheduler_current
Identical to rb_fiber_scheduler_get, except it also returns ::RUBY_Qnil in case of a blocking fiber. As blocking fibers do not participate schedulers’ scheduling this function can be handy.
rb_fiber_scheduler_current_for_thread
Identical to rb_fiber_scheduler_current, except it queries for that of the passed thread instead of the implicit current one.
rb_fiber_scheduler_fiber
Create and schedule a non-blocking fiber.
rb_fiber_scheduler_get
Queries the current scheduler of the current thread that is calling this function.
rb_fiber_scheduler_io_close
Non-blocking close the given IO.
rb_fiber_scheduler_io_pread
Non-blocking read from the passed IO at the specified offset.
rb_fiber_scheduler_io_pwrite
Non-blocking write to the passed IO at the specified offset.
rb_fiber_scheduler_io_read
Non-blocking read from the passed IO.
rb_fiber_scheduler_io_read_memory
Non-blocking read from the passed IO using a native buffer.
rb_fiber_scheduler_io_select
Non-blocking version of IO.select.
rb_fiber_scheduler_io_selectv
Non-blocking version of IO.select, argv variant.
rb_fiber_scheduler_io_wait
Non-blocking version of rb_io_wait. Depending on scheduler implementation, this for instance switches to another fiber etc.
rb_fiber_scheduler_io_wait_readable
Non-blocking wait until the passed IO is ready for reading. This is a special case of rb_fiber_scheduler_io_wait, where the interest is IO::READABLE and timeout is never.
rb_fiber_scheduler_io_wait_writable
Non-blocking wait until the passed IO is ready for writing. This is a special case of rb_fiber_scheduler_io_wait, where the interest is IO::WRITABLE and timeout is never.
rb_fiber_scheduler_io_write
Non-blocking write to the passed IO.
rb_fiber_scheduler_io_write_memory
Non-blocking write to the passed IO using a native buffer.
rb_fiber_scheduler_kernel_sleep
Non-blocking sleep. Depending on scheduler implementation, this for instance switches to another fiber etc.
rb_fiber_scheduler_kernel_sleepv
Identical to rb_fiber_scheduler_kernel_sleep, except it can pass multiple arguments.
rb_fiber_scheduler_make_timeout
Converts the passed timeout to an expression that rb_fiber_scheduler_block etc. expects.
rb_fiber_scheduler_process_wait
Non-blocking waitpid. Depending on scheduler implementation, this for instance switches to another fiber etc.
rb_fiber_scheduler_set
Destructively assigns the passed scheduler to that of the current thread that is calling this function. If the scheduler is set, non-blocking fibers (created by Fiber.new with blocking: false, or by Fiber.schedule) call that scheduler’s hook methods on potentially blocking operations, and the current thread will call scheduler’s #close method on finalisation (allowing the scheduler to properly manage all non-finished fibers). scheduler can be an object of any class corresponding to Fiber::SchedulerInterface. Its implementation is up to the user.
rb_fiber_scheduler_unblock
Wakes up a fiber previously blocked using rb_fiber_scheduler_block.
rb_fiber_transfer
Transfers control to another fiber, resuming it from where it last stopped or starting it if it was not resumed before. The calling fiber will be suspended much like in a call to rb_fiber_yield.
rb_fiber_transfer_kw
Identical to rb_fiber_transfer, except you can specify how to handle the last element of the given array.
rb_fiber_yield
Yields the control back to the point where the current fiber was resumed. The passed objects would be the return value of rb_fiber_resume. This fiber then suspends its execution until next time it is resumed.
rb_fiber_yield_kw
Identical to rb_fiber_yield, except you can specify how to handle the last element of the given array.
rb_file_absolute_path
Maps a relative path to its absolute representation. Relative paths are referenced from the passed directory name, or from the process’ current working directory in case ::RUBY_Qnil is passed.
rb_file_directory_p
Queries if the given path is either a directory, or a symlink that (potentially recursively) points to such thing.
rb_file_dirname
Strips a file path’s last component (and trailing separators if any). This function is relatively simple on POSIX environments; just splits the input with /, strips the last one, if something remains joins them again, otherwise the return value is ".". However when it comes to Windows this function is quite very much complicated. We have to take UNC etc. into account. So for instance "C:foo"’s dirname is "C:.".
rb_file_expand_path
Identical to rb_file_absolute_path, except it additionally understands ~. If a given pathname starts with ~someone/, that part expands to the user’s home directory (or that of current process’ owner’s in case of ~/).
rb_file_open
Opens a file located at the given path.
rb_file_open_str
Identical to rb_file_open, except it takes the pathname as a Ruby’s string instead of C’s. In case the passed Ruby object is a non-String it tries to call #to_path.
rb_file_s_absolute_path
Identical to rb_file_absolute_path, except how arguments are passed.
rb_file_s_expand_path
Identical to rb_file_expand_path, except how arguments are passed.
rb_file_size
Queries the file size of the given file. Because this function calls fstat(2) internally, it is a failure to pass a closed file to this function.
rb_filesystem_encindex
Identical to rb_filesystem_encoding, except it returns the encoding’s index instead of the encoding itself.
rb_filesystem_encoding
Queries the “filesystem” encoding. This is the encoding that ruby expects info from the OS’ file system are in. This affects for instance return value of rb_dir_getwd. Most notably on Windows it can be an alias of OS codepage. Most notably on Linux users can set this via default external encoding.
rb_filesystem_str_new
Identical to rb_str_new, except it generates a string of “filesystem” encoding. It can also be seen as a routine identical to rb_external_str_new, except it generates a string of “filesystem” encoding instead of “default external” encoding.
rb_filesystem_str_new_cstr
Identical to rb_filesystem_str_new, except it assumes the passed pointer is a pointer to a C string. It can also be seen as a routine identical to rb_external_str_new_cstr, except it generates a string of “filesystem” encoding instead of “default external”.
rb_find_encoding
Identical to rb_to_encoding_index, except the return type.
rb_find_file
Identical to rb_find_file_ext, except it takes a feature name and is extension at once, e.g. "json.rb". This difference is much like how require and load are different.
rb_find_file_ext
Resolves a feature’s path. This function takes for instance "json" and [".so", ".rb"], and iterates over the $LOAD_PATH to see if there is either json.so or json.rb in the directory.
rb_fix2int
Identical to rb_num2int.
rb_fix2short
Identical to rb_num2short.
rb_fix2str
Generates a place-value representation of the given Fixnum, with given radix.
rb_fix2uint
Identical to rb_num2uint.
rb_fix2ushort
Identical to rb_num2ushort.
rb_float_new
Converts a C’s double into an instance of ::rb_cFloat.
rb_float_new_in_heap
Identical to rb_float_new, except it does not generate Flonums.
rb_float_value
Extracts its double value from an instance of ::rb_cFloat.
rb_flt_rationalize
Identical to rb_flt_rationalize_with_prec, except it auto-detects appropriate precision depending on the passed value.
rb_flt_rationalize_with_prec
Simplified approximation of a float. It returns a rational rat which satisfies:
rb_frame_callee
Identical to rb_frame_this_func, except it returns the named used to call the method.
rb_frame_method_id_and_class
Resembles __method__.
rb_frame_this_func
Queries the name of the Ruby level method that is calling this function. The “name” in this context is the one assigned to the function for the first time (note that methods can have multiple names via aliases).
rb_free_generic_ivar
Frees the list of instance variables. 3rd parties need not know, but there are several ways to store an object’s instance variables, depending on its internal structure. This function makes sense when the passed objects is using so-called “generic” backend storage. People need not be aware of this working behind-the-scenes.
rb_free_tmp_buffer

rb_freeze_singleton_class
This is an implementation detail of #RB_OBJ_FREEZE(). People don’t use it directly.
rb_frozen_error_raise
Raises an instance of ::rb_eFrozenError. The object can be obtained later using FrozenError#receiver of the raising exception.
rb_funcall
Calls a method. Can call both public and private methods.
rb_funcall_passing_block
Identical to rb_funcallv_public, except you can pass the passed block.
rb_funcall_passing_block_kw
Identical to [rb_funcallv_passing_block], except you can specify how to handle the last element of the given array. It can also be seen as a routine identical to rb_funcallv_public_kw, except you can pass the passed block.
rb_funcall_with_block
Identical to rb_funcallv_public, except you can pass a block. A block here basically is an instance of ::rb_cProc. If you want to exercise to_proc conversion, do so before passing it here. However nil and symbols are special-case allowed.
rb_funcall_with_block_kw
Identical to [rb_funcallv_with_block], except you can specify how to handle the last element of the given array. It can also be seen as a routine identical to rb_funcallv_public_kw, except you can pass a block.
rb_funcallv
Identical to rb_funcall, except it takes the method arguments as a C array.
rb_funcallv_kw
Identical to rb_funcallv, except you can specify how to handle the last element of the given array.
rb_funcallv_public
Identical to rb_funcallv, except it only takes public methods into account. This is roughly Ruby’s Object#public_send.
rb_funcallv_public_kw
Identical to rb_funcallv_public, except you can specify how to handle the last element of the given array. It can also be seen as a routine identical to rb_funcallv_kw, except it only takes public methods into account.
rb_gc
Triggers a GC process. This was the only GC entry point that we had at the beginning. Over time our GC evolved. Now what this function does is just a very simplified variation of the entire GC algorithms. A series of procedures kicked by this API is called a “full” GC.
rb_gc_adjust_memory_usage
Informs that there are external memory usages. Our GC runs when we are running out of memory. The amount of memory, however, can increase/decrease behind-the-scene. For instance DLLs can allocate memories using mmap(2) etc, which are opaque to us. Registering such external allocations using this function enables proper detection of how much memories an object used as a whole. That will trigger GCs more often than it would otherwise. You can also pass negative numbers here, to indicate that such external allocations are gone.
rb_gc_copy_finalizer
Copy&paste an object’s finaliser to another. This is one of the GC utility functions that you can call when you design your own initialize_copy, initialize_dup, initialize_clone.
rb_gc_count
Identical to rb_gc_stat, with “count” parameter.
rb_gc_disable
Disables GC. This prevents automatic GC runs when the process is running out of memory. Such situations shall result in rb_memerror. However this does not prevent users from manually invoking rb_gc. That should work. People abused this by disabling GC at the beginning of an event loop, process events without GC overheads, then manually force reclaiming garbage at the bottom of the loop. However because our GC is now much smarter than just calling rb_gc, this technique is proven to be sub-optimal these days. It is believed that there is currently practically no needs of this function.
rb_gc_enable
(Re-) enables GC. This makes sense only after you called rb_gc_disable.
rb_gc_force_recycleDeprecated
Asserts that the passed object is no longer needed. Such objects are reclaimed sooner or later so this function is not mandatory. But sometimes you can know from your application knowledge that an object is surely dead at some point. Calling this as a hint can be a polite way.
rb_gc_latest_gc_info
Obtains various info regarding the most recent GC run. This includes for instance the reason of the GC. The parameter can be either a Symbol or a Hash. If a Hash is passed, it is filled with everything currently available. If a Symbol is passed just that portion is returned.
rb_gc_location
Finds a new “location” of an object. An object can be moved on compaction. This function projects its new abode, or just returns the passed object if not moved. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dcompact.
rb_gc_mark
Marks an object. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_gc_mark_locations
Marks objects between the two pointers. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_gc_mark_maybe
Identical to rb_gc_mark, except it allows the passed value be a non-object. For instance pointers to different type of memory regions are allowed here. Such values are silently ignored. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_gc_mark_movable
Maybe this is the only function provided for C extensions to control the pinning of objects, so let us describe it in detail. These days Ruby’s GC is copying. As far as an object’s physical address is guaranteed unused, it can move around the object space. Our GC engine rearranges these objects after it reclaims unreachable objects from our object space, so that the space is compact (improves memory locality). This is called the “compaction” phase, and works well most of the time… as far as there are no C extensions. C extensions complicate the scenario because Ruby core cannot detect any use of the physical address of an object inside of C functions. In order to prevent memory corruptions, objects observable from C extensions are “pinned”; they stick to where they are born until they die, just in case any C extensions touch their raw pointers. This variant of scheme is called “Mostly-Copying” garbage collector. Authors of C extensions, however, can extremely carefully write them to become compaction-aware. To do so avoid referring to a Ruby object from inside of your struct in the first place. But if that is not possible, use this function from your ::rb_data_type_struct::dmark then. This way objects marked using it are considered movable. If you chose this way you have to manually fix up locations of such moved pointers using rb_gc_location.
rb_gc_register_address
Inform the garbage collector that valptr points to a live Ruby object that should not be moved. Note that extensions should use this API on global constants instead of assuming constants defined in Ruby are always alive. Ruby code can remove global constants.
rb_gc_register_mark_object
Inform the garbage collector that object is a live Ruby object that should not be moved.
rb_gc_start
Identical to rb_gc, except the return value.
rb_gc_stat
Obtains various GC related profiles. The parameter can be either a Symbol or a Hash. If a Hash is passed, it is filled with everything currently available. If a Symbol is passed just that portion is returned.
rb_gc_unregister_address
Inform the garbage collector that a pointer previously passed to [rb_gc_register_address] no longer points to a live Ruby object.
rb_gc_update_tbl_refs
Updates references inside of tables. After you marked values using rb_mark_tbl_no_pin, the objects inside of the table could of course be moved. This function is to fixup those references. You can call this from your ::rb_data_type_struct::dcompact.
rb_gc_writebarrier
This is the implementation of #RB_OBJ_WRITE(). People don’t use it directly.
rb_gc_writebarrier_unprotect
This is the implementation of #RB_OBJ_WB_UNPROTECT(). People don’t use it directly.
rb_genrand_int32
Generates a 32 bit random number.
rb_genrand_real
Generates a double random number.
rb_genrand_ulong_limited
Generates a random number whose upper limit is i.
rb_get_alloc_func
Queries the allocator function of a class.
rb_get_argv
Queries the arguments passed to the current process that you can access from Ruby as ARGV.
rb_get_kwargs
Keyword argument deconstructor.
rb_get_path
Converts an object to a path. It first tries #to_path method if any, then falls back to #to_str method.
rb_get_path_no_checksafeDeprecated
@deprecated This function is an alias of rb_get_path now. The part that did “no_checksafe” was deleted. It remains here because of no harm.
rb_get_values_at
This was a generalisation of Array#values_at, Struct#values_at, and MatchData#values_at. It begun its life as a refactoring effort. However as Ruby evolves over time, as of writing none of aforementioned methods share their implementations at all. This function is not deprecated; still works as it has been. But it is now kind of like a rudimentum.
rb_gets
Much like rb_io_gets, but it reads from the mysterious ARGF object. ARGF in this context can be seen as a virtual IO which concatenates contents of the files passed to the process via the ARGV, or just STDIN if there are no such files.
rb_glob
The “glob” operator. Expands the given pattern against the actual local filesystem, then iterates over the expanded filenames by calling the callback function.
rb_global_variable
An alias for [rb_gc_register_address].
rb_gv_get
Obtains a global variable.
rb_gv_set
Assigns to a global variable.
rb_gvar_readonly_setter
This function just raises ::rb_eNameError. Handy when you want to prohibit a global variable from being squashed by someone.
rb_gvar_undef_getterDeprecated
@deprecated
rb_gvar_undef_markerDeprecated
@deprecated
rb_gvar_undef_setterDeprecated
@deprecated
rb_gvar_val_getter
This is the getter function that backs global variables defined from a ruby script. Extension libraries can use this if its global variable needs no custom logic.
rb_gvar_val_marker
This is the setter function that backs global variables defined from a ruby script. Extension libraries can use this if its global variable needs no custom logic.
rb_gvar_val_setter
This is the setter function that backs global variables defined from a ruby script. Extension libraries can use this if its global variable needs no custom logic.
rb_gvar_var_getterDeprecated
@deprecated
rb_gvar_var_markerDeprecated
@deprecated
rb_gvar_var_setterDeprecated
@deprecated
rb_hash
Calculates a message authentication code of the passed object. The return value is a very small integer used as an index of a key of a table. In order to calculate the value this function calls #hash method of the passed object. Ruby provides you a default implementation. But if you implement your class in C, that default implementation cannot know the underlying data structure. You must implement your own #hash method then, which must return an integer of uniform distribution in a sufficiently instant manner.
rb_hash_aref
Queries the given key in the given hash table. If there is the key in the hash, returns the value associated with the key. Otherwise it returns the “default” value (defined per hash table).
rb_hash_aset
Inserts or replaces (“upsert“s) the objects into the given hash table. This basically associates the given value with the given key. On duplicate key this function updates its associated value with the given one. Otherwise it inserts the association at the end of the table.
rb_hash_bulk_insert
Inserts a list of key-value pairs into a hash table at once. It is semantically identical to repeatedly calling rb_hash_aset, but can be faster than that.
rb_hash_bulk_insert_into_st_table

rb_hash_clear
Swipes everything out of the passed hash table.
rb_hash_delete
Deletes the passed key from the passed hash table, if any.
rb_hash_delete_if
Deletes each entry for which the block returns a truthy value. If there is no block given, it returns an enumerator that does the thing.
rb_hash_dup
Duplicates a hash.
rb_hash_fetch
Identical to rb_hash_lookup, except it yields the (implicitly) passed block instead of returning ::RUBY_Qnil.
rb_hash_foreach
Iterates over a hash. This basically does the same thing as rb_st_foreach. But because the passed hash is a Ruby object, its keys and values are both Ruby objects.
rb_hash_freeze
@alias{rb_obj_freeze}
rb_hash_lookup
Identical to rb_hash_aref, except it always returns ::RUBY_Qnil for misshits.
rb_hash_lookup2
Identical to rb_hash_lookup, except you can specify what to return on misshits. This is much like 2-arguments version of Hash#fetch.
rb_hash_new
Creates a new, empty hash object.
rb_hash_new_capa
Identical to rb_hash_new, except it additionally specifies how many keys it is expected to contain. This way you can create a hash that is large enough for your need. For large hashes it means it won’t need to be reallocated and rehashed as much, improving performance.
rb_hash_set_ifnone
This is the implementation detail of #RHASH_SET_IFNONE. People don’t call this directly.
rb_hash_size
Identical to #RHASH_SIZE(), except it returns the size in Ruby’s integer instead of C’s.
rb_hash_size_num
This is the implementation detail of #RHASH_SIZE. People don’t call this directly.
rb_hash_start
Starts a series of hashing. Suppose you have a struct:
rb_hash_tbl
This is the implementation detail of #RHASH_TBL. People don’t call this directly.
rb_hash_update_by
Destructively merges two hash tables into one. It resolves key conflicts by calling the passed function and take its return value.
rb_id2name
Retrieves the name mapped to the given id.
rb_id2str
Identical to rb_id2name, except it returns a Ruby’s String instead of C’s.
rb_id2sym
Allocates an instance of ::rb_cSymbol that has the given id.
rb_id_attrset
Calculates an ID of attribute writer. For instance it returns :foo= when passed :foo.
rb_include_module
Includes a module to a class.
rb_inspect
Generates a human-readable textual representation of the given object. This is largely similar to Ruby level Object#inspect but not the same; it additionally escapes the inspection result so that the string be compatible with that of default internal (or default external, if absent).
rb_int2big
Converts a C’s intptr_t into an instance of ::rb_cInteger.
rb_int2inum
Converts a C’s intptr_t into an instance of ::rb_cInteger.
rb_int_pair_to_real
Generates a 64 bit floating point number by concatenating two 32bit unsigned integers.
rb_int_positive_pow
Raises the passed x to the power of y.
rb_integer_pack
Exports an integer into a buffer. This function fills the buffer specified by words and numwords as val in the format specified by wordsize, nails and flags.
rb_integer_unpack
Import an integer from a buffer.
rb_intern
Finds or creates a symbol of the given name.
rb_intern2
Identical to rb_intern, except it additionally takes the length of the string. This way you can have a symbol that contains NUL characters.
rb_intern3
Identical to rb_intern2, except it additionally takes an encoding.
rb_intern_str
Identical to rb_intern, except it takes an instance of ::rb_cString.
rb_internal_thread_add_event_hook
Registers a thread event hook function.
rb_internal_thread_remove_event_hook
Unregister the passed hook.
rb_interned_str
Identical to rb_str_new, except it returns an infamous “f“string. What is a fstring? Well it is a special subkind of strings that is immutable, deduped globally, and managed by our GC. It is much like a Symbol (in fact Symbols are dynamic these days and are backended using fstrings). This concept has been silently introduced at some point in 2.x era. Since then it gained wider acceptance in the core. Starting from 3.x extension libraries can also generate ones.
rb_interned_str_cstr
Identical to rb_interned_str, except it assumes the passed pointer is a pointer to a C’s string. It can also be seen as a routine identical to to rb_str_to_interned_str, except it takes a C’s string instead of Ruby’s. Or it can also be seen as a routine identical to rb_str_new_cstr, except it returns an infamous “f“string.
rb_interrupt
Raises an instance of ::rb_eInterrupt.
rb_invalid_str
Honestly I don’t understand the name, but it raises an instance of ::rb_eArgError.
rb_io_addstr
Identical to rb_io_write, except it always returns the passed IO.
rb_io_ascii8bit_binmode
Forces no conversions be applied to the passed IO. Unlike rb_io_binmode, this cancels any newline conversions as well as encoding conversions. Any texts read/written through the IO will be the verbatim binary contents.
rb_io_binmode
Sets the binmode. This operation nullifies the effect of textmode (newline conversion from "\r\n" to "\n" or vice versa). Note that it doesn’t stop character encodings conversions. For instance an IO created using:
rb_io_buffer_clear

rb_io_buffer_free

rb_io_buffer_get_bytes

rb_io_buffer_get_bytes_for_reading

rb_io_buffer_get_bytes_for_writing

rb_io_buffer_lock

rb_io_buffer_map

rb_io_buffer_new

rb_io_buffer_pread

rb_io_buffer_pwrite

rb_io_buffer_read

rb_io_buffer_resize

rb_io_buffer_transfer

rb_io_buffer_try_unlock

rb_io_buffer_unlock

rb_io_buffer_write

rb_io_bufwrite
Buffered write to the passed IO.
rb_io_check_byte_readable
Asserts that an IO is opened for byte-based reading. Byte-based and character-based reading operations cannot be mixed at a time.
rb_io_check_char_readable
Asserts that an IO is opened for character-based reading. A character can be wider than a byte. Because of this we have to buffer reads from descriptors. This fiction checks if that is possible.
rb_io_check_closed
This badly named function asserts that the passed IO is open.
rb_io_check_initialized
Asserts that the passed IO is initialised.
rb_io_check_io
Try converting an object to its IO representation using its to_io method, if any. If there is no such thing, returns ::RUBY_Qnil.
rb_io_check_readable
@alias{rb_io_check_byte_readable}
rb_io_check_writable
Asserts that an IO is opened for writing.
rb_io_close
Closes the IO. Any buffered contents are flushed to the operating system. Any future operations against the IO would raise ::rb_eIOError. In case the io was created using IO.popen, it also sets the $?.
rb_io_descriptor
Returns an integer representing the numeric file descriptor for io.
rb_io_eof
Queries if the passed IO is at the end of file. “The end of file” here mans that there are no more data to read. This function blocks until the read buffer is filled in, and if that operation reached the end of file, it still returns ::RUBY_Qfalse (because there are data yet in that buffer). It returns ::RUBY_Qtrue once after the buffer is cleared.
rb_io_extract_encoding_option
This function breaks down the option hash that IO#initialize takes into components. This is an implementation detail of rb_io_extract_modeenc today. People prefer that API instead.
rb_io_extract_modeenc
This function can be seen as an extended version of rb_io_extract_encoding_option that not only concerns the option hash but also mode string and so on. This should be mixed with rb_scan_args like:
rb_io_fdopen
Creates an IO instance whose backend is the given file descriptor. C extension libraries sometimes have file descriptors created elsewhere (maybe deep inside of another shared library), which they want ruby programs to handle. This function is handy for such situations.
rb_io_flush
Flushes any buffered data within the passed IO to the underlying operating system.
rb_io_fptr_finalize
Destroys the given IO. Any pending operations are flushed.
rb_io_get_io
Identical to rb_io_check_io, except it raises exceptions on conversion failures.
rb_io_get_write_io
Queries the tied IO for writing. An IO can be duplexed. Fine. The thing is, that characteristics could sometimes be achieved by the underlying operating system (for instance a socket’s duplexity is by nature) but sometimes by us. Notable example is a bidirectional pipe. Suppose you have:
rb_io_getbyte
Reads a byte from the given IO.
rb_io_gets
Reads a “line” from the given IO. A line here means a chunk of characters which is terminated by either "\n" or an EOF.
rb_io_make_open_file

rb_io_maybe_wait
Identical to rb_io_wait except it additionally takes previous errno. If the passed errno indicates for instance EINTR, this function returns immediately. This is expected to be called in a loop.
rb_io_maybe_wait_readable
Blocks until the passed IO is ready for reading, if that makes sense for the passed errno. This is a special case of rb_io_maybe_wait that only concerns for reading.
rb_io_maybe_wait_writable
Blocks until the passed IO is ready for writing, if that makes sense for the passed errno. This is a special case of rb_io_maybe_wait that only concernsfor writing.
rb_io_modestr_fmode
Maps a file mode string (that rb_file_open takes) into a mixture of FMODE_ flags. This for instance returns FMODE_WRITABLE | FMODE_TRUNC | FMODE_CREATE | FMODE_EXCL for "wx".
rb_io_modestr_oflags
Identical to rb_io_modestr_fmode, except it returns a mixture of O_ flags. This for instance returns O_WRONLY | O_TRUNC | O_CREAT | O_EXCL for "wx".
rb_io_oflags_fmode
Converts an oflags (that rb_io_modestr_oflags returns) to a fmode (that [rb_io_mode_flags] returns). This is a purely functional operation.
rb_io_print
Iterates over the passed array to apply rb_io_write individually. If there is $,, this function inserts the string in middle of each iterations. If there is $\, this function appends the string at the end. If the array is empty, this function outputs $_.
rb_io_printf
This is a rb_f_sprintf + rb_io_write combo.
rb_io_puts
Iterates over the passed array to apply rb_io_write individually. Unlike rb_io_print, this function prints a newline per each element. It also flattens the passed array (OTOH rb_io_print just resorts to rb_ary_to_s.
rb_io_read_check
Blocks until there is a pending read in the passed IO. If there already is it just returns.
rb_io_read_pending
Queries if the passed IO has any pending reads. Unlike rb_io_read_check this doesn’t block; has no side effects.
rb_io_set_nonblock
Instructs the OS to put its internal file structure into “nonblocking mode”. This is an in-Kernel concept. Reading from/writing to that file using C function calls would return -1 with errno set. However when it comes to a ruby program, we hide that error behind our IO#read method. Ruby level IO#read blocks regardless of this flag. If you want to avoid blocking, you should consider using methods like IO#readpartial.
rb_io_set_timeout
Set the timeout associated with the specified io object. This timeout is used as a best effort timeout to prevent operations from blocking forever.
rb_io_set_write_io
Assigns the tied IO for writing. See rb_io_get_write_io for what a “tied IO for writing” is.
rb_io_stdio_file
Finds or creates a stdio’s file structure from a Ruby’s one. This can be handy if you want to call an external API that accepts FILE *.
rb_io_synchronized
Sets #FMODE_SYNC.
rb_io_taint_checkDeprecated
@deprecated This function once was a thing in the old days, but makes no sense any longer today. Exists here for backwards compatibility only. You can safely forget about it.
rb_io_timeout
Get the timeout associated with the specified io object.
rb_io_ungetbyte
Identical to rb_io_ungetc, except it doesn’t take the encoding of the passed IO into account. When an integer is passed, it just casts that value to C’s unsigned char, and pushes that back.
rb_io_ungetc
“Unget“s a string. This function pushes back the passed string onto the passed IO, such that a subsequent buffered read will return it. If the passed content is in fact an integer, a single character string of that codepoint of the encoding of the IO will be pushed back instead.
rb_io_wait
Blocks until the passed IO is ready for the passed events. The “events” here is a Ruby level integer, which is an OR-ed value of IO::READABLE, IO::WRITable, and IO::PRIORITY.
rb_io_wait_readableDeprecated
Blocks until the passed file descriptor gets readable.
rb_io_wait_writableDeprecated
Blocks until the passed file descriptor gets writable.
rb_io_write
Writes the given string to the given IO.
rb_is_absolute_path
Queries if the given path is an absolute path. On POSIX environments it is as easy as path[0] == '/'. However on Windows, drive letters and UNC paths are also taken into account.
rb_is_attrset_id
Classifies the given ID, then sees if it is an attribute writer. An attribute writer is otherwise a local variable, except it ends with =.
rb_is_class_id
Classifies the given ID, then sees if it is a class variable. A class variable is must start with @@.
rb_is_const_id
Classifies the given ID, then sees if it is a constant. In case an ID is in Unicode (likely), its “constant”-ness is determined if its first character is either upper case or title case. Otherwise it is detected if case- folding the first character changes its case or not.
rb_is_global_id
Classifies the given ID, then sees if it is a global variable. A global variable must start with $.
rb_is_instance_id
Classifies the given ID, then sees if it is an instance variable. An instance variable must start with @, but not @@.
rb_is_junk_id
Classifies the given ID, then sees if it is a junk ID. An ID with no special syntactic structure is considered junk. This category includes for instance punctuation.
rb_is_local_id
Classifies the given ID, then sees if it is a local variable. A local variable starts with a lowercase character, followed by some alphanumeric characters or _, then ends with anything other than !, ?, or =.
rb_iter_break
Breaks from a block. Because you are using a CAPI this is not as intuitive as it sounds. In order for this function to properly work, make a ::rb_block_call_func_t function that calls it internally, and pass that function to rb_block_call.
rb_iter_break_value
Identical to rb_iter_break, except it additionally takes the “value” of this breakage. It will be the evaluation result of the iterator. This is kind of complicated; you cannot see this as a “return from a block” behaviour. Take a look at this example:
rb_iterateDeprecated
Old way to iterate a block.
rb_iv_get
Obtains an instance variable.
rb_iv_set
Assigns to an instance variable.
rb_ivar_count
Number of instance variables defined on an object.
rb_ivar_defined
Queries if the instance variable is defined at the object. This roughly resembles defined?(@name) in obj’s context.
rb_ivar_foreach
Iterates over an object’s instance variables.
rb_ivar_get
Identical to rb_iv_get, except it accepts the name as an ::ID instead of a C string.
rb_ivar_set
Identical to rb_iv_set, except it accepts the name as an ::ID instead of a C string.
rb_jump_tag
This function is to re-throw global escapes. Such global escapes include exceptions, throw, break, for example.
rb_keyword_given_p
Determines if the current method is given a keyword argument.
rb_last_status_get
Queries the “last status”, or the $?.
rb_last_status_set
Sets the “last status”, or the $?.
rb_lastline_get
Queries the last line, or the $_. You don’t have to use it, because in reality you can get $_ using rb_gv_get as usual.
rb_lastline_set
Updates $_. You don’t have to use it, because in reality you can set $_ using rb_gv_set as usual.
rb_ll2inum
Converts a C’s long long into an instance of ::rb_cInteger.
rb_load
Loads and executes the Ruby program in the given file.
rb_load_file
Loads the given file. This function opens the given pathname for reading, parses the contents as a Ruby script, and returns an opaque “node” pointer. You can then pass it to ruby_run_node() for evaluation.
rb_load_file_str
Identical to rb_load_file, except it takes the argument as a Ruby’s string instead of C’s.
rb_load_protect
Identical to rb_load, except it avoids potential global escapes. Such global escapes include exceptions, throw, break, for example.
rb_loaderror
Raises an instance of ::rb_eLoadError.
rb_loaderror_with_path
Identical to rb_loaderror, except it additionally takes which file is unable to load. The path can be obtained later using LoadError#path of the raising exception.
rb_locale_charmap
Returns a platform-depended “charmap” of the current locale. This information is called a “Codeset name” in IEEE 1003.1 section 13 (<langinfo.h>). This is a very low-level API. The return value can have no corresponding encoding when passed to rb_find_encoding.
rb_locale_encindex
Identical to rb_locale_encoding, except it returns the encoding’s index instead of the encoding itself.
rb_locale_encoding
Queries the encoding that represents the current locale.
rb_locale_str_new
Identical to rb_str_new, except it generates a string of “locale” encoding. It can also be seen as a routine identical to rb_external_str_new, except it generates a string of “locale” encoding instead of “default external” encoding.
rb_locale_str_new_cstr
Identical to rb_locale_str_new, except it assumes the passed pointer is a pointer to a C string. It can also be seen as a routine identical to rb_external_str_new_cstr, except it generates a string of “locale” encoding instead of “default external”.
rb_make_backtrace
Creates the good old fashioned array-of-strings style backtrace info.
rb_make_exception
Constructs an exception object from the list of arguments, in a manner similar to Ruby’s raise. This function can take:
rb_mark_hash
Marks keys and values associated inside of the given table. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_mark_set
Identical to rb_mark_hash, except it marks only keys of the table and leave their associated values unmarked. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_mark_tbl
Identical to rb_mark_hash, except it marks only values of the table and leave their associated keys unmarked. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_mark_tbl_no_pin
Identical to rb_mark_tbl, except it marks objects using rb_gc_mark_movable. This is one of the GC utility functions that you can call when you design your own ::rb_data_type_struct::dmark.
rb_marshal_define_compat
Marshal format compatibility layer. Over time, classes evolve, so that their internal data structure change drastically. For instance an instance of ::rb_cRange was made of ::RUBY_T_OBJECT in 1.x., but in 3.x it is a ::RUBY_T_STRUCT now. In order to keep binary compatibility, we “fake” the marshalled representation to stick to old types. This is the API to enable that manoeuvre. Here is how:
rb_marshal_dump
Serialises the given object and all its referring objects, to write them down to the passed port.
rb_marshal_load
Deserialises a previous output of rb_marshal_dump into a network of objects.
rb_match_busy
Asserts that the given MatchData is “occupied”. MatchData shares its backend storages with its Regexp object. But programs can destructively tamper its contents. Calling this function beforehand shall prevent such modifications to spill over into other objects.
rb_mem_clear
Fills the memory region with a series of ::RUBY_Qnil.
rb_memcicmp
Identical to st_locale_insensitive_strcasecmp(), except it is timing safe and returns something different.
rb_memerror
Triggers out-of-memory error. If possible it raises ::rb_eNoMemError. But because we are running out of memory that is not always doable. This function tries hard to show something, but ultimately can die silently.
rb_memhash
This is a universal hash function.
rb_memory_id
Identical to rb_obj_id, except it hesitates from allocating a new instance of ::rb_cInteger. rb_obj_id could allocate ::RUBY_T_BIGNUM objects. That allocation might perhaps impact negatively. On such situations, this function instead returns one-shot temporary small integers that need no allocations at all. The values are guaranteed unique at the moment, but no future promise is made; could be reused. Use of this API should be very instant. It is a failure to store the returned integer to somewhere else.
rb_memory_view_available_p
Return true if obj supports to export a MemoryView. Return false otherwise.
rb_memory_view_extract_item_members
Return a value that consists of item members.
rb_memory_view_fill_contiguous_strides
Fill the strides array with byte-Strides of a contiguous array of the given shape with the given element size.
rb_memory_view_get
If the given obj supports to export a MemoryView that conforms the given flags, this function fills view by the information of the MemoryView and returns true. In this case, the reference count of obj is increased.
rb_memory_view_get_item
Return a value that consists of item members in the given memory view.
rb_memory_view_get_item_pointer
Calculate the location of the item indicated by the given indices.
rb_memory_view_init_as_byte_array
Fill the members of view as an 1-dimensional byte array.
rb_memory_view_is_column_major_contiguous
Return true if the data in the MemoryView view is column-major contiguous.
rb_memory_view_is_row_major_contiguous
Return true if the data in the MemoryView view is row-major contiguous.
rb_memory_view_item_size_from_format
Calculate the number of bytes occupied by an element.
rb_memory_view_parse_item_format
Deconstructs the passed format string, as describe in ::rb_memory_view_t::format.
rb_memory_view_prepare_item_desc
Fill the item_desc member of view.
rb_memory_view_register
Associates the passed class with the passed memory view entry. This has to be called before actually creating a memory view from an instance.
rb_memory_view_release
Release the given MemoryView view and decrement the reference count of memory_view->obj.
rb_memsearch
Looks for the passed string in the passed buffer.
rb_method_basic_definition_p
Well… Let us hesitate from describing what a “basic definition” is. This nuanced concept should have been kept private. Just please. Don’t touch it. This function is a badly distributed random number generator. Right?
rb_method_boundp
Queries if the klass has this method. This function has only one line of document in the implementation that states “// deprecated”. Don’t know what that means though.
rb_method_call
Evaluates the passed method with the passed arguments.
rb_method_call_kw
Identical to rb_method_call, except you can specify how to handle the last element of the given array.
rb_method_call_with_block
Identical to rb_proc_call, except you can additionally pass a proc as a block.
rb_method_call_with_block_kw
Identical to rb_method_call_with_block, except you can specify how to handle the last element of the given array. It can also be seen as a routine identical to rb_method_call_kw, except you can additionally pass another proc object as a block.
rb_mod_ancestors
Queries the module’s ancestors. This routine gathers classes and modules that the passed module either inherits, includes, or prepends, then recursively applies that routine again and again to the collected entries until the list doesn’t grow up.
rb_mod_class_variables
Resembles Module#class_variables. List up the variables defined at the receiver. This includes the names of constants in any included modules, unless argv[0] is ::RUBY_Qfalse.
rb_mod_const_at
This API is mysterious. It has been there since the initial revision. No single bits of documents has ever been written. The function name doesn’t describe anything. What should be passed to the argument, or what should be the return value, are not obvious. Yet it has evolved over time. The source code is written in counter-intuitive way (as of 3.0).
rb_mod_const_of
This is a variant of rb_mod_const_at. As a result, it is also mysterious. It seems it iterates over the ancestry tree of the module. But what that means is beyond a human brain.
rb_mod_constants
Resembles Module#constants. List up the constants defined at the receiver. This includes the names of constants in any included modules, unless argv[0] is ::RUBY_Qfalse.
rb_mod_include_p
Queries if the passed module is included by the module. It can also be seen as a routine to first call rb_mod_included_modules, then see if the return value contains the passed module.
rb_mod_included_modules
Queries the list of included modules. It can also be seen as a routine to first call rb_mod_ancestors, then rejects non-modules from the return value.
rb_mod_init_copy
The comment that comes with this function says :nodoc:. Not sure what that means though.
rb_mod_method_arity
Queries the number of mandatory arguments of the method defined in the given module. If it is declared to take no arguments, returns 0. If it takes exactly n arguments, returns n. If it has optional arguments, returns -n-1, where n is the number of mandatory arguments. Keyword arguments will be considered as a single additional argument, that argument being mandatory if any keyword argument is mandatory.
rb_mod_module_eval
Identical to rb_obj_instance_eval, except it evaluates within the context of module.
rb_mod_module_exec
Identical to rb_obj_instance_exec, except it evaluates within the context of module.
rb_mod_name
Queries the name of a module.
rb_mod_remove_const
Resembles Module#remove_const.
rb_mod_remove_cvar
Resembles Module#remove_class_variable.
rb_mod_sys_fail
Identical to rb_sys_fail, except it takes additional module to extend the exception object before raising.
rb_mod_sys_fail_str
Identical to rb_mod_sys_fail, except it takes the message in Ruby’s String instead of C’s.
rb_mod_syserr_fail
Identical to rb_mod_sys_fail, except it does not depend on C global variable errno. Pass it explicitly.
rb_mod_syserr_fail_str
Identical to rb_mod_syserr_fail, except it takes the message in Ruby’s String instead of C’s.
rb_module_new
Creates a new, anonymous module.
rb_must_asciicompat
Asserts that the given string’s encoding is (Ruby’s definition of) ASCII compatible.
rb_mutex_lock
Attempts to lock the mutex. It waits until the mutex gets available.
rb_mutex_locked_p
Queries if there are any threads that holds the lock.
rb_mutex_new
Creates a mutex.
rb_mutex_sleep
Releases the lock held in the mutex and waits for the period of time; reacquires the lock on wakeup.
rb_mutex_synchronize
Obtains the lock, runs the passed function, and releases the lock when it completes.
rb_mutex_trylock
Attempts to lock the mutex, without waiting for other threads to unlock it. Failure in locking the mutex can be detected by the return value.
rb_mutex_unlock
Releases the mutex.
rb_name_error
Raises an instance of ::rb_eNameError. The name can be obtained later using NameError#name of the raising exception.
rb_name_error_str
Identical to rb_name_error, except it takes a ::VALUE instead of ::ID.
rb_need_block
Declares that the current method needs a block.
rb_newobj
This is the implementation detail of #RB_NEWOBJ.
rb_newobj_of
This is the implementation detail of #RB_NEWOBJ_OF.
rb_nogvl
Identical to rb_thread_call_without_gvl, except it additionally takes “flags” that change the behaviour.
rb_notimplement
@exception rb_eNotImpError @note It never returns.
rb_num2dbl
Converts an instance of ::rb_cNumeric into C’s double.
rb_num2fix
Converts a numeric value into a Fixnum. This is not a preserving conversion; for instance 1.5 would be converted into 1.
rb_num2int
Converts an instance of ::rb_cNumeric into C’s long.
rb_num2ll
Converts an instance of ::rb_cNumeric into C’s long long.
rb_num2long
Converts an instance of ::rb_cNumeric into C’s long.
rb_num2short
Converts an instance of ::rb_cNumeric into C’s short.
rb_num2uint
Converts an instance of ::rb_cNumeric into C’s unsigned long.
rb_num2ull
Converts an instance of ::rb_cNumeric into C’s unsigned long long.
rb_num2ulong
Converts an instance of ::rb_cNumeric into C’s unsigned long.
rb_num2ushort
Converts an instance of ::rb_cNumeric into C’s unsigned short.
rb_num_coerce_bin
Coerced binary operation. This function first coerces the two objects, then applies the operation.
rb_num_coerce_bit
This one is optimised for bitwise operations, but the API is identical to rb_num_coerce_bin.
rb_num_coerce_cmp
Identical to rb_num_coerce_bin, except for return values. This function best suits for comparison operators e.g. <=>.
rb_num_coerce_relop
Identical to rb_num_coerce_cmp, except for return values. This function best suits for relationship operators e.g. <=.
rb_num_zerodiv
Just always raises an exception.
rb_obj_alloc
Allocates an instance of the given class.
rb_obj_as_string
Try converting an object to its stringised representation using its to_s method, if any. If there is no such thing, it resorts to rb_any_to_s output.
rb_obj_call_init
Calls initialize method of the passed object with the passed arguments. It also forwards the implicitly passed block to the method.
rb_obj_call_init_kw
Identical to rb_obj_call_init, except you can specify how to handle the last element of the given array.
rb_obj_class
Queries the class of an object. This is not always identical to RBASIC_CLASS(obj). It searches for the nearest ancestor skipping singleton classes or included modules.
rb_obj_classname
Queries the name of the class of the passed object.
rb_obj_clone
Produces a shallow copy of the given object. Its list of instance variables are copied, but not the objects they reference. It also copies the frozen value state.
rb_obj_dup
Duplicates the given object. This does almost the same thing as rb_obj_clone do. However it does not copy the singleton class (if any). It also doesn’t copy frozen-ness.
rb_obj_encoding
Identical to rb_enc_get_index, except the return type.
rb_obj_freeze
Just calls rb_obj_freeze_inline inside. Does this make any sens to extension libraries?
rb_obj_freeze_inline

rb_obj_frozen_p
Just calls RB_OBJ_FROZEN() inside. Does this make any sens to extension libraries?
rb_obj_hide
Make the object invisible from Ruby code.
rb_obj_id
Finds or creates an integer primary key of the given object. In the old days this function was a purely arithmetic operation that maps the underlying memory address where the object resides into a Ruby’s integer. Some time around 2.x this changed. It no longer relates its return values to C level pointers. This function assigns some random number to the given object if absent. The same number will be returned on all subsequent requests. No two active objects share a number.
rb_obj_init_copy
Default implementation of #initialize_copy, #initialize_dup and #initialize_clone. It does almost nothing. Just raises exceptions for checks.
rb_obj_instance_eval
Evaluates a string containing Ruby source code, or the given block, within the context of the receiver. In order to set the context, the variable self is set to recv while the code is executing, giving the code access to recv’s instance variables and private methods.
rb_obj_instance_exec
Executes the given block within the context of the receiver. In order to set the context, the variable self is set to recv while the code is executing, giving the code access to recv’s instance variables. Arguments are passed as block parameters.
rb_obj_instance_variables
Resembles Object#instance_variables.
rb_obj_is_fiber
Queries if an object is a fiber.
rb_obj_is_instance_of
Queries if the given object is a direct instance of the given class.
rb_obj_is_kind_of
Queries if the given object is an instance (of possibly descendants) of the given class.
rb_obj_is_method
Queries if the given object is a method.
rb_obj_is_proc
Queries if the given object is a proc.
rb_obj_method
Creates a method object. A method object is a proc-like object that you can “call”. Note that a method object snapshots the method at the time the object is created:
rb_obj_method_arity
Identical to rb_mod_method_arity, except it searches for singleton methods rather than instance methods.
rb_obj_remove_instance_variable
Resembles Object#remove_instance_variable.
rb_obj_respond_to
Identical to rb_respond_to, except it additionally takes the visibility parameter. This does not make difference unless the object has respond_to? undefined, but has respond_to_missing? defined. That case the passed argument becomes the second argument of respond_to_missing?.
rb_obj_reveal
Make a hidden object visible again.
rb_obj_setup
Fills common fields in the object.
rb_obj_singleton_methods
Identical to rb_class_instance_methods, except it returns names of singleton methods instead of instance methods.
rb_out_of_int
This is an utility function to raise an ::rb_eRangeError.
rb_p
Inspects an object. It first calls the argument’s #inspect method, then feeds its result string into ::rb_stdout.
rb_path2class
Resolves a Q::W::E::R-style path string to the actual class it points.
rb_path_check
This function is mysterious. What it does is not immediately obvious. Also what it does seems platform dependent.
rb_path_to_class
Identical to rb_path2class, except it accepts the path as Ruby’s string instead of C’s.
rb_pipe
This is an rb_cloexec_pipe + rb_update_max_fd combo.
rb_postponed_job_register
Registers a postponed job.
rb_postponed_job_register_one
Identical to rb_postponed_job_register_one, except it additionally checks for duplicated registration. In case the passed job is already in the postponed job buffer this function does nothing.
rb_prepend_module
Identical to rb_include_module, except it “prepends” the passed module to the klass, instead of includes. This affects how super resolves. For instance:
rb_proc_arity
Queries the number of mandatory arguments of the given Proc. If its block is declared to take no arguments, returns 0. If the block is known to take exactly n arguments, returns n. If the block has optional arguments, returns -n-1, where n is the number of mandatory arguments, with the exception for blocks that are not lambdas and have only a finite number of optional arguments; in this latter case, returns n. Keyword arguments will be considered as a single additional argument, that argument being mandatory if any keyword argument is mandatory.
rb_proc_call
Evaluates the passed proc with the passed arguments.
rb_proc_call_kw
Identical to rb_proc_call, except you can specify how to handle the last element of the given array.
rb_proc_call_with_block
Identical to rb_proc_call, except you can additionally pass another proc object, as a block. Nowadays procs can take blocks:
rb_proc_call_with_block_kw
Identical to rb_proc_call_with_block, except you can specify how to handle the last element of the given array. It can also be seen as a routine identical to rb_proc_call_kw, except you can additionally pass another proc object as a block.
rb_proc_exec
Executes a shell command.
rb_proc_lambda_p
Queries if the given object is a lambda. Instances of ::rb_cProc are either lambda or proc. They differ in several points. This function can distinguish them without actually evaluating their contents.
rb_proc_new
This is an rb_iterate + rb_block_proc combo.
rb_proc_times
Gathers info about resources consumed by the current process.
rb_profile_frame_absolute_path
Identical to rb_profile_frame_path, except it tries to expand the returning path. In case the path is require-d from something else rb_profile_frame_path can return relative paths. This one tries to avoid that.
rb_profile_frame_base_label
Identical to rb_profile_frame_label, except it does not “qualify” the result. Consider the following backtrace:
rb_profile_frame_classpath
Queries the class path of the method that the passed frame represents.
rb_profile_frame_first_lineno
Queries the first line of the method of the passed frame pointer. Can be handy when for instance a debugger want to display the frame in question.
rb_profile_frame_full_label
Identical to rb_profile_frame_label, except it returns a qualified result.
rb_profile_frame_label
Queries human-readable “label” string. This is "<main>" for the toplevel, "<compiled>" for evaluated ones, method name for methods, class name for classes.
rb_profile_frame_method_name
Queries the name of the method of the passed frame.
rb_profile_frame_path
Queries the path of the passed backtrace.
rb_profile_frame_qualified_method_name
Identical to rb_profile_frame_method_name, except it “qualifies” the return value with its defining class.
rb_profile_frame_singleton_method_p
Queries if the method of the passed frame is a singleton class.
rb_profile_frames
Queries mysterious “frame“s of the given range.
rb_protect
Protects a function call from potential global escapes from the function. Such global escapes include exceptions, throw, break, for example.
rb_provide
Declares that the given feature is already provided by someone else. This API can be handy when you have an extension called foo.so which, when required, also provides functionality of bar.so.
rb_provided
Queries if the given feature has already been loaded into the execution context. The “feature” head are things like "json" or "socket".
rb_ractor_local_storage_ptr
Identical to rb_ractor_local_storage_value except the return type.
rb_ractor_local_storage_ptr_newkey
Extended version of rb_ractor_local_storage_value_newkey. It additionally takes the type of the issuing key.
rb_ractor_local_storage_ptr_set
Identical to rb_ractor_local_storage_value_set except the parameter type.
rb_ractor_local_storage_value
Queries the key.
rb_ractor_local_storage_value_lookup
Queries the key.
rb_ractor_local_storage_value_newkey
Issues a new key.
rb_ractor_local_storage_value_set
Associates the passed value to the passed key.
rb_ractor_make_shareable
Destructively transforms the passed object so that multiple Ractors can share it. What is a shareable object and what is not is a nuanced concept, and @ko1 says the definition can still change. However extension library authors might interest to learn how to use #RUBY_TYPED_FROZEN_SHAREABLE.
rb_ractor_make_shareable_copy
Identical to rb_ractor_make_shareable, except it returns a (deep) copy of the passed one instead of modifying it in-place.
rb_ractor_stderr
Queries the standard error of the current Ractor that is calling this function.
rb_ractor_stderr_set
Assigns an IO to the standard error of the Ractor that is calling this function.
rb_ractor_stdin
Queries the standard input of the current Ractor that is calling this function.
rb_ractor_stdin_set
Assigns an IO to the standard input of the Ractor that is calling this function.
rb_ractor_stdout
Queries the standard output of the current Ractor that is calling this function.
rb_ractor_stdout_set
Assigns an IO to the standard output of the Ractor that is calling this function.
rb_raise
Exception entry point. By calling this function the execution of your program gets interrupted to “raise” an exception up to the callee entities. Programs could “rescue” that exception, or could “ensure” some part of them. If nobody cares about such things, the raised exception reaches at the top of execution. This yields abnormal end of the process.
rb_rand_bytes_int32
Repeatedly calls the passed function over and over again until the passed buffer is filled with random bytes.
rb_random_base_init
Initialises an allocated ::rb_random_t instance. Call it from your own initialiser appropriately.
rb_random_bytes
Generates a String of random bytes.
rb_random_int32
Identical to rb_genrand_int32, except it generates using the passed RNG.
rb_random_mark
This is the implementation of ::rb_data_type_struct::dmark for ::[rb_random_data_type]. In case your PRNG does not involve Ruby objects at all (which is quite likely), you can simply reuse it.
rb_random_real
Identical to rb_genrand_real, except it generates using the passed RNG.
rb_random_ulong_limited
Identical to rb_genrand_ulong_limited, except it generates using the passed RNG.
rb_range_beg_len
Deconstructs a numerical range. As the arguments are long based, it expects everything are in the long domain.
rb_range_new
Creates a new Range.
rb_range_values
Deconstructs a range into its components.
rb_rational_den
Queries the denominator of the passed Rational.
rb_rational_new
Constructs a Rational, with reduction. This returns for instance (2/3)r for [rb_rational_new]INT2NUM(-384), INT2NUM(-576)).
rb_rational_num
Queries the numerator of the passed Rational.
rb_rational_raw
Identical to rb_rational_new, except it skips argument validations. It is thus dangerous for extension libraries. For instance 1/0r could be constructed using this.
rb_readwrite_sys_fail
Raises appropriate exception using the parameters.
rb_readwrite_syserr_fail
Identical to rb_readwrite_sys_fail, except it does not depend on C global variable errno. Pass it explicitly.
rb_refinement_new
Creates a new, anonymous refinement.
rb_reg_adjust_startpos
Tell us if this is a wrong idea, but it seems this function has no usage at all. Just remains here for theoretical backwards compatibility.
rb_reg_alloc
Allocates an instance of ::rb_cRegexp.
rb_reg_backref_number
Queries the index of the given named capture. Captures could be named. But that doesn’t mean named ones are not indexed. A regular expression can mix named and non-named captures, and they are all indexed. This function converts from a name to its index.
rb_reg_init_str
Initialises an instance of ::rb_cRegexp.
rb_reg_last_match
This just returns the argument, stringified. What a poor name.
rb_reg_match
This is the match operator.
rb_reg_match2
Identical to rb_reg_match, except it matches against rb_lastline_get (or, the $_).
rb_reg_match_last
The portion of the original string that captured at the very last.
rb_reg_match_post
The portion of the original string after the given match.
rb_reg_match_pre
The portion of the original string before the given match.
rb_reg_new
Creates a new Regular expression.
rb_reg_new_str
Identical to rb_reg_new, except it takes the expression in Ruby’s string instead of C’s.
rb_reg_nth_defined
Identical to rb_reg_nth_match, except it just returns Boolean. This could skip allocating a returning string, resulting in reduced memory footprints if applicable.
rb_reg_nth_match
Queries the nth captured substring.
rb_reg_options
Queries the options of the passed regular expression.
rb_reg_prepare_re
Exercises various checks and preprocesses so that the given regular expression can be applied to the given string. The preprocess here includes (but not limited to) for instance encoding conversion.
rb_reg_quote
Escapes any characters that would have special meaning in a regular expression.
rb_reg_regcomp
Creates a new instance of ::rb_cRegexp. It can be seen as a specialised version of rb_reg_new_str where it does not take options.
rb_reg_region_copy
Duplicates a match data. This is roughly the same as onig_region_copy(), except it tries to GC when there is not enough memory.
rb_reg_regsub
Substitution. This is basically the implementation of String#sub. Also String#gsub repeatedly calls this function.
rb_reg_search
Runs the passed regular expression over the passed string. Unlike rb_reg_search this function also takes position and direction of the search, which make it possible for this function to run from in middle of the string.
rb_remove_event_hook
Removes the passed function from the list of event hooks.
rb_remove_event_hook_with_data
Identical to rb_remove_event_hook, except it additionally takes the data argument. This extra argument is the same as that of rb_add_event_hook, and this function removes the hook which matches both arguments at once.
rb_remove_method
Removes a method. Don’t confuse this to rb_undef_method, which doesn’t remove a method. This one resembles Module#remove_method.
rb_remove_method_id
Identical to rb_remove_method, except it accepts the method name as ::ID.
rb_require
Identical to rb_require_string, except it takes C’s string instead of Ruby’s.
rb_require_string
Finds and loads the given feature, if absent.
rb_rescue
Identical to rb_rescue2, except it does not take a list of exception classes. This is a shorthand of:
rb_rescue2
An equivalent of rescue clause.
rb_reserved_fd_p
Queries if the given FD is reserved or not. Occasionally Ruby interpreter opens files for its own purposes. Use this function to prevent touching such behind-the-scene descriptors.
rb_reset_random_seed
Resets the RNG behind rb_genrand_int32/rb_genrand_real.
rb_respond_to
Queries if the object responds to the method. This involves calling the object’s respond_to? method.
rb_ruby_debug_ptr

rb_ruby_verbose_ptr

rb_scan_args
Retrieves argument from argc and argv to given ::VALUE references according to the format string. The format can be described in ABNF as follows:
rb_scan_args_bad_format

rb_scan_args_kw
Identical to rb_scan_args, except it also accepts kw_splat.
rb_scan_args_length_mismatch

rb_set_class_path
Names a class.
rb_set_class_path_string
Identical to rb_set_class_path, except it accepts the name as Ruby’s string instead of C’s.
rb_set_end_proc
Registers a function that shall run on process exit. Registered functions run in reverse-chronological order, mixed with syntactic END block and Kernel#at_exit.
rb_set_errinfo
Sets the current exception ($!) to the given value.
rb_singleton_class
Finds or creates the singleton class of the passed object.
rb_singleton_class_attached
Attaches a singleton class to its corresponding object.
rb_singleton_class_clone
Clones a singleton class. An object can have its own singleton class. OK. Then what happens when a program clones such object? The singleton class that is attached to the source object must also be cloned. Otherwise a singleton object gets shared with two objects, which breaks “singleton”-ness of such class.
rb_sourcefile
Resembles __FILE__.
rb_sourceline
Resembles __LINE__.
rb_spawn
Identical to rb_f_exec, except it spawns a child process instead of replacing the current one.
rb_spawn_err
Identical to rb_spawn, except you can additionally know the detailed situation in case of abnormal parturitions.
rb_sprintf
Ruby’s extended sprintf(3). We ended up reinventing the entire printf business because we don’t want to depend on locales. OS-provided printf routines might or might not, which caused instabilities of the result strings.
rb_st_add_direct

rb_st_cleanup_safe

rb_st_clear

rb_st_copy

rb_st_delete

rb_st_delete_safe

rb_st_foreach

rb_st_foreach_check

rb_st_foreach_safe
Identical to rb_st_foreach, except it raises exceptions when the callback function tampers the table during iterating over it.
rb_st_foreach_with_replace

rb_st_free_table

rb_st_get_key

rb_st_hash

rb_st_hash_end

rb_st_hash_start

rb_st_hash_uint

rb_st_hash_uint32

rb_st_init_numtable

rb_st_init_numtable_with_size

rb_st_init_strcasetable

rb_st_init_strcasetable_with_size

rb_st_init_strtable

rb_st_init_strtable_with_size

rb_st_init_table

rb_st_init_table_with_size

rb_st_insert

rb_st_insert2

rb_st_keys

rb_st_keys_check

rb_st_locale_insensitive_strcasecmp
Our own locale-insensitive version of strcasecmp(3). The “case” here always means that of the POSIX Locale. It doesn’t depend on runtime locale settings.
rb_st_locale_insensitive_strncasecmp
Our own locale-insensitive version of strcnasecmp(3). The “case” here always means that of the POSIX Locale. It doesn’t depend on runtime locale settings.
rb_st_lookup

rb_st_memsize

rb_st_numcmp

rb_st_numhash

rb_st_shift

rb_st_table_size

rb_st_update

rb_st_values

rb_st_values_check

rb_stat_new
Constructs an instance of ::rb_cStat from the passed information.
rb_str2inum
Identical to rb_str_to_inum, except the second argument controls the base and badcheck at once. It can also be seen as a routine identical to rb_cstr2inum, except it takes Ruby’s strings instead of C’s.
rb_str_append
Identical to rb_str_buf_append, except it converts the right hand side before concatenating.
rb_str_buf_append
Identical to rb_str_cat_cstr, except it takes Ruby’s string instead of C’s. It can also be seen as a routine identical to rb_str_shared_replace, except it appends instead of replaces.
rb_str_buf_cat
@alias{rb_str_cat}
rb_str_buf_cat2
@alias{rb_str_cat_cstr}
rb_str_buf_cat_ascii
Identical to rb_str_cat_cstr, except it additionally assumes the source string be a NUL terminated ASCII string.
rb_str_buf_new
Allocates a “string buffer”. A string buffer here is an instance of ::rb_cString, whose capacity is bigger than the length of it. If you can say that a string grows to a specific amount of bytes, this could be effective than resizing a string over and over again and again.
rb_str_buf_new_cstr
This is a rb_str_buf_new + rb_str_buf_cat combo.
rb_str_capacity
Queries the capacity of the given string.
rb_str_cat
Destructively appends the passed contents to the string.
rb_str_cat2
@alias{rb_str_cat_cstr}
rb_str_cat_cstr
Identical to rb_str_cat, except it assumes the passed pointer is a pointer to a C string.
rb_str_catf
Identical to rb_sprintf, except it renders the output to the specified object rather than creating a new one.
rb_str_cmp
Compares two strings, as in strcmp(3). This does not consider the current locale, but considers the encodings of both sides instead.
rb_str_coderange_scan_restartable
Scans the passed string until it finds something odd. Returns the number of bytes scanned. As the name implies this is suitable for repeated call. One of its application is IO#readlines. The method reads from its receiver’s read buffer, maybe more than once, looking for newlines. But “newline” can be different among encodings. This API is used to detect broken contents to properly mark them as such.
rb_str_comparable
Checks if two strings are comparable each other or not. Because rb_str_cmp must return “lesser than” or “greater than” information, comparing two strings needs a stricter restriction. Both sides must be in a same set of strings which have total order. This is to check that property. Intuitive it sounds? But they can have different encodings. A character and another might or might not appear in the same order in their codepoints. It is complicated than you think.
rb_str_concat
Identical to rb_str_append, except it also accepts an integer as a codepoint. This resembles String#<<.
rb_str_conv_enc
Encoding conversion main routine.
rb_str_conv_enc_opts
Identical to rb_str_conv_enc, except it additionally takes IO encoder options. The extra arguments can be constructed using io_extract_modeenc() etc.
rb_str_drop_bytes
Shrinks the given string for the given number of bytes.
rb_str_dump
“Inverse” of rb_eval_string. Returns a quoted version of the string. All non-printing characters are replaced by \uNNNN or \xHH notation and all special characters are escaped. The result string is guaranteed to render a string of the same contents when passed to eval and friends.
rb_str_dup
Duplicates a string.
rb_str_dup_frozen
@alias{rb_str_new_frozen}
rb_str_ellipsize
Shortens str and adds three dots, an ellipsis, if it is longer than len characters. The length of the returned string in characters is less than or equal to len. If the length of str is less than or equal len, returns str itself. The encoding of returned string is equal to that of passed one. The class of returned string is equal to that of passed one.
rb_str_encode
Converts the contents of the passed string from its encoding to the passed one.
rb_str_encode_ospath
Converts a string into an “OS Path” encoding, if any. In most operating systems there are no such things like per-OS default encoding of filename. For them this function is no-op. However most notably on MacOS, pathnames are UTF-8 encoded. It converts the given string into such encoding.
rb_str_equal
Equality of two strings.
rb_str_export
Identical to rb_str_to_str, except it additionally converts the string into default external encoding. Ruby has a concept called encodings. A string can have different encoding than the environment expects. Someone has to make sure its contents be converted to something suitable. This is that routine. Call it when necessary.
rb_str_export_locale
Identical to rb_str_export, except it converts into the locale encoding instead.
rb_str_export_to_enc
Identical to rb_str_export, except it additionally takes an encoding.
rb_str_format
Formats a string.
rb_str_free
Destroys the given string for no reason.
rb_str_freeze
This is the implementation of String#freeze.
rb_str_hash
Calculates a hash value of a string. This is one of the two functions that constructs struct ::st_hash_type.
rb_str_hash_cmp
Compares two strings. This is one of the two functions that constructs struct ::st_hash_type.
rb_str_inspect
Generates a “readable” version of the receiver.
rb_str_intern
Identical to rb_to_symbol, except it assumes the receiver being an instance of ::RString.
rb_str_length
Identical to rb_str_strlen, except it returns the value in ::rb_cInteger.
rb_str_locktmp
Obtains a “temporary lock” of the string. This advisory locking mechanism prevents other cooperating threads from tampering the receiver. The same thing could be done via freeze mechanism, but this one can also be unlocked using rb_str_unlocktmp.
rb_str_modify
Declares that the string is about to be modified. This for instance let the string have a dedicated backend storage.
rb_str_modify_expand
Identical to rb_str_modify, except it additionally expands the capacity of the receiver.
rb_str_new
Allocates an instance of ::rb_cString.
rb_str_new_cstr
Identical to rb_str_new, except it assumes the passed pointer is a pointer to a C string.
rb_str_new_frozen
Creates a frozen copy of the string, if necessary. This function does nothing when the passed string is already frozen. Otherwise, it allocates a copy of it, which is frozen. The passed string is untouched either ways.
rb_str_new_shared
Identical to rb_str_new_cstr, except it takes a Ruby’s string instead of C’s. Implementation wise it creates a string that shares the backend memory region with the receiver. So the name. But there is no way for extension libraries to know if a string is of such variant.
rb_str_new_static
Identical to rb_str_new, except it takes a C string literal.
rb_str_new_with_class
Identical to rb_str_new, except it takes the class of the allocating object.
rb_str_offset
“Inverse” of rb_str_sublen. This function scans the contents to find the byte index that matches the character index. Generally speaking this is an O(n) operation. Could be slow.
rb_str_plus
Generates a new string, concatenating the former to the latter. It can also be seen as a routine identical to rb_str_append, except it doesn’t tamper the passed strings to create a new one instead.
rb_str_replace
Replaces the contents of the former object with the stringised contents of the latter.
rb_str_resize
Overwrites the length of the string. In contrast to rb_str_set_len, this function can also expand a string.
rb_str_resurrect
I guess there is no use case of this function in extension libraries, but this is a routine identical to rb_str_dup, except it always creates an instance of ::rb_cString regardless of the given object’s class. This makes the most sense when the passed string is formerly hidden by rb_obj_hide.
rb_str_scrub
“Cleanses” the string. A string has its encoding and its contents. They, in practice, do not always fit. There are strings in the wild that are “broken”; include bit patterns that are not allowed by its encoding. That can happen when a user copy&pasted something bad, network input got clobbered by a middleman, cosmic rays hit the physical memory, and many more occasions. This function takes such strings, and fills the “broken” portion with the passed replacement bit pattern.
rb_str_set_len
Overwrites the length of the string. Typically this is used to shrink a string that was formerly expanded.
rb_str_setter
This is a ::rb_gvar_setter_t that refutes non-string assignments.
rb_str_shared_replace
Replaces the contents of the former with the latter.
rb_str_split
Divides the given string based on the given delimiter. This is the 1-argument 0-block version of String#split.
rb_str_strlen
Counts the number of characters (not bytes) that are stored inside of the given string. This of course depends on its encoding. Also this function generally runs in O(n), because for instance you have to scan the entire string to know how many characters are there in a UTF-8 string.
rb_str_sublen
Byte offset to character offset conversion. This makes sense when the receiver is in a multibyte encoding. The string’s i-th character does not always sit at its i-th byte. This function scans the contents to find the character index that matches the byte index. Generally speaking this is an O(n) operation. Could be slow.
rb_str_subpos
Identical to rb_str_substr, except it returns a C’s string instead of Ruby’s.
rb_str_subseq
Identical to rb_str_substr, except the numbers are interpreted as byte offsets instead of character offsets.
rb_str_substr
This is the implementation of two-argumented String#slice.
rb_str_succ
Searches for the “successor” of a string. This function is complicated! This is the only function in the entire ruby API (either C or Ruby) that generates a string out of thin air. First, the successor to an empty string is a new empty string:
rb_str_times
Repetition of a string.
rb_str_tmp_new
Allocates a “temporary” string. This is a hidden empty string. Handy on occasions.
rb_str_to_dbl
Identical to rb_cstr_to_dbl, except it accepts a Ruby’s string instead of C’s.
rb_str_to_interned_str
Identical to rb_interned_str, except it takes a Ruby’s string instead of C’s. It can also be seen as a routine identical to to rb_str_new_shared, except it returns an infamous “f“string.
rb_str_to_inum
Identical to rb_cstr2inum, except it takes Ruby’s strings instead of C’s.
rb_str_to_str
Identical to rb_check_string_type, except it raises exceptions in case of conversion failures.
rb_str_unlocktmp
Releases a lock formerly obtained by rb_str_locktmp.
rb_str_update
Replaces some (or all) of the contents of the given string. This is the implementation of three-argumented String#[]=.
rb_str_vcatf
Identical to rb_str_catf, except it takes a va_list. It can also be seen as a routine identical to rb_vsprintf, except it renders the output to the specified object rather than creating a new one.
rb_string_value
Identical to rb_str_to_str, except it fills the passed pointer with the converted object.
rb_string_value_cstr
Identical to rb_string_value_ptr, except it additionally checks for the contents for viability as a C string. Ruby can accept wider range of contents as strings, compared to C. This function is to check that.
rb_string_value_ptr
Identical to rb_str_to_str, except it returns the converted string’s backend memory region.
rb_struct_alloc
Identical to rb_struct_new, except it takes the field values as a Ruby array.
rb_struct_alloc_noinit
Allocates an instance of the given class. This consequential name is of course because rb_struct_alloc not only allocates but also initialises an instance. The API design is broken.
rb_struct_aref
Resembles Struct#[].
rb_struct_aset
Resembles Struct#[]=.
rb_struct_define
Defines a struct class.
rb_struct_define_under
Identical to rb_struct_define, except it defines the class under the specified namespace instead of global toplevel.
rb_struct_define_without_accessor
Identical to rb_struct_define, except it does not define accessor methods. You have to define them yourself. Forget about the allocator function parameter; it is for internal use only. Extension libraries are unable to properly allocate a ruby struct, because RStruct is opaque.
rb_struct_define_without_accessor_under
Identical to rb_struct_define_without_accessor, except it defines the class under the specified namespace instead of global toplevel. It can also be seen as a routine identical to rb_struct_define_under, except it does not define accessor methods.
rb_struct_getmember
Identical to rb_struct_aref, except it takes ::ID instead of ::VALUE.
rb_struct_initialize
Mass-assigns a struct’s fields.
rb_struct_members
Queries the list of the names of the fields of the class of the given struct object. This is almost the same as calling rb_struct_s_members over the class of the receiver.
rb_struct_new
Creates an instance of the given struct.
rb_struct_s_members
Queries the list of the names of the fields of the given struct class.
rb_struct_size
Returns the number of struct members.
rb_sym2id
Converts an instance of ::rb_cSymbol into an ::ID.
rb_sym2str
Identical to rb_id2str, except it takes an instance of ::rb_cSymbol rather than an ::ID.
rb_sym_all_symbols
Collects every single bits of symbols that have ever interned in the entire history of the current process.
rb_sym_to_s
This is an rb_sym2str + rb_str_dup combo.
rb_symname_p
Sees if the passed C string constructs a valid syntactic symbol. Invalid ones for instance includes whitespaces.
rb_sys_fail
Converts a C errno into a Ruby exception, then raises it. For instance:
rb_sys_fail_str
Identical to rb_sys_fail, except it takes the message in Ruby’s String instead of C’s.
rb_sys_warning
Identical to rb_sys_fail, except it does not raise an exception to render a warning instead.
rb_syserr_fail
Raises appropriate exception that represents a C errno.
rb_syserr_fail_str
Identical to rb_syserr_fail, except it takes the message in Ruby’s String instead of C’s.
rb_syserr_new
Creates an exception object that represents the given C errno.
rb_syserr_new_str
Identical to rb_syserr_new, except it takes the message in Ruby’s String instead of C’s.
rb_syswait
This is a shorthand of rb_waitpid without status and flags. It has been like this since the very beginning. The initial revision already did the same thing. Not sure why, then, it has been named syswait. AFAIK this is different from how wait(3posix) works.
rb_thread_add_event_hook
Identical to rb_add_event_hook, except its effect is limited to the passed thread. Other threads are not affected by this.
rb_thread_add_event_hook2

rb_thread_alone
Checks if the thread this function is running is the only thread that is currently alive.
rb_thread_atfork
A pthread_atfork(3posix)-like API. Ruby expects its child processes to call this function at the very beginning of their processes. If you plan to fork a process don’t forget to call it.
rb_thread_atfork_before_exec
:FIXME: situation of this function is unclear. It seems nobody uses it. Maybe a good idea to KonMari.
rb_thread_call_with_gvl
(Re-)acquires the GVL. This manoeuvre makes it possible for an out-of-GVL routine to one-shot call a ruby method.
rb_thread_call_without_gvl
Allows the passed function to run in parallel with other Ruby threads.
rb_thread_call_without_gvl2
Identical to rb_thread_call_without_gvl, except it does not interface with signals etc. As described in #RB_NOGVL_INTR_FAIL, interrupts can hurt you. In case this function detects an interrupt, it returns immediately. You can record progress of your callback and check it after returning from this function.
rb_thread_check_ints
Checks for interrupts. In ruby, signals are masked by default. You can call this function at will to check if there are pending signals. In case there are, they would be handled in this function.
rb_thread_create
Creates a Ruby thread that is backended by a C function.
rb_thread_current
Obtains the “current” thread.
rb_thread_fd_close
Notifies a closing of a file descriptor to other threads. Multiple threads can wait for the given file descriptor at once. If such file descriptor is closed, threads need to start propagating their exceptions. This is the API to kick that process.
rb_thread_fd_select
Waits for multiple file descriptors at once. This is basically a wrapper of system-provided select() with releasing GVL, to allow other Ruby threads run in parallel.
rb_thread_fd_writable
Identical to rb_thread_wait_fd, except it blocks the current thread until the given file descriptor is ready to be written.
rb_thread_interrupted
Checks if the thread’s execution was recently interrupted. If called from that thread, this function can be used to detect spurious wake-ups.
rb_thread_kill
Terminates the given thread. Unlike a stopped thread, a killed thread could never be revived. This function does return, when passed e.g. an already killed thread. But if the passed thread is the only one, or a special thread called “main”, then it also terminates the entire process.
rb_thread_local_aref
This badly named function reads from a Fiber local storage. When this function was born there was no such thing like a Fiber. The world was innocent. But now… This is a Fiber local storage. Sorry.
rb_thread_local_aset
This badly named function writes to a Fiber local storage. When this function was born there was no such thing like a Fiber. The world was innocent. But now… This is a Fiber local storage. Sorry.
rb_thread_main
Obtains the “main” thread. There are threads called main. Historically the (only) main thread was the one which runs when the process boots. Now that we have Ractor, there are more than one main threads.
rb_thread_remove_event_hook
Identical to rb_remove_event_hook, except it additionally takes a thread argument. This extra argument is the same as that of rb_thread_add_event_hook, and this function removes the hook which matches both arguments at once.
rb_thread_remove_event_hook_with_data
Identical to rb_thread_remove_event_hook, except it additionally takes the data argument. It can also be seen as a routine identical to rb_remove_event_hook_with_data, except it additionally takes the thread. This function deletes hooks that satisfy all three criteria.
rb_thread_run
This is a rb_thread_wakeup + rb_thread_schedule combo.
rb_thread_schedule
Tries to switch to another thread. This function blocks until the current thread re-acquires the GVL.
rb_thread_sleep
Blocks for the given period of time.
rb_thread_sleep_deadly
Identical to rb_thread_sleep_forever, except the thread calling this function is considered “dead” when our deadlock checker is triggered.
rb_thread_sleep_forever
Blocks indefinitely.
rb_thread_stop
Stops the current thread. This is not the end of the thread’s lifecycle. A stopped thread can later be woken up.
rb_thread_wait_fd
Blocks the current thread until the given file descriptor is ready to be read.
rb_thread_wait_for
Identical to rb_thread_sleep, except it takes struct timeval instead.
rb_thread_wakeup
Marks a given thread as eligible for scheduling.
rb_thread_wakeup_alive
Identical to rb_thread_wakeup, except it doesn’t raise on an already killed thread.
rb_throw
Transfers control to the end of the active catch block waiting for tag. Raises [rb_eUncughtThrow] if there is no catch block for the tag. The second parameter supplies a return value for the catch block, which otherwise defaults to ::RUBY_Qnil. For examples, see rb_catch.
rb_throw_obj
Identical to rb_throw, except it allows arbitrary Ruby object to become a tag.
rb_time_interval
Creates a “time interval”. This basically converts an instance of ::rb_cNumeric into a struct timeval, but for instance negative time interval must not exist.
rb_time_nano_new
Identical to rb_time_new, except it accepts the time in nanoseconds resolution.
rb_time_new
Creates an instance of ::rb_cTime with the given time and the local timezone.
rb_time_num_new
Identical to rb_time_timespec_new, except it takes Ruby values instead of C structs.
rb_time_timespec
Identical to rb_time_timeval, except for return type.
rb_time_timespec_interval
Identical to rb_time_interval, except for return type.
rb_time_timespec_new
Creates an instance of ::rb_cTime, with given time and offset.
rb_time_timeval
Converts an instance of rb_cTime to a struct timeval that represents the identical point of time. It can also take something numeric; would consider it as a UNIX time then.
rb_time_utc_offset
Queries the offset, in seconds between the time zone of the time and the UTC.
rb_timespec_now
Fills the current time into the given struct.
rb_to_encoding
Identical to rb_find_encoding, except it raises an exception instead of returning NULL.
rb_to_encoding_index
Obtains a encoding index from a wider range of objects (than rb_enc_find_index.
rb_to_float
Identical to rb_check_to_float, except it raises on error.
rb_to_id
@copydoc rb_intern_str
rb_to_int
Identical to rb_check_to_int, except it raises in case of conversion mismatch.
rb_to_symbol
Identical to rb_intern_str, except it generates a dynamic symbol if necessary.
rb_tracearg_binding
Creates a binding object of the point where the trace is at.
rb_tracearg_callee_id
Identical to rb_tracearg_method_id, except it returns callee id like rb_frame_callee.
rb_tracearg_defined_class
Queries the class that defines the method that the passed trace is at. This can be different from the class of rb_tracearg_self’s return value because of inheritance(s).
rb_tracearg_event
Identical to rb_tracearg_event_flag, except it returns the name of the event in Ruby’s symbol.
rb_tracearg_event_flag
Queries the event of the passed trace.
rb_tracearg_from_tracepoint
Queries the current event of the passed tracepoint.
rb_tracearg_lineno
Queries the line of the point where the trace is at.
rb_tracearg_method_id
Queries the method name of the point where the trace is at.
rb_tracearg_object
Queries the allocated/deallocated object that the trace represents.
rb_tracearg_path
Queries the file name of the point where the trace is at.
rb_tracearg_raised_exception
Queries the raised exception that the trace represents.
rb_tracearg_return_value
Queries the return value that the trace represents.
rb_tracearg_self
Queries the receiver of the point trace is at.
rb_tracepoint_disable
Stops (disables) an already running instance of TracePoint.
rb_tracepoint_enable
Starts (enables) trace(s) defined by the passed object. A TracePoint object does not immediately take effect on creation. You have to explicitly call this API.
rb_tracepoint_enabled_p
Queries if the passed TracePoint is up and running.
rb_tracepoint_new
Creates a tracepoint by registering a callback function for one or more tracepoint events. Once the tracepoint is created, you can use rb_tracepoint_enable to enable the tracepoint.
rb_typeddata_inherited_p
Checks for the domestic relationship between the two.
rb_typeddata_is_kind_of
Checks if the given object is of given kind.
rb_uint2big
Converts a C’s intptr_t into an instance of ::rb_cInteger.
rb_uint2inum
Converts a C’s uintptr_t into an instance of ::rb_cInteger.
rb_ull2inum
Converts a C’s unsigned long long into an instance of ::rb_cInteger.
rb_undef
Inserts a method entry that hides previous method definition of the given name. This is not a deletion of a method. Method of the same name defined in a parent class is kept invisible in this way.
rb_undef_alloc_func
Deletes the allocator function of a class. It is sometimes desirable to restrict creation of an instance of a class. For example it rarely makes sense for a DB adaptor class to allow programmers creating DB row objects without querying the DB itself. You can kill sporadic creation of such objects then, by nullifying the allocator function using this API. Your object shall be allocated using #RB_NEWOBJ_OF() directly.
rb_undef_method
Defines an undef of a method. – What?
rb_undefine_finalizer
Modifies the object so that it has no finalisers at all. This function is mainly provided for symmetry. No practical usages can be thought of.
rb_unexpected_type
Fails with the given object’s type incompatibility to the type.
rb_update_max_fd
Informs the interpreter that the passed fd can be the max. This information is used from rb_close_before_exec.
rb_usascii_encindex
Identical to rb_usascii_encoding, except it returns the encoding’s index instead of the encoding itself.
rb_usascii_encoding
Queries the encoding that represents US-ASCII.
rb_usascii_str_new
Identical to rb_str_new, except it generates a string of “US ASCII” encoding. This is different from rb_external_str_new, not only for the output encoding, but also it doesn’t convert the contents.
rb_usascii_str_new_cstr
Identical to rb_str_new_cstr, except it generates a string of “US ASCII” encoding. It can also be seen as a routine Identical to rb_usascii_str_new, except it assumes the passed pointer is a pointer to a C string.
rb_usascii_str_new_static
Identical to rb_str_new_static, except it generates a string of “US ASCII” encoding instead of “binary”. It can also be seen as a routine identical to rb_usascii_str_new, except it takes a C string literal.
rb_utf8_encindex
Identical to rb_utf8_encoding, except it returns the encoding’s index instead of the encoding itself.
rb_utf8_encoding
Queries the encoding that represents UTF-8.
rb_utf8_str_new
Identical to rb_str_new, except it generates a string of “UTF-8” encoding.
rb_utf8_str_new_cstr
Identical to rb_str_new_cstr, except it generates a string of “UTF-8” encoding. It can also be seen as a routine Identical to rb_usascii_str_new, except it assumes the passed pointer is a pointer to a C string.
rb_utf8_str_new_static
Identical to rb_str_new_static, except it generates a string of “UTF-8” encoding instead of “binary”. It can also be seen as a routine identical to rb_utf8_str_new, except it takes a C string literal.
rb_uv_to_utf8
Encodes a Unicode codepoint into its UTF-8 representation.
rb_varargs_bad_length

rb_vrescue2
Identical to rb_rescue2, except it takes va_list instead of variadic number of arguments. This is exposed to 3rd parties because inline functions use it. Basically you don’t have to bother.
rb_vsprintf
Identical to rb_sprintf, except it takes a va_list.
rb_wait_for_single_fdDeprecated
Blocks until the passed file descriptor is ready for the passed events.
rb_waitpid
Waits for a process, with releasing GVL.
rb_warn
Identical to rb_warning, except it reports always regardless of runtime -W flag.
rb_warning
Issues a warning.
rb_write_error
Writes the given error message to somewhere applicable. On Windows it goes to the console. On POSIX environments it goes to the standard error.
rb_write_error2
Identical to rb_write_error, except it additionally takes the message’s length. Necessary when you want to handle wide characters.
rb_yield
Yields the block. In Ruby there is a concept called a block. You can pass one to a method. In a method, when called with a block, you can yield it using this function.
rb_yield_block
Pass a passed block.
rb_yield_splat
Identical to rb_yield_values, except it splats an array to generate the list of parameters.
rb_yield_splat_kw
Identical to rb_yield_splat, except you can specify how to handle the last element of the given array.
rb_yield_values
Identical to rb_yield, except it takes variadic number of parameters and pass them to the block.
rb_yield_values2
Identical to rb_yield_values, except it takes the parameters as a C array instead of variadic arguments.
rb_yield_values_kw
Identical to rb_yield_values2, except you can specify how to handle the last element of the given array.
ruby_brace_glob
Identical to ruby_glob(), @shyouhei currently suspects. Historically you had to call this function instead of ruby_glob() if the pattern included “{x,y,…}” syntax. However since commit 0f63d961169989a7f6dcf7c0487fe29da, ruby_glob() also supports that syntax. It seems as of writing these two functions provide basically the same functionality in a different implementation. Is this analysis right? Correct me! :FIXME:
ruby_cleanup
Destructs the VM.
ruby_default_signal
Pretends as if there was no custom signal handler. This function sets the signal action to SIG_DFL, then kills itself.
ruby_each_words
Scans the passed string, with calling the callback function every time it encounters a “word”. A word here is a series of characters separated by either a space (of IEEE 1003.1 section 7.3.1.1), or a ','.
ruby_enc_find_basename
Our own encoding-aware version of basename(3). Normally, this function returns the last path component of the given name. However in case the passed name ends with a path separator, it returns the name of the directory, not the last (empty) component. Also if the passed name is a root directory, it returns that root directory. Note however that Windows filesystem have drive letters, which this function does not return.
ruby_enc_find_extname
Our own encoding-aware version of extname. This function first applies rb_enc_path_last_separator to the passed name and only concerns its return value (ignores any parent directories). This function returns complicated results:
ruby_exec_node
Identical to ruby_run_node(), except it returns an opaque execution status. You can pass it to [rb_cleanup].
ruby_executable_node
Checks the return value of ruby_options().
ruby_finalize
Runs the VM finalization processes.
ruby_getcwd
This is our own version of getcwd(3) that uses ruby_xmalloc() instead of system malloc (benefits our GC).
ruby_glob
Identical to rb_glob, except it returns opaque exception states instead of raising exceptions.
ruby_incpush
Appends the given path to the end of the load path.
ruby_init
Calls ruby_setup() and check error.
ruby_init_loadpath
Sets up $LOAD_PATH.
ruby_init_stack
Set stack bottom of Ruby implementation.
ruby_malloc_size_overflow

ruby_native_thread_p
Queries if the thread which calls this function is a ruby’s thread. “Ruby’s” in this context is a thread created using one of our APIs like rb_thread_create. There are distinctions between ruby’s and other threads. For instance calling ruby methods are allowed only from inside of a ruby’s thread.
ruby_options
Processes command line arguments and compiles the Ruby source to execute.
ruby_posix_signal

ruby_process_options
Identical to ruby_options(), except it raises ruby-level exceptions on failure.
ruby_prog_init
Defines built-in variables
ruby_run_node
Runs the given compiled source and exits this process.
ruby_scan_digits
Scans the passed string, assuming the string is a textual representation of an integer. Stops when encountering something non-digit for the passed base.
ruby_scan_hex
Interprets the passed string a hexadecimal unsigned integer. Stops when encounters something not understood.
ruby_scan_oct
Interprets the passed string as an octal unsigned integer. Stops when encounters something not understood.
ruby_script
Sets the current script name to this value.
ruby_set_argv
Sets argv that ruby understands. Your program might have its own command line parameters etc. Handle them as you wish, and pass remaining parts of argv here.
ruby_set_script_name
Identical to ruby_script(), except it takes the name as a Ruby String instance.
ruby_setenv
Sets an environment variable. In case of POSIX this is a wrapper of setenv(3). But there are systems which lack one. We try hard emulating.
ruby_setup
Initializes the VM and builtin libraries.
ruby_show_copyright
Prints the copyright notice of the CRuby interpreter to stdout.
ruby_show_version
Prints the version information of the CRuby interpreter to stdout.
ruby_sig_finalize
Clear signal handlers.
ruby_signal_name
Queries the name of the signal. It returns for instance "KILL" for SIGKILL.
ruby_snprintf
Our own locale-insensitive version of snprintf(3). It can also be seen as a routine identical to rb_sprintf, except it writes back to the passed buffer instead of allocating a new Ruby object.
ruby_stack_check
Checks for stack overflow.
ruby_stack_length
Queries what Ruby thinks is the machine stack. Ruby manages a region of memory. It calls that area the “machine stack”. By calling this function, in spite of its name, you can obtain both one end of the stack and its length at once. Which means you can know the entire region.
ruby_stop
Calls ruby_cleanup() and exits the process.
ruby_strdup
This is our own version of strdup(3) that uses ruby_xmalloc() instead of system malloc (benefits our GC).
ruby_strtod
Our own locale-insensitive version of strtod(3). The conversion is done as if the current locale is set to the “C” locale, no matter actual runtime locale settings.
ruby_strtoul
Our own locale-insensitive version of strtoul(3). The conversion is done as if the current locale is set to the “C” locale, no matter actual runtime locale settings.
ruby_sysinit
Initializes the process for libruby.
ruby_unsetenv
Deletes the passed environment variable, if any.
ruby_vm_at_exit
ruby_vm_at_exit registers a function func to be invoked when a VM passed away. Functions registered this way runs in reverse order of registration, just like END {} block does. The difference is its timing to be triggered. ruby_vm_at_exit functions runs when a VM passed away, while END {} blocks runs just before a VM is passing away.
ruby_vm_destruct
Destructs the passed VM. You don’t have to call this API directly now, because there is no way to create one. There is only one VM at one time. ruby_stop() should just suffice.
ruby_vsnprintf
Identical to ruby_snprintf(), except it takes a va_list. It can also be seen as a routine identical to rb_vsprintf, except it writes back to the passed buffer instead of allocating a new Ruby object.
ruby_xcalloc
Identical to ruby_xmalloc2(), except it returns a zero-filled storage instance. It can also be seen as a routine identical to ruby_xmalloc(), except it calls calloc() instead of malloc().
ruby_xfree
Deallocates a storage instance.
ruby_xmalloc
Allocates a storage instance. It is largely the same as system malloc(), except:
ruby_xmalloc2
Identical to ruby_xmalloc(), except it allocates nelems * elemsiz bytes. This is needed because the multiplication could integer overflow. On such situations Ruby does not try to allocate at all but raises Ruby level exceptions instead. If there is no integer overflow the behaviour is exactly the same as ruby_xmalloc(nelems*elemsiz).
ruby_xrealloc
Resize the storage instance.
ruby_xrealloc2
Identical to ruby_xrealloc(), except it resizes the given storage instance to newelems * newsiz bytes. This is needed because the multiplication could integer overflow. On such situations Ruby does not try to touch the contents of argument pointer at all but raises Ruby level exceptions instead. If there is no integer overflow the behaviour is exactly the same as ruby_xrealloc(ptr,nelems*elemsiz).
setproctitle

Type Aliases§

FILE

ID

OnigApplyAllCaseFoldFunc

OnigCaseFoldType

OnigCodePoint

OnigCtype

OnigDistance

OnigEncoding

OnigEncodingType

OnigOptionType

OnigPosition

OnigRegex

OnigRegexType

OnigRegion

OnigUChar

OnigWarnFunc

RUBY_DATA_FUNC
This is the type of callbacks registered to ::RData. The argument is the data field.
Regexp
@old{re_pattern_buffer}
VALUE

_IO_lock_t

__blkcnt_t

__blksize_t

__builtin_va_list

__dev_t

__fd_mask

__gid_t

__ino_t

__mode_t

__nlink_t

__off64_t

__off_t

__pid_t

__ssize_t

__suseconds_t

__syscall_slong_t

__time_t

__uid_t

mode_t

off_t

pid_t

rb_alloc_func_t
This is the type of functions that ruby calls when trying to allocate an object. It is sometimes necessary to allocate extra memory regions for an object. When you define a class that uses ::RTypedData, it is typically the case. On such situations define a function of this type and pass it to rb_define_alloc_func.
rb_atomic_t

rb_block_call_func
This is the type of a function that the interpreter expect for C-backended blocks. Blocks are often written in Ruby. But C extensions might want to have their own blocks. In order to do so authors have to create a separate C function of this type, and pass its pointer to rb_block_call.
rb_block_call_func_t
Shorthand type that represents an iterator-written-in-C function pointer.
rb_blocking_function_t

rb_data_type_t
This is the struct that holds necessary info for a struct. It roughly resembles a Ruby level class; multiple objects can share a ::rb_data_type_t instance.
rb_debug_inspector_func_t
Type of the callback function passed to rb_debug_inspector_open. Inspection shall happen only inside of them. The passed pointers gets invalidated once after the callback returns.
rb_debug_inspector_t
Opaque struct representing a debug inspector.
rb_encoding
The type of encoding. Our design here is we take Oniguruma/Onigmo’s multilingualisation schema as our base data structure.
rb_enumerator_size_func
This is the type of functions that rb_enumeratorize_with_size expects. In theory an enumerator can have indefinite number of elements, but in practice it often is the case we can compute the size of an enumerator beforehand. If your enumerator has such property, supply a function that calculates such values.
rb_event_flag_t
Represents event(s). As the name implies events are bit flags.
rb_event_hook_func_t
Type of event hooks. When an event happens registered functions are kicked with appropriate parameters.
rb_gvar_getter_t
Type that represents a global variable getter function.
rb_gvar_marker_t
Type that represents a global variable marker function.
rb_gvar_setter_t
Type that represents a global variable setter function.
rb_hash_update_func
Type of callback functions to pass to rb_hash_update_by.
rb_internal_thread_event_callback

rb_internal_thread_event_data_t
All Thread events
rb_internal_thread_event_hook_t

rb_memory_view_available_p_func_t
Type of function of ::rb_memory_view_entry_t::available_p_func.
rb_memory_view_entry_t
Operations applied to a specific kind of a memory view.
rb_memory_view_get_func_t
Type of function of ::rb_memory_view_entry_t::get_func.
rb_memory_view_release_func_t
Type of function of ::rb_memory_view_entry_t::release_func.
rb_postponed_job_func_t
Type of postponed jobs.
rb_ractor_local_key_t
(Opaque) struct that holds a ractor-local storage key.
rb_random_data_type_t
This is the type of ::[rb_random_data_type].
rb_random_get_bytes_func
This is the type of functions called from your object’s #bytes method.
rb_random_get_int32_func
This is the type of functions called from your object’s #rand method.
rb_random_get_real_func
This is the type of functions called from your object’s #rand method.
rb_random_init_func
This is the type of functions called when your random object is initialised. Passed buffer is the seed object basically. But in Ruby a number can be really big. This type of functions accept such big integers as a series of machine words.
rb_random_init_int32_func
This is the type of functions called when your random object is initialised. Passed data is the seed integer.
rb_random_t
Base components of the random interface.
rb_trace_arg_t
Type that represents a specific trace event. Roughly resembles the tracepoint object that is passed to the block of TracePoint.new:
rb_unblock_function_t
This is the type of UBFs. An UBF is a function that unblocks a blocking region. For instance when a thread is blocking due to pselect(3posix), it is highly expected that pthread_kill(3posix) can interrupt the system call and the thread could revive. Or when a thread is blocking due to waitpid(3posix), it is highly expected that killing the waited process should suffice. An UBF is a function that does such things. Designing your own UBF needs deep understanding of why your blocking region blocks, how threads work in ruby, and a matter of luck. It often is the case you simply cannot cancel something that had already begun.
regex_t

ruby_glob_func
Type of a glob callback function. Called every time glob scans a path.
ruby_vm_t
The opaque struct to hold VM internals. Its fields are intentionally hidden from extension libraries because it changes drastically time to time.
size_t

ssize_t

st_check_for_sizeof_st_index_t

st_compare_func

st_data_t

st_foreach_callback_func

st_foreach_check_callback_func

st_hash_func

st_index_t

st_update_callback_func

time_t

va_list

Unions§

RArray__bindgen_ty_1
Array’s specific fields.
RArray__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
Auxiliary info.
RObject__bindgen_ty_1
Object’s specific fields.
RString__bindgen_ty_1
String’s specific fields.
RString__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
Auxiliary info.
__atomic_wide_counter

_bindgen_ty_17

_bindgen_ty_18

_bindgen_ty_19

_bindgen_ty_20

_bindgen_ty_21

_bindgen_ty_22

_bindgen_ty_23