Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lcm_eventlog_read_prev_event #39

Closed
wants to merge 2 commits into from
Closed

Conversation

cohensh
Copy link

@cohensh cohensh commented Oct 30, 2015

This creates an eventlog function lcm_eventlog_read_prev_event for iterating backwards through an lcm_eventlog_t.

As part of this I pulled out common code between read_next and read_prev into a helper function.

I also fixed a bug in freeing memory during error checking that was previously in read_next_event, and is now in the helper function.

Similar to lcm_eventlog_read_next_event, events can now be iterated through backwards

As part of this, common functionality between lcm_eventlog_read_next_event
and the new lcm_eventlog_read_prev_event was pulled out into
a local helper function read_event_helper
In read_event_helper (which was previously code in lcm_eventlog_read_next_event)
le->data was free'd before it was calloc'd in error handling
@ashuang
Copy link
Member

ashuang commented Jan 2, 2017

Sorry for ignoring this for so long. The LCM log format is not designed for reading in reverse, and so this is not a feature I'd like to build into the API. Since the file pointer is exposed, my suggestion if you still want this functionality would be to add it to your own utility library.

@ashuang ashuang closed this Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants