From: Julien Desfossez Date: Fri, 10 Feb 2012 02:32:52 +0000 (-0500) Subject: API : iterator get and set position X-Git-Tag: v0.11~12 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=90fcbacc6eb672f0d5e0c9d6722d397ac9f1a63e;hp=90fcbacc6eb672f0d5e0c9d6722d397ac9f1a63e API : iterator get and set position This patch implements the save and restore position on a iterator. Passed successfully these tests : - test 1: save the position read n events (tested with multiple values of n) restore compare the outputs - test 2: in loop until the end of the trace : save the position read 5 events restore the position read 5 events compare each block of 5 events - test 3: save the position before printing the first event parse the trace entirely restore to the beginning parse the trace entirely compare the 2 outputs - test 4: seek in the future (manually tweaked the values to restore to) compare with a normal trace starting from the restore point [ edit: use g_new/g_new0/g_free instead of malloc/calloc/free. Use g_new0 anytime a structure is not explicitly initialized by a helper, so if it grows in the future with new fields, they will be zeroed. ] Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers ---