actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/filter.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
25#ifndef ACTF_FILTER_H
26#define ACTF_FILTER_H
27
28#include <stdbool.h>
29#include <stdint.h>
30
31#include "decoder.h"
32#include "event_generator.h"
33
35typedef struct actf_filter actf_filter;
36
41 int64_t begin;
47 int64_t end;
51};
52
55#define ACTF_FILTER_TIME_RANGE_ALL (struct actf_filter_time_range) \
56 {.begin = INT64_MIN, .begin_has_date = true, .end = INT64_MAX, .end_has_date = true};
57
66
68int actf_filter_filter(actf_filter *f, actf_event ***evs, size_t *evs_len);
69
72
75
81
92
93#endif /* ACTF_FILTER_H */
A CTF2 decoder and its methods.
struct actf_event actf_event
An event.
Definition event.h:35
Event generator API.
int actf_filter_filter(actf_filter *f, actf_event ***evs, size_t *evs_len)
struct actf_event_generator actf_filter_to_generator(actf_filter *f)
Create an event generator based on a filter.
struct actf_filter actf_filter
A time-based event filter, implements an actf_event_generator.
Definition filter.h:35
actf_filter * actf_filter_init(struct actf_event_generator gen, struct actf_filter_time_range range)
Initialize a filter.
int actf_filter_seek_ns_from_origin(actf_filter *f, int64_t tstamp)
void actf_filter_free(actf_filter *f)
Free a filter.
const char * actf_filter_last_error(actf_filter *f)
An event generator.
Definition event_generator.h:93
A time range filter.
Definition filter.h:38
bool begin_has_date
Whether the start time includes a date.
Definition filter.h:44
int64_t end
The (inclusive) end time of the filter in nanoseconds from origin.
Definition filter.h:47
bool end_has_date
Whether the end time includes a date.
Definition filter.h:50
int64_t begin
The (inclusive) start time of the filter in nanoseconds from origin.
Definition filter.h:41