LCM
Loading...
Searching...
No Matches
eventlog.h
1#ifndef _LCM_EVENTLOG_H_
2#define _LCM_EVENTLOG_H_
3
4#include <stdio.h>
5#include <stdint.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#ifndef LCM_API_FUNCTION
12#ifdef WIN32
13#define LCM_API_FUNCTION __declspec(dllexport)
14#else
15#define LCM_API_FUNCTION
16#endif // WIN32
17#endif // LCM_API_FUNCTION
18
33typedef struct _lcm_eventlog_t lcm_eventlog_t;
35{
39 FILE *f;
40
44 int64_t eventcount;
45};
46
50typedef struct _lcm_eventlog_event_t lcm_eventlog_event_t;
56 int64_t eventnum;
61 int64_t timestamp;
65 int32_t channellen;
69 int32_t datalen;
70
74 char *channel;
78 void *data;
79};
80
89LCM_API_FUNCTION
90lcm_eventlog_t *lcm_eventlog_create(const char *path, const char *mode);
91
101LCM_API_FUNCTION
102lcm_eventlog_event_t *lcm_eventlog_read_next_event(lcm_eventlog_t *eventlog);
103
109LCM_API_FUNCTION
110void lcm_eventlog_free_event(lcm_eventlog_event_t *event);
111
120LCM_API_FUNCTION
121int lcm_eventlog_seek_to_timestamp(lcm_eventlog_t *eventlog, int64_t ts);
122
132LCM_API_FUNCTION
133int lcm_eventlog_write_event(lcm_eventlog_t *eventlog,
134 lcm_eventlog_event_t *event);
135
141LCM_API_FUNCTION
142void lcm_eventlog_destroy(lcm_eventlog_t *eventlog);
143
148#ifdef __cplusplus
149}
150#endif
151
152#endif
lcm_eventlog_t * lcm_eventlog_create(const char *path, const char *mode)
int lcm_eventlog_write_event(lcm_eventlog_t *eventlog, lcm_eventlog_event_t *event)
void lcm_eventlog_destroy(lcm_eventlog_t *eventlog)
lcm_eventlog_event_t * lcm_eventlog_read_next_event(lcm_eventlog_t *eventlog)
int lcm_eventlog_seek_to_timestamp(lcm_eventlog_t *eventlog, int64_t ts)
void lcm_eventlog_free_event(lcm_eventlog_event_t *event)
Definition eventlog.h:51
int64_t eventnum
Definition eventlog.h:56
char * channel
Definition eventlog.h:74
void * data
Definition eventlog.h:78
int64_t timestamp
Definition eventlog.h:61
int32_t channellen
Definition eventlog.h:65
int32_t datalen
Definition eventlog.h:69
Definition eventlog.h:35
int64_t eventcount
Definition eventlog.h:44
FILE * f
Definition eventlog.h:39