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

ruby-changes:20278

From: tadf <ko1@a...>
Date: Thu, 30 Jun 2011 20:05:34 +0900 (JST)
Subject: [ruby-changes:20278] tadf:r32326 (trunk): * ext/date/date_core.c: modified doc.

tadf	2011-06-30 20:05:24 +0900 (Thu, 30 Jun 2011)

  New Revision: 32326

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

  Log:
    * ext/date/date_core.c: modified doc.

  Modified files:
    trunk/ChangeLog
    trunk/ext/date/date_core.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32325)
+++ ChangeLog	(revision 32326)
@@ -1,3 +1,7 @@
+Thu Jun 30 20:03:39 2011  Tadayoshi Funaba  <tadf@d...>
+
+	* ext/date/date_core.c: modified doc.
+
 Thu Jun 30 19:09:19 2011  Koichi Sasada  <ko1@a...>
 
 	* thread_pthread.c (thread_timer): ignore unknown errno.
Index: ext/date/date_core.c
===================================================================
--- ext/date/date_core.c	(revision 32325)
+++ ext/date/date_core.c	(revision 32326)
@@ -229,11 +229,19 @@
 #endif
 #endif
 
+/* A set of nth, jd, df and sf denote ajd + 1/2.  Each ajd begin at
+ * noon of GMT (assume equal to UTC).  However, this begins at
+ * midnight.
+ */
+
 struct SimpleDateData
 {
     unsigned flags;
     VALUE nth;	/* not always canonicalized */
     int jd;	/* as utc */
+    /* df is zero */
+    /* sf is zero */
+    /* of is zero */
 #ifndef USE_FLOAT
     double sg;  /* 2298874..2426355 or -/+oo */
 #else
@@ -244,6 +252,9 @@
 #ifndef USE_PACK
     int mon;
     int mday;
+    /* hour is zero */
+    /* min is zero */
+    /* sec is zero */
 #else
     /* packed civil */
     unsigned pc;
@@ -2436,7 +2447,7 @@
 /*
  * call-seq:
  *    Date.valid_civil?(year, month, mday[, start=Date::ITALY])  ->  bool
- *    Date.valid_date?(year, month, mday[, start=Date::ITALY])  ->  bool
+ *    Date.valid_date?(year, month, mday[, start=Date::ITALY])   ->  bool
  *
  * Returns true if the given calendar date is valid, and false if not.
  *
@@ -2812,7 +2823,7 @@
 /*
  * call-seq:
  *    Date.gregorian_leap?(year)  ->  bool
- *    Date.leap?(year)  ->  bool
+ *    Date.leap?(year)            ->  bool
  *
  * Returns true if the given year is a leap year of the proleptic
  * Gregorian calendar.
@@ -3240,7 +3251,7 @@
 /*
  * call-seq:
  *    Date.civil([year=-4712[, month=1[, mday=1[, start=Date::ITALY]]]])  ->  date
- *    Date.new([year=-4712[, month=1[, mday=1[, start=Date::ITALY]]]])  ->  date
+ *    Date.new([year=-4712[, month=1[, mday=1[, start=Date::ITALY]]]])    ->  date
  *
  * Creates a date object denoting the given calendar date.
  *
@@ -4089,7 +4100,7 @@
 
 /*
  * call-seq:
- *    Date._strptime(string[, format="%F"])  ->  hash
+ *    Date._strptime(string[, format='%F'])  ->  hash
  *
  * Parses the given representation of date and time with the given
  * template, and returns a hash of parsed elements.
@@ -4109,7 +4120,7 @@
 
 /*
  * call-seq:
- *    Date.strptime([string="-4712-01-01"[, format="%F"[, start=ITALY]]])  ->  date
+ *    Date.strptime([string='-4712-01-01'[, format='%F'[, start=ITALY]]])  ->  date
  *
  * Parses the given representation of date and time with the given
  * template, and creates a date object.
@@ -4205,7 +4216,7 @@
 
 /*
  * call-seq:
- *    Date.parse(string="-4712-01-01"[, comp=true[, start=ITALY]])  ->  date
+ *    Date.parse(string='-4712-01-01'[, comp=true[, start=ITALY]])  ->  date
  *
  * Parses the given representation of date and time, and creates a
  * date object.
@@ -4267,10 +4278,10 @@
 
 /*
  * call-seq:
- *    Date.iso8601(string="-4712-01-01"[, start=ITALY])  ->  date
+ *    Date.iso8601(string='-4712-01-01'[, start=ITALY])  ->  date
  *
  * Creates a new Date object by parsing from a string according to
- * some typical ISO 8601 format.
+ * some typical ISO 8601 formats.
  *
  * For example:
  *
@@ -4312,10 +4323,10 @@
 
 /*
  * call-seq:
- *    Date.rfc3339(string="-4712-01-01T00:00:00+00:00"[, start=ITALY])  ->  date
+ *    Date.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=ITALY])  ->  date
  *
  * Creates a new Date object by parsing from a string according to
- * some typical RFC 3339 format.
+ * some typical RFC 3339 formats.
  *
  * For example:
  *
@@ -4355,10 +4366,10 @@
 
 /*
  * call-seq:
- *    Date.xmlschema(string="-4712-01-01"[, start=ITALY])  ->  date
+ *    Date.xmlschema(string='-4712-01-01'[, start=ITALY])  ->  date
  *
  * Creates a new Date object by parsing from a string according to
- * some typical XML Schema format.
+ * some typical XML Schema formats.
  *
  * For example:
  *
@@ -4387,7 +4398,7 @@
 /*
  * call-seq:
  *    Date._rfc2822(string)  ->  hash
- *    Date._rfc822(string)  ->  hash
+ *    Date._rfc822(string)   ->  hash
  *
  * Returns a hash of parsed elements.
  */
@@ -4399,11 +4410,11 @@
 
 /*
  * call-seq:
- *    Date.rfc2822(string="Mon, 1 Jan -4712 00:00:00 +0000"[, start=ITALY])  ->  date
- *    Date.rfc822(string="Mon, 1 Jan -4712 00:00:00 +0000"[, start=ITALY])  ->  date
+ *    Date.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY])  ->  date
+ *    Date.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY])   ->  date
  *
  * Creates a new Date object by parsing from a string according to
- * some typical RFC 2822 format.
+ * some typical RFC 2822 formats.
  *
  * For example:
  *
@@ -4444,7 +4455,7 @@
 
 /*
  * call-seq:
- *    Date.httpdate(string="Mon, 01 Jan -4712 00:00:00 GMT"[, start=ITALY])  ->  date
+ *    Date.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=ITALY])  ->  date
  *
  * Creates a new Date object by parsing from a string according to
  * some RFC 2616 format.
@@ -4489,10 +4500,10 @@
 
 /*
  * call-seq:
- *    Date.jisx0301(string="-4712-01-01"[, start=ITALY])  ->  date
+ *    Date.jisx0301(string='-4712-01-01'[, start=ITALY])  ->  date
  *
  * Creates a new Date object by parsing from a string according to
- * some typical JIS X 0301 format.
+ * some typical JIS X 0301 formats.
  *
  * For example:
  *
@@ -4805,7 +4816,7 @@
 
 /*
  * call-seq:
- *    d.mon  ->  fixnum
+ *    d.mon    ->  fixnum
  *    d.month  ->  fixnum
  *
  * Returns the month (1-12).
@@ -4824,7 +4835,7 @@
 /*
  * call-seq:
  *    d.mday  ->  fixnum
- *    d.day  ->  fixnum
+ *    d.day   ->  fixnum
  *
  * Returns the day of the month (1-31).
  *
@@ -5073,7 +5084,7 @@
 
 /*
  * call-seq:
- *    d.min  ->  fixnum
+ *    d.min     ->  fixnum
  *    d.minute  ->  fixnum
  *
  * Returns the minute (0-59).
@@ -5091,7 +5102,7 @@
 
 /*
  * call-seq:
- *    d.sec  ->  fixnum
+ *    d.sec     ->  fixnum
  *    d.second  ->  fixnum
  *
  * Returns the second (0-59).
@@ -5109,7 +5120,7 @@
 
 /*
  * call-seq:
- *    d.sec_fraction  ->  rational
+ *    d.sec_fraction     ->  rational
  *    d.second_fraction  ->  rational
  *
  * Returns the fractional part of the second.
@@ -5420,8 +5431,8 @@
  *    d + other  ->  date
  *
  * Returns a date object pointing other days after self.  The other
- * should be a numeric value.  If the other is flonum, its precision
- * is at most nanosecond.
+ * should be a numeric value.  If the other is flonum, assumes its
+ * precision is at most nanosecond.
  *
  * For example:
  *
@@ -5824,12 +5835,12 @@
 
 /*
  * call-seq:
- *    d - other  ->  date or numeric
+ *    d - other  ->  date or rational
  *
  * Returns the difference between the two dates if the other is a date
- * object.  If the other is a numeric value, it returns a date object
- * pointing other days before self.  If the other is flonum, its
- * precision is at most nanosecond.
+ * object.  If the other is a numeric value, returns a date object
+ * pointing other days before self.  If the other is flonum, assumes
+ * its precision is at most nanosecond.
  *
  * For example:
  *
@@ -6040,7 +6051,7 @@
 
 /*
  * call-seq:
- *    d.step(limit[, step=1])  ->  enumerator
+ *    d.step(limit[, step=1])              ->  enumerator
  *    d.step(limit[, step=1]){|date| ...}  ->  self
  *
  * Iterates evaluation of the given block, which takes a date object.
@@ -6094,7 +6105,7 @@
 
 /*
  * call-seq:
- *    d.upto(max)  ->  enumerator
+ *    d.upto(max)              ->  enumerator
  *    d.upto(max){|date| ...}  ->  self
  *
  * This method is equivalent to step(max, 1){|date| ...}.
@@ -6116,7 +6127,7 @@
 
 /*
  * call-seq:
- *    d.downto(min)  ->  enumerator
+ *    d.downto(min)              ->  enumerator
  *    d.downto(min){|date| ...}  ->  self
  *
  * This method is equivalent to step(min, -1){|date| ...}.
@@ -6743,7 +6754,7 @@
 
 /*
  * call-seq:
- *    d.strftime([format="%F"])  ->  string
+ *    d.strftime([format='%F'])  ->  string
  *
  *  Formats date according to the directives in the given format
  *  string.
@@ -6944,7 +6955,7 @@
 /*
  * call-seq:
  *    d.asctime  ->  string
- *    d.ctime  ->  string
+ *    d.ctime    ->  string
  *
  * Returns a string in asctime(3) format (but without "\n\0" at the
  * end).  This method is equivalent to strftime('%c').
@@ -6959,7 +6970,7 @@
 
 /*
  * call-seq:
- *    d.iso8601  ->  string
+ *    d.iso8601    ->  string
  *    d.xmlschema  ->  string
  *
  * This method is equivalent to strftime('%F').
@@ -6985,7 +6996,7 @@
 /*
  * call-seq:
  *    d.rfc2822  ->  string
- *    d.rfc822  ->  string
+ *    d.rfc822   ->  string
  *
  * This method is equivalent to strftime('%a, %-d %b %Y %T %z').
  */
@@ -7329,7 +7340,7 @@
 /*
  * call-seq:
  *    DateTime.civil([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]])  ->  datetime
- *    DateTime.new([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]])  ->  datetime
+ *    DateTime.new([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]])    ->  datetime
  *
  * Creates a date-time object denoting the given calendar date.
  *
@@ -7796,7 +7807,7 @@
 
 /*
  * call-seq:
- *    DateTime._strptime(string[, format="%FT%T%z"])  ->  hash
+ *    DateTime._strptime(string[, format='%FT%T%z'])  ->  hash
  *
  * Parses the given representation of date and time with the given
  * template, and returns a hash of parsed elements.
@@ -7811,7 +7822,7 @@
 
 /*
  * call-seq:
- *    DateTime.strptime([string="-4712-01-01T00:00:00+00:00"[, format="%FT%T%z"[ ,start=ITALY]]])  ->  datetime
+ *    DateTime.strptime([string='-4712-01-01T00:00:00+00:00'[, format='%FT%T%z'[ ,start=ITALY]]])  ->  datetime
  *
  * Parses the given representation of date and time with the given
  * template, and creates a date object.
@@ -7865,7 +7876,7 @@
 
 /*
  * call-seq:
- *    DateTime.parse(string="-4712-01-01T00:00:00+00:00"[, comp=true[, start=ITALY]])  ->  datetime
+ *    DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=ITALY]])  ->  datetime
  *
  * Parses the given representation of date and time, and creates a
  * date object.
@@ -7910,10 +7921,10 @@
 
 /*
  * call-seq:
- *    DateTime.iso8601(string="-4712-01-01T00:00:00+00:00"[, start=ITALY])  ->  datetime
+ *    DateTime.iso8601(string='-4712-01-01T00:00:00+00:00'[, start=ITALY])  ->  datetime
  *
  * Creates a new Date object by parsing from a string according to
- * some typical ISO 8601 format.
+ * some typical ISO 8601 formats.
  *
  * For example:
  *
@@ -7946,10 +7957,10 @@
 
 /*
  * call-seq:
- *    DateTime.rfc3339(string="-4712-01-01T00:00:00+00:00"[, start=ITALY])  ->  datetime
+ *    DateTime.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=ITALY])  ->  datetime
  *
  * Creates a new Date object by parsing from a string according to
- * some typical RFC 3339 format.
+ * some typical RFC 3339 formats.
  *
  * For example:
  *
@@ -7978,10 +7989,10 @@
 
 /*
  * call-seq:
- *    DateTime.xmlschema(string="-4712-01-01T00:00:00+00:00"[, start=ITALY])  ->  datetime
+ *    DateTime.xmlschema(string='-4712-01-01T00:00:00+00:00'[, start=ITALY])  ->  datetime
  *
  * Creates a new Date object by parsing from a string according to
- * some typical XML Schema format.
+ * some typical XML Schema formats.
  *
  * For example:
  *
@@ -8010,11 +8021,11 @@
 
 /*
  * call-seq:
- *    DateTime.rfc2822(string="Mon, 1 Jan -4712 00:00:00 +0000"[, start=ITALY])  ->  datetime
- *    DateTime.rfc822(string="Mon, 1 Jan -4712 00:00:00 +0000"[, start=ITALY])  ->  datetime
+ *    DateTime.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY])  ->  datetime
+ *    DateTime.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY])   ->  datetime
  *
  * Creates a new Date object by parsing from a string according to
- * some typical RFC 2822 format.
+ * some typical RFC 2822 formats.
  *
  * For example:
  *
@@ -8043,7 +8054,7 @@
 
 /*
  * call-seq:
- *    DateTime.httpdate(string="Mon, 01 Jan -4712 00:00:00 GMT"[, start=ITALY])  ->  datetime
+ *    DateTime.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=ITALY])  ->  datetime
  *
  * Creates a new Date object by parsing from a string according to
  * some RFC 2616 format.
@@ -8075,10 +8086,10 @@
 
 /*
  * call-seq:
- *    DateTime.jisx0301(string="-4712-01-01T00:00:00+00:00"[, start=ITALY])  ->  datetime
+ *    DateTime.jisx0301(string='-4712-01-01T00:00:00+00:00'[, start=ITALY])  ->  datetime
  *
  * Creates a new Date object by parsing from a string according to
- * some typical JIS X 0301 format.
+ * some typical JIS X 0301 formats.
  *
  * For example:
  *
@@ -8125,7 +8136,7 @@
 
 /*
  * call-seq:
- *    dt.strftime([format="%FT%T%:z"])  ->  string
+ *    dt.strftime([format='%FT%T%:z'])  ->  string
  *
  *  Formats date according to the directives in the given format
  *  string.
@@ -8334,7 +8345,7 @@
 
 /*
  * call-seq:
- *    dt.iso8601([n=0])  ->  string
+ *    dt.iso8601([n=0])    ->  string
  *    dt.xmlschema([n=0])  ->  string
  *
  * This method is equivalent to strftime('%FT%T').  The optional
@@ -9177,8 +9188,8 @@
      *				#=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>
      *
      * The last element of day, hour, minute or senond can be
-     * fractional number. The fractional number's precision is at most
-     * nanosecond.
+     * fractional number. The fractional number's precision is assumed
+     * at most nanosecond.
      *
      *     DateTime.new(2001,2,3.5)
      *				#=> #<DateTime: 2001-02-03T12:00:00+00:00 ...>
@@ -9187,8 +9198,8 @@
      * between the local time and UTC.  For example, Rational(3,24)
      * represents ahead of 3 hours of UTC, Rational(-5,24) represents
      * behind of 5 hours of UTC.  The offset should be -1 to +1, and
-     * its precision is at most second.  The default value is zero
-     * (equals to UTC).
+     * its precision is assumed at most second.  The default value is
+     * zero (equals to UTC).
      *
      *     DateTime.new(2001,2,3,4,5,6,Rational(3,24))
      *				#=> #<DateTime: 2001-02-03T03:04:05+03:00 ...>

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

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