summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ruby/internal/core/rfile.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/ruby/internal/core/rfile.h b/include/ruby/internal/core/rfile.h
index 71699a0b7e..f8dddde9e5 100644
--- a/include/ruby/internal/core/rfile.h
+++ b/include/ruby/internal/core/rfile.h
@@ -27,10 +27,25 @@
* into ruby/ruby.h. We follow that tradition. */
struct rb_io_t;
+/**
+ * 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.
+ */
struct RFile {
+
+ /** Basic part, including flags and class. */
struct RBasic basic;
+
+ /** IO's specific fields. */
struct rb_io_t *fptr;
};
+/**
+ * Convenient casting macro.
+ *
+ * @param obj An object, which is in fact an ::RFile.
+ * @return The passed object casted to ::RFile.
+ */
#define RFILE(obj) RBIMPL_CAST((struct RFile *)(obj))
#endif /* RBIMPL_RFILE_H */