syn
[oweals/gnunet.git] / src / include / gnunet_time_lib.h
index 4ce1e3f1eb76186557465a4ddddf802f9815e310..b5da09cd83d59940493351eb15c38ab3d794e1f5 100644 (file)
@@ -61,7 +61,7 @@ struct GNUNET_TIME_Relative
  */
 struct GNUNET_TIME_RelativeNBO
 {
-  uint64_t value GNUNET_PACKED;
+  uint64_t value__ GNUNET_PACKED;
 };
 
 
@@ -70,13 +70,15 @@ struct GNUNET_TIME_RelativeNBO
  */
 struct GNUNET_TIME_AbsoluteNBO
 {
-  uint64_t value GNUNET_PACKED;
+  uint64_t value__ GNUNET_PACKED;
 };
 
+
 /**
  * @brief constants to specify time
  */
 #define GNUNET_TIME_UNIT_ZERO     GNUNET_TIME_relative_get_zero()
+#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero()
 #define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_unit()
 #define GNUNET_TIME_UNIT_SECONDS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 1000)
 #define GNUNET_TIME_UNIT_MINUTES GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60)
@@ -103,6 +105,11 @@ struct GNUNET_TIME_AbsoluteNBO
  */
 struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero (void);
 
+/**
+ * Return absolute time of 0ms.
+ */
+struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero (void);
+
 /**
  * Return relative time of 1ms.
  */
@@ -135,6 +142,17 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct
                                                               GNUNET_TIME_Relative
                                                               rel);
 
+/**
+ * Return the minimum of two relative time values.
+ *
+ * @return timestamp that is smaller
+ */
+struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct
+                                                     GNUNET_TIME_Relative
+                                                     t1,
+                                                     struct
+                                                     GNUNET_TIME_Relative t2);
+
 /**
  * Given a timestamp in the future, how much time
  * remains until then?