]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_time.h
Add frsh_destroy()
[frescor/frsh-include.git] / frsh_time.h
index 86dc48ce322b5e48cbca419918280c6ae631d424..8ab5f63edf39ddaeabf3a0578b3f7d996bfeda38 100644 (file)
@@ -1,5 +1,5 @@
 // -----------------------------------------------------------------------
-//  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
+//  Copyright (C) 2006 - 2009 FRESCOR consortium partners:
 //
 //    Universidad de Cantabria,              SPAIN
 //    University of York,                    UK
 //  by the GNU General Public License. This exception does not
 //  however invalidate any other reasons why the executable file might be
 //  covered by the GNU Public License.
-//  As a special exception, if you include this header file into source
-//  files to be compiled, this header file does not by itself cause
-//  the resulting executable to be covered by the GNU General Public
-//  License.  This exception does not however invalidate any other
-//  reasons why the executable file might be covered by the GNU General
-//  Public License.
 // -----------------------------------------------------------------------
 //frsh_spare_capacity_types.h
 //==============================================
@@ -159,6 +153,14 @@ static inline frsh_rel_time_t frsh_rel_time_add(frsh_rel_time_t t1, frsh_rel_tim
     return fosa_rel_time_add(t1, t2);
 }
 
+static inline frsh_rel_time_t frsh_rel_time_incr(frsh_rel_time_t t1, frsh_rel_time_t t2)
+{
+    return fosa_rel_time_add(t1, t2);
+}
+
+
+
+
 /**
  * frsh_abs_time_decr
  *
@@ -190,6 +192,15 @@ static inline frsh_rel_time_t frsh_abs_time_extract_interval(frsh_abs_time_t pas
     return fosa_abs_time_extract_interval(past, future);
 }
 
+
+static inline frsh_rel_time_t frsh_abs_time_subtract(frsh_abs_time_t past, frsh_abs_time_t future)
+{
+    return fosa_abs_time_extract_interval(past, future);
+}
+
+
+
+
 /**
  * frsh_rel_time_times_integer()
  * 
@@ -203,7 +214,7 @@ static inline frsh_rel_time_t frsh_rel_time_times_integer(frsh_rel_time_t time,
 /**
  * frsh_rel_time_times_integer()
  * 
- * Multiplies a relative time by an integer
+ * Divides a relative time by an integer
  **/
 static inline frsh_rel_time_t frsh_rel_time_divided_by_integer(frsh_rel_time_t time, long divider)
 {
@@ -298,6 +309,48 @@ static inline long frsh_abs_time_to_usec(frsh_abs_time_t interval)
     return fosa_abs_time_to_usec(interval);
 }
 
+/**
+ * frsh_nsec_to_rel_time() 
+ *
+ * Convert an integer value of microseconds into an absolute instant.
+ */
+static inline frsh_rel_time_t frsh_nsec_to_rel_time(long nsec)
+{
+    return fosa_nsec_to_rel_time(nsec);
+}
+
+
+/**
+ * frsh_rel_time_to_nsec() 
+ *
+ * Convert a relative interval into an integer number of microseconds.
+ */
+static inline long frsh_rel_time_to_nsec(frsh_rel_time_t interval)
+{
+    return fosa_rel_time_to_nsec(interval);
+}
+
+/**
+ * frsh_nsec_to_abs_time() 
+ *
+ * Convert an integer value of microseconds into an absolute instant.
+ */
+static inline frsh_abs_time_t frsh_nsec_to_abs_time(long nsec)
+{
+    return fosa_nsec_to_abs_time(nsec);
+}
+
+
+/**
+ * frsh_abs_time_to_nsec() 
+ *
+ * Convert a relative interval into an integer number of microseconds.
+ */
+static inline long frsh_abs_time_to_nsec(frsh_abs_time_t interval)
+{
+    return fosa_abs_time_to_nsec(interval);
+}
+
 /******************************************
  * Conversion to-from POSIX timespec format
  ******************************************/