Sixth batch
[git/git.git] / trace2 / tr2_dst.h
CommitLineData
ee4512ed
JH
1#ifndef TR2_DST_H
2#define TR2_DST_H
3
4struct strbuf;
bce9db6d 5#include "trace2/tr2_sysenv.h"
ee4512ed
JH
6
7struct tr2_dst {
bce9db6d 8 enum tr2_sysenv_variable sysenv_var;
ee4512ed
JH
9 int fd;
10 unsigned int initialized : 1;
11 unsigned int need_close : 1;
12};
13
14/*
15 * Disable TRACE2 on the destination. In TRACE2 a destination (DST)
16 * wraps a file descriptor; it is associated with a TARGET which
17 * defines the formatting.
18 */
19void tr2_dst_trace_disable(struct tr2_dst *dst);
20
21/*
22 * Return the file descriptor for the DST.
23 * If 0, the dst is closed or disabled.
24 */
25int tr2_dst_get_trace_fd(struct tr2_dst *dst);
26
27/*
28 * Return true if the DST is opened for writing.
29 */
30int tr2_dst_trace_want(struct tr2_dst *dst);
31
32/*
33 * Write a single line/message to the trace file.
34 */
35void tr2_dst_write_line(struct tr2_dst *dst, struct strbuf *buf_line);
36
37#endif /* TR2_DST_H */