convert.h: move declarations for conversion from cache.h
Before adding the streaming filter API to the conversion layer, move the existing declarations related to the conversion to its own header file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
May 20, 2011 at 12:59 UTC
d1bf0e08313927c269846476f99f59d878807371
2 files changed
+45
-37
cache.h
+1
-37
@@ -6,6 +6,7 @@
6
#include "hash.h"
7
#include "advice.h"
8
#include "gettext.h"
9
+#include "convert.h"
10
11
#include SHA1_HEADER
12
#ifndef git_SHA_CTX
@@ -582,35 +583,6 @@ extern int fsync_object_files;
583
extern int core_preload_index;
584
extern int core_apply_sparse_checkout;
585
585
-enum safe_crlf {
586
- SAFE_CRLF_FALSE = 0,
587
- SAFE_CRLF_FAIL = 1,
588
- SAFE_CRLF_WARN = 2
589
-};
590
-
591
-extern enum safe_crlf safe_crlf;
592
-
593
-enum auto_crlf {
594
- AUTO_CRLF_FALSE = 0,
595
- AUTO_CRLF_TRUE = 1,
596
- AUTO_CRLF_INPUT = -1
597
-};
598
-
599
-extern enum auto_crlf auto_crlf;
600
-
601
-enum eol {
602
- EOL_UNSET,
603
- EOL_CRLF,
604
- EOL_LF,
605
-#ifdef NATIVE_CRLF
606
- EOL_NATIVE = EOL_CRLF
607
-#else
608
- EOL_NATIVE = EOL_LF
609
-#endif
610
-};
611
-
612
-extern enum eol core_eol;
613
-
586
enum branch_track {
587
BRANCH_TRACK_UNSPECIFIED = -1,
588
BRANCH_TRACK_NEVER = 0,
@@ -1153,14 +1125,6 @@ extern void trace_strbuf(const char *key, const struct strbuf *buf);
1125
1126
void packet_trace_identity(const char *prog);
1127
1156
-/* convert.c */
1157
-/* returns 1 if *dst was used */
1158
-extern int convert_to_git(const char *path, const char *src, size_t len,
1159
- struct strbuf *dst, enum safe_crlf checksafe);
1160
-extern int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst);
1161
-extern int renormalize_buffer(const char *path, const char *src, size_t len, struct strbuf *dst);
1162
-extern int can_bypass_conversion(const char *path);
1163
-
1128
/* add */
1129
/*
1130
* return 0 if success, 1 - if addition of a file failed and
convert.h
new
+44
@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2011, Google Inc.
3
+ */
4
+#ifndef CONVERT_H
5
+#define CONVERT_H
6
+
7
+enum safe_crlf {
8
+ SAFE_CRLF_FALSE = 0,
9
+ SAFE_CRLF_FAIL = 1,
10
+ SAFE_CRLF_WARN = 2
11
+};
12
+
13
+extern enum safe_crlf safe_crlf;
14
+
15
+enum auto_crlf {
16
+ AUTO_CRLF_FALSE = 0,
17
+ AUTO_CRLF_TRUE = 1,
18
+ AUTO_CRLF_INPUT = -1
19
+};
20
+
21
+extern enum auto_crlf auto_crlf;
22
+
23
+enum eol {
24
+ EOL_UNSET,
25
+ EOL_CRLF,
26
+ EOL_LF,
27
+#ifdef NATIVE_CRLF
28
+ EOL_NATIVE = EOL_CRLF
29
+#else
30
+ EOL_NATIVE = EOL_LF
31
+#endif
32
+};
33
+
34
+extern enum eol core_eol;
35
+
36
+/* returns 1 if *dst was used */
37
+extern int convert_to_git(const char *path, const char *src, size_t len,
38
+ struct strbuf *dst, enum safe_crlf checksafe);
39
+extern int convert_to_working_tree(const char *path, const char *src,
40
+ size_t len, struct strbuf *dst);
41
+extern int renormalize_buffer(const char *path, const char *src, size_t len,
42
+ struct strbuf *dst);
43
+extern int can_bypass_conversion(const char *path);
44
+#endif /* CONVERT_H */