trace: move trace declarations from cache.h to new trace.h
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees committed
Jun 11, 2014 at 09:56 UTC
5991a55c545bca32fc4f5e69ee58de86563a93fa
2 files changed
+19
-11
cache.h
+2
-11
@@ -7,6 +7,7 @@
7
#include "advice.h"
8
#include "gettext.h"
9
#include "convert.h"
10
+#include "trace.h"
11
12
#include SHA1_HEADER
13
#ifndef git_SHA_CTX
@@ -1377,17 +1378,7 @@ extern void *alloc_tag_node(void);
1378
extern void *alloc_object_node(void);
1379
extern void alloc_report(void);
1380
1380
-/* trace.c */
1381
-__attribute__((format (printf, 1, 2)))
1382
-extern void trace_printf(const char *format, ...);
1383
-__attribute__((format (printf, 2, 3)))
1384
-extern void trace_argv_printf(const char **argv, const char *format, ...);
1385
-extern void trace_repo_setup(const char *prefix);
1386
-extern int trace_want(const char *key);
1387
-__attribute__((format (printf, 2, 3)))
1388
-extern void trace_printf_key(const char *key, const char *fmt, ...);
1389
-extern void trace_strbuf(const char *key, const struct strbuf *buf);
1390
-
1381
+/* pkt-line.c */
1382
void packet_trace_identity(const char *prog);
1383
1384
/* add */
trace.h
new
+17
@@ -0,0 +1,17 @@
1
+#ifndef TRACE_H
2
+#define TRACE_H
3
+
4
+#include "git-compat-util.h"
5
+#include "strbuf.h"
6
+
7
+__attribute__((format (printf, 1, 2)))
8
+extern void trace_printf(const char *format, ...);
9
+__attribute__((format (printf, 2, 3)))
10
+extern void trace_argv_printf(const char **argv, const char *format, ...);
11
+extern void trace_repo_setup(const char *prefix);
12
+extern int trace_want(const char *key);
13
+__attribute__((format (printf, 2, 3)))
14
+extern void trace_printf_key(const char *key, const char *fmt, ...);
15
+extern void trace_strbuf(const char *key, const struct strbuf *buf);
16
+
17
+#endif /* TRACE_H */