absmin
authorChristian Grothoff <christian@grothoff.org>
Fri, 2 Oct 2009 12:54:39 +0000 (12:54 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 2 Oct 2009 12:54:39 +0000 (12:54 +0000)
src/include/gnunet_time_lib.h
src/util/time.c

index 3b901f52658387e99302d429d0a9de56a7a33a44..d00867e8071a23df91bcecd16044c74b6dbc1f98 100644 (file)
@@ -204,6 +204,19 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct
                                                      struct
                                                      GNUNET_TIME_Relative t2);
 
+/**
+ * Return the minimum of two absolute time values.
+ *
+ * @param t1 first timestamp
+ * @param t2 other timestamp
+ * @return timestamp that is smaller
+ */
+struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct
+                                                     GNUNET_TIME_Absolute
+                                                     t1,
+                                                     struct
+                                                     GNUNET_TIME_Absolute t2);
+
 /**
  * Given a timestamp in the future, how much time
  * remains until then?
index f818fc9a12c282b4befef1596af106b4528d0b4e..6d67363a8fb9d368be39dfe431865486f47b6e3a 100644 (file)
@@ -122,6 +122,8 @@ GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel)
 /**
  * Return the minimum of two relative time values.
  *
+ * @param t1 first timestamp
+ * @param t2 other timestamp
  * @return timestamp that is smaller
  */
 struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct
@@ -133,6 +135,24 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct
   return (t1.value < t2.value) ? t1 : t2;
 }
 
+
+
+/**
+ * Return the minimum of two relative time values.
+ *
+ * @param t1 first timestamp
+ * @param t2 other timestamp
+ * @return timestamp that is smaller
+ */
+struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct
+                                                     GNUNET_TIME_Absolute
+                                                     t1,
+                                                     struct
+                                                     GNUNET_TIME_Absolute t2)
+{
+  return (t1.value < t2.value) ? t1 : t2;
+}
+
 /**
  * Given a timestamp in the future, how much time
  * remains until then?