actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/print.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_PRINT_H
26#define ACTF_PRINT_H
27
28#include <stdio.h>
29
30#include "event.h"
31#include "types.h"
32
33
36
64
66#define ACTF_PRINT_ALL (ACTF_PRINT_PKT_HEADER | ACTF_PRINT_PKT_CTX | \
67 ACTF_PRINT_EVENT_HEADER | ACTF_PRINT_EVENT_COMMON_CTX | \
68 ACTF_PRINT_EVENT_SPECIFIC_CTX | ACTF_PRINT_EVENT_PAYLOAD)
69
85
91
99
107int actf_fprint_fld(actf_printer *p, FILE *stream, const actf_fld *fld);
108
116
124int actf_fprint_event(actf_printer *p, FILE *stream, const actf_event *ev);
125
126#endif /* ACTF_PRINT_H */
Event related methods.
struct actf_event actf_event
An event.
Definition event.h:35
int actf_fprint_event(actf_printer *p, FILE *stream, const actf_event *ev)
Print an event to a stream.
actf_printer_flags
Printer flags.
Definition print.h:38
@ ACTF_PRINT_PKT_CTX
Print packet context.
Definition print.h:42
@ ACTF_PRINT_EVENT_PAYLOAD
Print event payload.
Definition print.h:50
@ ACTF_PRINT_PROP_LABELS
Print property labels of packets and events.
Definition print.h:52
@ ACTF_PRINT_TSTAMP_CC
Print the timestamp in cycles.
Definition print.h:56
@ ACTF_PRINT_TSTAMP_SEC
Print the timestamp in seconds.nanoseconds.
Definition print.h:62
@ ACTF_PRINT_TSTAMP_DATE
Print the full date with the timestamp.
Definition print.h:60
@ ACTF_PRINT_EVENT_COMMON_CTX
Print event common context.
Definition print.h:46
@ ACTF_PRINT_TSTAMP_DELTA
Print a timestamp delta for events.
Definition print.h:54
@ ACTF_PRINT_EVENT_HEADER
Print event header.
Definition print.h:44
@ ACTF_PRINT_PKT_HEADER
Print packet header.
Definition print.h:40
@ ACTF_PRINT_TSTAMP_UTC
Print the timestamp in UTC (default is localtime).
Definition print.h:58
@ ACTF_PRINT_EVENT_SPECIFIC_CTX
Print event specific context.
Definition print.h:48
int actf_print_fld(actf_printer *p, const actf_fld *fld)
Print a field to stdout.
int actf_fprint_fld(actf_printer *p, FILE *stream, const actf_fld *fld)
Print a field to a stream.
actf_printer * actf_printer_init(int flags)
Initialize a printer with provided flags.
int actf_print_event(actf_printer *p, const actf_event *ev)
Print an event to stdout.
struct actf_printer actf_printer
A printer.
Definition print.h:35
void actf_printer_free(actf_printer *p)
Free a printer.
Basic types used by ACTF.
struct actf_fld actf_fld
A field.
Definition types.h:91