4 /*****************************************************************************
6 * ltt_event_position_get : get the event position data
8 * e : an instance of an event type
9 * ep : a pointer to event's position structure
10 * tf : tracefile pointer
11 * block : current block
12 * offset : current offset
14 ****************************************************************************/
15 void ltt_event_position_get(LttEventPosition
*ep
, LttTracefile
**tf
,
16 guint
*block
, guint
*offset
, guint64
*tsc
)
25 void ltt_event_position_set(LttEventPosition
*ep
, LttTracefile
*tf
,
26 guint block
, guint offset
, guint64 tsc
)
35 /*****************************************************************************
37 * ltt_event_position : get the event's position
39 * e : an instance of an event type
40 * ep : a pointer to event's position structure
41 ****************************************************************************/
43 void ltt_event_position(LttEvent
*e
, LttEventPosition
*ep
)
45 ep
->tracefile
= e
->tracefile
;
47 ep
->offset
= e
->offset
;
51 LttEventPosition
* ltt_event_position_new()
53 return g_new(LttEventPosition
, 1);
57 /*****************************************************************************
59 * ltt_event_position_compare : compare two positions
60 * A NULL value is infinite.
62 * ep1 : a pointer to event's position structure
63 * ep2 : a pointer to event's position structure
68 ****************************************************************************/
71 gint
ltt_event_position_compare(const LttEventPosition
*ep1
,
72 const LttEventPosition
*ep2
)
74 if(ep1
== NULL
&& ep2
== NULL
)
76 if(ep1
!= NULL
&& ep2
== NULL
)
78 if(ep1
== NULL
&& ep2
!= NULL
)
81 if(ep1
->tracefile
!= ep2
->tracefile
)
82 g_error("ltt_event_position_compare on different tracefiles makes no sense");
84 if(ep1
->block
< ep2
->block
)
86 if(ep1
->block
> ep2
->block
)
88 if(ep1
->offset
< ep2
->offset
)
90 if(ep1
->offset
> ep2
->offset
)
95 /*****************************************************************************
97 * ltt_event_position_copy : copy position
99 * src : a pointer to event's position structure source
100 * dest : a pointer to event's position structure dest
103 ****************************************************************************/
104 void ltt_event_position_copy(LttEventPosition
*dest
,
105 const LttEventPosition
*src
)
115 LttTracefile
*ltt_event_position_tracefile(LttEventPosition
*ep
)
117 return ep
->tracefile
;
This page took 0.033437 seconds and 5 git commands to generate.