mega modif by Mathieu Desnoyers. Independant main windows, multiple tracesets, contro...
[lttv.git] / ltt / branches / poly / include / ltt / ltt.h
index 1da397f365d7f8e816fa87a363fd242008139764..158553622fc02102be136bda10faf9ac8733f12c 100644 (file)
@@ -80,8 +80,22 @@ typedef struct _LttTime {
   unsigned long tv_nsec;
 } LttTime;
 
+
+typedef struct _TimeInterval{
+  LttTime startTime;
+  LttTime endTime;  
+} TimeInterval;
+
+
 typedef uint64_t LttCycleCount;
 
+#define NANSECOND_CONST       1000000000
+
+/* Event positions are used to seek within a tracefile based on
+   the block number and event position within the block. */
+
+typedef struct _LttEventPosition LttEventPosition;
+
 
 /* Differences between architectures include word sizes, endianess,
    alignment, floating point format and calling conventions. For a
@@ -103,11 +117,14 @@ typedef enum _LttArchEndian
 do \
 {\
   (T3).tv_sec  = (T2).tv_sec  - (T1).tv_sec;  \
-  (T3).tv_nsec = (T2).tv_nsec - (T1).tv_nsec; \
-  if((T3).tv_nsec < 0)\
+  if((T2).tv_nsec < (T1).tv_nsec)\
     {\
     (T3).tv_sec--;\
-    (T3).tv_nsec += 1000000000;\
+    (T3).tv_nsec = NANSECOND_CONST - (T1).tv_nsec + (T2).tv_nsec;\
+    }\
+  else\
+    {\
+    (T3).tv_nsec = (T2).tv_nsec - (T1).tv_nsec;\
     }\
 } while(0)
 
@@ -117,10 +134,10 @@ do \
 {\
   (T3).tv_sec  = (T2).tv_sec  + (T1).tv_sec;  \
   (T3).tv_nsec = (T2).tv_nsec + (T1).tv_nsec; \
-  if((T3).tv_nsec >= 1000000000)\
+  if((T3).tv_nsec >= NANSECOND_CONST)\
     {\
-    (T3).tv_sec += (T3).tv_nsec / 1000000000;\
-    (T3).tv_nsec = (T3).tv_nsec % 1000000000;\
+    (T3).tv_sec += (T3).tv_nsec / NANSECOND_CONST;\
+    (T3).tv_nsec = (T3).tv_nsec % NANSECOND_CONST;\
     }\
 } while(0)
 
@@ -133,10 +150,10 @@ do \
 {\
   (T2).tv_sec  = (T1).tv_sec  * (FLOAT);  \
   (T2).tv_nsec = (T1).tv_nsec * (FLOAT);  \
-  if((T2).tv_nsec >= 1000000000)\
+  if((T2).tv_nsec >= NANSECOND_CONST)\
     {\
-    (T2).tv_sec += (T2).tv_nsec / 1000000000;\
-    (T2).tv_nsec = (T2).tv_nsec % 1000000000;\
+    (T2).tv_sec += (T2).tv_nsec / NANSECOND_CONST;\
+    (T2).tv_nsec = (T2).tv_nsec % NANSECOND_CONST;\
     }\
 } while(0)
 
This page took 0.02378 seconds and 4 git commands to generate.