b4800e7461644e367cc4975fd6ee9f02ae13c20a
1#ifndef TRACE_H
2#define TRACE_H
3
4#include "git-compat-util.h"
5#include "strbuf.h"
6
7struct trace_key {
8 const char * const key;
9 int fd;
10 unsigned int initialized : 1;
11 unsigned int need_close : 1;
12};
13
14#define TRACE_KEY_INIT(name) { "GIT_TRACE_" #name, 0, 0, 0 }
15
16extern void trace_repo_setup(const char *prefix);
17extern int trace_want(struct trace_key *key);
18extern void trace_disable(struct trace_key *key);
19
20__attribute__((format (printf, 1, 2)))
21extern void trace_printf(const char *format, ...);
22
23__attribute__((format (printf, 2, 3)))
24extern void trace_printf_key(struct trace_key *key, const char *format, ...);
25
26__attribute__((format (printf, 2, 3)))
27extern void trace_argv_printf(const char **argv, const char *format, ...);
28
29extern void trace_strbuf(struct trace_key *key, const struct strbuf *data);
30
31#endif /* TRACE_H */