[前][次][番号順一覧][スレッド一覧]

ruby-changes:13035

From: nobu <ko1@a...>
Date: Mon, 7 Sep 2009 17:12:42 +0900 (JST)
Subject: [ruby-changes:13035] Ruby:r24780 (trunk): * io.c (Init_IO): added rdocs for constants.

nobu	2009-09-07 17:12:32 +0900 (Mon, 07 Sep 2009)

  New Revision: 24780

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24780

  Log:
    * io.c (Init_IO): added rdocs for constants.

  Modified files:
    trunk/io.c

Index: io.c
===================================================================
--- io.c	(revision 24779)
+++ io.c	(revision 24780)
@@ -6451,6 +6451,7 @@
     return io;
 }
 
+/* :nodoc: */
 static VALUE
 rb_io_s_new(int argc, VALUE *argv, VALUE klass)
 {
@@ -6519,6 +6520,7 @@
 
 #undef rb_argv
 
+/* :nodoc: */
 static VALUE
 argf_initialize(VALUE argf, VALUE argv)
 {
@@ -6528,6 +6530,7 @@
     return argf;
 }
 
+/* :nodoc: */
 static VALUE
 argf_initialize_copy(VALUE argf, VALUE orig)
 {
@@ -9868,28 +9871,36 @@
 
     rb_define_method(rb_cFile, "initialize",  rb_file_initialize, -1);
 
+    /* open for reading only */
     rb_file_const("RDONLY", INT2FIX(O_RDONLY));
+    /* open for writing only */
     rb_file_const("WRONLY", INT2FIX(O_WRONLY));
+    /* open for reading and writing */
     rb_file_const("RDWR", INT2FIX(O_RDWR));
+    /* append on each write */
     rb_file_const("APPEND", INT2FIX(O_APPEND));
+    /* create file if it does not exist */
     rb_file_const("CREAT", INT2FIX(O_CREAT));
+    /* error if CREAT and the file exists */
     rb_file_const("EXCL", INT2FIX(O_EXCL));
 #if defined(O_NDELAY) || defined(O_NONBLOCK)
-#   ifdef O_NONBLOCK
+# ifndef O_NONBLOCK
+#   define O_NONBLOCK O_NDELAY
+# endif
+    /* do not block on open or for data to become available */
     rb_file_const("NONBLOCK", INT2FIX(O_NONBLOCK));
-#   else
-    rb_file_const("NONBLOCK", INT2FIX(O_NDELAY));
-#   endif
 #endif
+    /* truncate size to 0 */
     rb_file_const("TRUNC", INT2FIX(O_TRUNC));
 #ifdef O_NOCTTY
+    /* not to make opened IO the controling terminal device */
     rb_file_const("NOCTTY", INT2FIX(O_NOCTTY));
 #endif
-#ifdef O_BINARY
+#ifndef O_BINARY
+# define  O_BINARY 0
+#endif
+    /* disable line code conversion and make ASCII-8BIT */
     rb_file_const("BINARY", INT2FIX(O_BINARY));
-#else
-    rb_file_const("BINARY", INT2FIX(0));
-#endif
 #ifdef O_SYNC
     rb_file_const("SYNC", INT2FIX(O_SYNC));
 #endif
@@ -9900,9 +9911,11 @@
     rb_file_const("RSYNC", INT2FIX(O_RSYNC));
 #endif
 #ifdef O_NOFOLLOW
+    /* do not follow symlinks */
     rb_file_const("NOFOLLOW", INT2FIX(O_NOFOLLOW)); /* FreeBSD, Linux */
 #endif
 #ifdef O_NOATIME
+    /* do not change atime */
     rb_file_const("NOATIME", INT2FIX(O_NOATIME)); /* Linux */
 #endif
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]