actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/event_generator.h
Go to the documentation of this file.
1/*
2 * This file is a part of ACTF.
3 *
4 * Copyright (C) 2024 Adam Wendelin <adwe live se>
5 *
6 * ACTF is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * ACTF is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 * Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with ACTF. If not, see
18 * <https://www.gnu.org/licenses/>.
19 */
20
29#ifndef ACTF_EVENT_GENERATOR_H
30#define ACTF_EVENT_GENERATOR_H
31
32#include <stdint.h>
33#include "event.h"
34
53typedef int (*actf_event_generate)(void *self, actf_event ***evs, size_t *evs_len);
54
65typedef int (*actf_seek_ns_from_origin)(void *self, int64_t tstamp);
66
78typedef const char *(*actf_last_error)(void *self);
79
90#define ACTF_DEFAULT_EVS_CAP 64
91
103
112
118
119#endif /* ACTF_EVENT_GENERATOR_H */
Event related methods.
struct actf_event actf_event
An event.
Definition event.h:35
actf_event ** actf_event_arr_alloc(size_t evs_cap)
Allocate an event array with provided capacity.
int(* actf_seek_ns_from_origin)(void *self, int64_t tstamp)
Seek to the specified timestamp in the event stream.
Definition event_generator.h:65
int(* actf_event_generate)(void *self, actf_event ***evs, size_t *evs_len)
Generate events.
Definition event_generator.h:53
void actf_event_arr_free(actf_event **evs)
Free an event array.
const char *(* actf_last_error)(void *self)
Get the last error message of a generator function.
Definition event_generator.h:78
An event generator.
Definition event_generator.h:93
actf_seek_ns_from_origin seek_ns_from_origin
See actf_seek_ns_from_origin().
Definition event_generator.h:97
actf_event_generate generate
See actf_event_generate().
Definition event_generator.h:95
actf_last_error last_error
See actf_last_error().
Definition event_generator.h:99
void * self
Opaque data, should be passed to the generator methods.
Definition event_generator.h:101