ruby/include/ruby
Samuel Williams 18e55fc1e1
Hide most of the implementation of struct rb_io. (#6511)
* Add rb_io_path and rb_io_open_descriptor.

* Use rb_io_open_descriptor to create PTY objects

* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it

FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.

* Ensure that rb_io_open_descriptor closes the FD if it fails

If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.

* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P

* Expose `rb_io_closed_p`.

* Add `rb_io_mode` to get IO mode.

---------

Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
2023-05-30 10:02:40 +09:00
..
backward Remove obsoleted MJIT_HEADER macro 2023-03-06 22:29:35 -08:00
fiber Support IO#pread / IO#pwrite using fiber scheduler. (#7594) 2023-03-31 00:48:55 +13:00
internal Hide most of the implementation of struct rb_io. (#6511) 2023-05-30 10:02:40 +09:00
io Support IO#pread / IO#pwrite using fiber scheduler. (#7594) 2023-03-31 00:48:55 +13:00
assert.h typos 2022-08-27 14:42:55 -07:00
atomic.h Align the implementation precedences with rb_atomic_t definition 2021-09-24 10:11:32 +09:00
backward.h Revert "Finer-grained inline constant cache invalidation" 2022-03-25 20:29:09 +09:00
debug.h add debug context APIs for debuggers (frame depth) 2022-11-25 14:01:36 +09:00
defines.h include/ruby/defines.h: add doxygen 2021-09-10 20:00:06 +09:00
encoding.h split include/ruby/encoding.h 2021-10-05 14:18:23 +09:00
intern.h Merge internal/intern/gc.h into internal/gc.h 2023-02-27 10:11:56 -08:00
io.h Hide most of the implementation of struct rb_io. (#6511) 2023-05-30 10:02:40 +09:00
memory_view.h Fix -Wundef warnings 2022-10-26 18:57:26 +09:00
missing.h [wasm] wasm/missing.{c,h}: add missing libc stubs for wasi-libc 2022-01-19 11:19:06 +09:00
onigmo.h Refactor Regexp#match cache implementation (#7724) 2023-04-19 13:08:28 +09:00
oniguruma.h
ractor.h Fix typos 2021-11-02 19:17:37 +09:00
random.h [Bug #19100] Add init_int32 function to rb_random_interface_t 2022-11-10 12:06:13 +09:00
re.h include/ruby/re.h: add doxygen 2021-09-10 20:00:06 +09:00
regex.h include/ruby/regex.h: skip doxygen 2021-09-10 20:00:06 +09:00
ruby.h Merge internal/rgengc.h and internal/gc.h 2023-02-28 09:09:00 -08:00
st.h Implement Hash ST tables on VWA 2023-05-17 09:19:40 -04:00
subst.h include/ruby/subst.h: skip doxygen 2021-09-10 20:00:06 +09:00
thread.h Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
thread_native.h Move rb_thread_cond_struct definition into thread_native.h 2023-05-26 14:51:23 +09:00
util.h Add utility macros DECIMAL_SIZE_OF and DECIMAL_SIZE_OF_BYTES 2023-02-14 15:18:21 +09:00
version.h Development of 3.3.0 started. 2022-12-26 08:46:59 +09:00
vm.h include/ruby/vm.h: add doxygen 2021-09-10 20:00:06 +09:00
win32.h Improve read/write/pread/pwrite consistency. (#7860) 2023-05-27 18:48:47 +09:00