aboutsummaryrefslogtreecommitdiff
path: root/convert.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-20 12:59:01 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-26 16:47:15 -0700
commitd1bf0e08313927c269846476f99f59d878807371 (patch)
tree95e663dac5b12425914a4e3013cbfcdcb04180f9 /convert.h
parent23c7df6bdd13e3d99ca09b6a7655747cc29ccc41 (diff)
downloadgit-d1bf0e08313927c269846476f99f59d878807371.tar.gz
git-d1bf0e08313927c269846476f99f59d878807371.tar.xz
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>
Diffstat (limited to 'convert.h')
-rw-r--r--convert.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/convert.h b/convert.h
new file mode 100644
index 000000000..b1b4a382d
--- /dev/null
+++ b/convert.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011, Google Inc.
+ */
+#ifndef CONVERT_H
+#define CONVERT_H
+
+enum safe_crlf {
+ SAFE_CRLF_FALSE = 0,
+ SAFE_CRLF_FAIL = 1,
+ SAFE_CRLF_WARN = 2
+};
+
+extern enum safe_crlf safe_crlf;
+
+enum auto_crlf {
+ AUTO_CRLF_FALSE = 0,
+ AUTO_CRLF_TRUE = 1,
+ AUTO_CRLF_INPUT = -1
+};
+
+extern enum auto_crlf auto_crlf;
+
+enum eol {
+ EOL_UNSET,
+ EOL_CRLF,
+ EOL_LF,
+#ifdef NATIVE_CRLF
+ EOL_NATIVE = EOL_CRLF
+#else
+ EOL_NATIVE = EOL_LF
+#endif
+};
+
+extern enum eol core_eol;
+
+/* returns 1 if *dst was used */
+extern int convert_to_git(const char *path, const char *src, size_t len,
+ struct strbuf *dst, enum safe_crlf checksafe);
+extern int convert_to_working_tree(const char *path, const char *src,
+ size_t len, struct strbuf *dst);
+extern int renormalize_buffer(const char *path, const char *src, size_t len,
+ struct strbuf *dst);
+extern int can_bypass_conversion(const char *path);
+#endif /* CONVERT_H */