summaryrefslogtreecommitdiff
path: root/internal/io.h
AgeCommit message (Collapse)Author
2024-01-24Define `IO_WITHOUT_GVL` macroNobuyoshi Nakada
2023-08-25do not redefine a typedef卜部昌平
duplicated typedef declaration was not allowed in C99. Notes: Merged: https://github.com/ruby/ruby/pull/8274
2023-06-08Add deprecations for public `struct rb_io` members. (#7916)Samuel Williams
* Add deprecations for public struct rb_io members. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-06-01Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui
This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
2023-05-30Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams
* 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> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-09-28Move some function declaration to internal/io.hS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4901
2021-09-10internal/*.h: skip doxygen卜部昌平
These contents are purely implementation details, not worth appearing in CAPI documents. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4815
2020-04-13add #include guard hack卜部昌平
According to MSVC manual (*1), cl.exe can skip including a header file when that: - contains #pragma once, or - starts with #ifndef, or - starts with #if ! defined. GCC has a similar trick (*2), but it acts more stricter (e. g. there must be _no tokens_ outside of #ifndef...#endif). Sun C lacked #pragma once for a looong time. Oracle Developer Studio 12.5 finally implemented it, but we cannot assume such recent version. This changeset modifies header files so that each of them include strictly one #ifndef...#endif. I believe this is the most portable way to trigger compiler optimizations. [Bug #16770] *1: https://docs.microsoft.com/en-us/cpp/preprocessor/once *2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html Notes: Merged: https://github.com/ruby/ruby/pull/3023
2020-04-12PAGER without fork&exec too [Feature #16754]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3000
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2019-12-26decouple internal.h headers卜部昌平
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-26other minior internal header tweaks卜部昌平
These headers need no rewrite. Just add some minor tweaks, like addition of #include lines. Mainly cosmetic. TIMET_MAX_PLUS_ONE was deleted because the macro was used from only one place (directly write expression there). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-26split internal.h into files卜部昌平
One day, I could not resist the way it was written. I finally started to make the code clean. This changeset is the beginning of a series of housekeeping commits. It is a simple refactoring; split internal.h into files, so that we can divide and concur in the upcoming commits. No lines of codes are either added or removed, except the obvious file headers/footers. The generated binary is identical to the one before. Notes: Merged: https://github.com/ruby/ruby/pull/2711