summaryrefslogtreecommitdiff
path: root/src/filter.h
blob: 60a176f635584e8e1b1fc6035ae366cea40d3851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef FILTER_H
#define FILTER_H

#include "umbrella.h"

/*
 * filter_start  — spawn the unit's log_filter executable as a persistent
 *                 subprocess with stdin/stdout pipes. No-op if log_filter
 *                 is empty. Safe to call on every unit unconditionally.
 *
 * filter_apply  — write buf to the filter's stdin, read back the
 *                 transformed output into buf. Updates *len. If the filter
 *                 suppresses all output (returns 0 bytes), *len is set to 0.
 *                 Falls back to pass-through on timeout or error.
 *
 * filter_stop   — signal and close the filter subprocess for one unit.
 * filter_stop_all — stop filters for all loaded units.
 */

void filter_start(Unit *u);
void filter_apply(Unit *u, char *buf, int bufsize, int *len);
void filter_stop(Unit *u);
void filter_stop_all(void);

#endif /* FILTER_H */