- fix
[oweals/gnunet.git] / src / util / time.c
index 7467b44974d1fabc7bd7ea44e20c909ba2c7a2b6..825b7f8caad9a39a421972691c75dee76a5d5430 100644 (file)
@@ -44,6 +44,19 @@ GNUNET_TIME_set_offset (long long offset)
   timestamp_offset = offset;
 }
 
+
+/**
+ * Get the timestamp offset for this instance.
+ *
+ * @return the offset we currently skew the locale time by
+ */
+long long 
+GNUNET_TIME_get_offset ()
+{
+  return timestamp_offset;
+}
+
+
 /**
  * Get the current time (works just as "time", just that we use the
  * unit of time that the cron-jobs use (and is 64 bit)).
@@ -484,6 +497,7 @@ GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a)
   return ret;
 }
 
+
 /**
  * Convert relative time from network byte order.
  *
@@ -500,6 +514,7 @@ GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a)
 
 }
 
+
 /**
  * Convert absolute time to network byte order.
  *
@@ -515,6 +530,7 @@ GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a)
   return ret;
 }
 
+
 /**
  * Convert absolute time from network byte order.
  *
@@ -531,26 +547,5 @@ GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a)
 
 }
 
-/**
- * Convert a relative time to a string.
- * This is one of the very few calls in the entire API that is
- * NOT reentrant!
- *
- * @param time the time to print
- *
- * @return string form of the time (as milliseconds)
- */
-const char *
-GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time)
-{
-  static char time_string[21];
-
-  memset (time_string, 0, sizeof (time_string));
-
-  sprintf (time_string, "%llu", (unsigned long long) time.rel_value);
-  return (const char *) time_string;
-}
-
-
 
 /* end of time.c */