/*****************************************************************************
* Function name
* ltt_event_position_compare : compare two positions
+ * A NULL value is infinite.
* Input params
* ep1 : a pointer to event's position structure
* ep2 : a pointer to event's position structure
{
if(ep1->tf != ep2->tf)
g_error("ltt_event_position_compare on different tracefiles makes no sense");
+ if(ep1 == NULL && ep2 == NULL)
+ return 0;
+ if(ep1 != NULL && ep2 == NULL)
+ return -1;
+ if(ep1 == NULL && ep2 != NULL)
+ return 1;
+
if(ep1->block_num < ep2->block_num)
return -1;
if(ep1->block_num > ep2->block_num)
gint ltt_event_event_position_compare(const LttEvent *event,
const LttEventPosition *ep)
{
- g_assert(event->tracefile == ep->tf);
+ if(event == NULL && ep == NULL)
+ return 0;
+ if(event != NULL && ep == NULL)
+ return -1;
+ if(event == NULL && ep != NULL)
+ return 1;
+ g_assert(event->tracefile == ep->tf);
+
if(event->which_block < ep->block_num)
return -1;
if(event->which_block > ep->block_num)
void ltt_event_position_copy(LttEventPosition *dest,
const LttEventPosition *src)
{
- *dest = *src;
+ if(src == NULL)
+ dest = NULL;
+ else
+ *dest = *src;
}
#ifndef LTT_TIME_H
#define LTT_TIME_H
+#include <glib.h>
+
typedef struct _LttTime {
unsigned long tv_sec;
static const LttTime ltt_time_zero = { 0, 0};
+static const LttTime ltt_time_infinite = { G_MAXUINT, G_MAXUINT };
static inline LttTime ltt_time_sub(LttTime t1, LttTime t2)
{
}
//get control tracefile info
-
+ getControlFileInfo(t,control);
+ /*
if(getControlFileInfo(t,control)) {
g_ptr_array_free(t->facilities, TRUE);
g_ptr_array_free(t->per_cpu_tracefiles, TRUE);
g_free(t->pathname);
g_free(t);
return NULL;
- }
+ }*/ // With fatal error
//get cpu tracefile info
if(getCpuFileInfo(t,cpu)) {