|
actf 0.0.1
An acute CTF reader
|
Event generator API. More...
Go to the source code of this file.
Data Structures | |
| struct | actf_event_generator |
| An event generator. More... | |
Macros | |
| #define | ACTF_DEFAULT_EVS_CAP 64 |
| The default capacity of an event array. | |
Typedefs | |
| typedef int(* | actf_event_generate) (void *self, actf_event ***evs, size_t *evs_len) |
| Generate events. | |
| typedef int(* | actf_seek_ns_from_origin) (void *self, int64_t tstamp) |
| Seek to the specified timestamp in the event stream. | |
| typedef const char *(* | actf_last_error) (void *self) |
| Get the last error message of a generator function. | |
Functions | |
| actf_event ** | actf_event_arr_alloc (size_t evs_cap) |
| Allocate an event array with provided capacity. | |
| void | actf_event_arr_free (actf_event **evs) |
| Free an event array. | |
Event generator API.
Event generators are the basic building blocks of actf that are hooked together to produce events, combine generators or perform filtering on events.
| #define ACTF_DEFAULT_EVS_CAP 64 |
The default capacity of an event array.
Napkin math for 32 data stream files:
| typedef int(* actf_event_generate) (void *self, actf_event ***evs, size_t *evs_len) |
Generate events.
A generator will write events up to its event capacity and provide a pointer to the array holding them. An actf_event_generate() must not return both events and an error code. On error, any valid events should be returned and then on the next call, the error is returned.
The generator owns the events and any returned events (or their fields) are invalid after the next actf_event_generate() call.
| self | the generator's self parameter |
| evs | a pointer to be populated with an event array |
| evs_len | a pointer to be populated with the number of events in the event array |
| typedef int(* actf_seek_ns_from_origin) (void *self, int64_t tstamp) |
Seek to the specified timestamp in the event stream.
Any events previously returned by an actf_event_generate() are invalid after calling this.
| self | the generator's self parameter |
| tstamp | the nanosecond from origin timestamp to seek to |
| typedef const char *(* actf_last_error) (void *self) |
Get the last error message of a generator function.
A failing generator function can store the most recent error and return it through this function. The returned string is handled internally, should not be freed, and might be overwritten or freed on subsequent API calls.
| self | the generator's self parameter |
| actf_event ** actf_event_arr_alloc | ( | size_t | evs_cap | ) |
Allocate an event array with provided capacity.
| evs_cap | the event capacity |
| void actf_event_arr_free | ( | actf_event ** | evs | ) |
Free an event array.
| evs | the event array |