summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-07-22 16:49:08 +0900
committerYusuke Endoh <mame@ruby-lang.org>2022-07-22 23:10:24 +0900
commite763b1118ba1fada81d37da558f9d8e4da99f144 (patch)
tree2e1c85e7879eccbe211169a8510bc916ecba83f1 /include
parentc7fd015d83740b3e758796f8c7d85cc64602f371 (diff)
Move enum definitions out of struct definition
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6169
Diffstat (limited to 'include')
-rw-r--r--include/ruby/io.h59
1 files changed, 29 insertions, 30 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h
index b5e33c1cf9..dc4c8becf6 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -98,6 +98,34 @@ PACKED_STRUCT_UNALIGNED(struct rb_io_buffer_t {
/** @alias{rb_io_buffer_t} */
typedef struct rb_io_buffer_t rb_io_buffer_t;
+/** Decomposed encoding flags (e.g. `"enc:enc2""`). */
+/*
+ * enc enc2 read action write action
+ * NULL NULL force_encoding(default_external) write the byte sequence of str
+ * e1 NULL force_encoding(e1) convert str.encoding to e1
+ * e1 e2 convert from e2 to e1 convert str.encoding to e2
+ */
+struct rb_io_enc_t {
+ /** Internal encoding. */
+ rb_encoding *enc;
+ /** External encoding. */
+ rb_encoding *enc2;
+ /**
+ * Flags.
+ *
+ * @see enum ::ruby_econv_flag_type
+ */
+ int ecflags;
+ /**
+ * Flags as Ruby hash.
+ *
+ * @internal
+ *
+ * This is set. But used from nowhere maybe?
+ */
+ VALUE ecopts;
+};
+
/** Ruby's IO, metadata and buffers. */
typedef struct rb_io_t {
@@ -141,36 +169,7 @@ typedef struct rb_io_t {
*/
VALUE tied_io_for_writing;
- /** Decomposed encoding flags (e.g. `"enc:enc2""`). */
- /*
- * enc enc2 read action write action
- * NULL NULL force_encoding(default_external) write the byte sequence of str
- * e1 NULL force_encoding(e1) convert str.encoding to e1
- * e1 e2 convert from e2 to e1 convert str.encoding to e2
- */
- struct rb_io_enc_t {
- /** Internal encoding. */
- rb_encoding *enc;
-
- /** External encoding. */
- rb_encoding *enc2;
-
- /**
- * Flags.
- *
- * @see enum ::ruby_econv_flag_type
- */
- int ecflags;
-
- /**
- * Flags as Ruby hash.
- *
- * @internal
- *
- * This is set. But used from nowhere maybe?
- */
- VALUE ecopts;
- } encs; /**< Decomposed encoding flags. */
+ struct rb_io_enc_t encs; /**< Decomposed encoding flags. */
/** Encoding converter used when reading from this IO. */
rb_econv_t *readconv;