summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-28 14:23:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-28 14:23:33 +0000
commit5eaf7e581661ea92c0468eb239ece86b27187ade (patch)
tree92794226e7672713346ac7cdbbfca1472b19f252 /time.c
parentdaa1423dea418737e2a0b371921c8d02df07f1f6 (diff)
* gc.c (gc_mark): explicitly check mark recursion levels, instead
of unreliable stack length. * file.c (path_check_1): honor sticky bits always. [ruby-talk:86273] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/time.c b/time.c
index c0b1c38..c4ef1d4 100644
--- a/time.c
+++ b/time.c
@@ -1010,6 +1010,16 @@ time_minus(time1, time2)
}
static VALUE
+time_succ(time)
+ VALUE time;
+{
+ struct time_object *tobj;
+
+ GetTimeval(time, tobj);
+ return rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec);
+}
+
+static VALUE
time_sec(time)
VALUE time;
{
@@ -1471,6 +1481,7 @@ Init_Time()
rb_define_method(rb_cTime, "+", time_plus, 1);
rb_define_method(rb_cTime, "-", time_minus, 1);
+ rb_define_method(rb_cTime, "succ", time_succ, 0);
rb_define_method(rb_cTime, "sec", time_sec, 0);
rb_define_method(rb_cTime, "min", time_min, 0);
rb_define_method(rb_cTime, "hour", time_hour, 0);