client_manager: add API for async operations
[oweals/gnunet.git] / src / include / gnunet_time_lib.h
index a739d6d7f0ec7ce8f669c397a58ee5943da5e3ea..d59e68298589dbf84fb5a38c8006646721b08661 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -450,7 +450,7 @@ GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
 
 
 /**
- * Convert relative time to network byte order.
+ * Convert absolute time to network byte order.
  *
  * @param a time to convert
  * @return converted time value
@@ -460,7 +460,7 @@ GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
 
 
 /**
- * Convert relative time from network byte order.
+ * Convert absolute time from network byte order.
  *
  * @param a time to convert
  * @return converted time value
@@ -483,10 +483,37 @@ GNUNET_TIME_set_offset (long long offset);
  *
  * @return the offset we currently skew the locale time by
  */
-long long 
+long long
 GNUNET_TIME_get_offset (void);
 
 
+/**
+ * Return the current year (i.e. '2011').
+ */
+unsigned int
+GNUNET_TIME_get_current_year (void);
+
+
+/**
+ * Convert a year to an expiration time of January 1st of that year.
+ *
+ * @param year a year (after 1970, please ;-)).
+ * @return absolute time for January 1st of that year.
+ */
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_year_to_time (unsigned int year);
+
+
+/**
+ * Convert an expiration time to the respective year (rounds)
+ *
+ * @param at absolute time
+ * @return year a year (after 1970), 0 on error
+ */
+unsigned int
+GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at);
+
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif