提交 d1bf0e08 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <gitster@pobox.com>
上级 23c7df6b
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "hash.h" #include "hash.h"
#include "advice.h" #include "advice.h"
#include "gettext.h" #include "gettext.h"
#include "convert.h"
#include SHA1_HEADER #include SHA1_HEADER
#ifndef git_SHA_CTX #ifndef git_SHA_CTX
...@@ -582,35 +583,6 @@ extern int fsync_object_files; ...@@ -582,35 +583,6 @@ extern int fsync_object_files;
extern int core_preload_index; extern int core_preload_index;
extern int core_apply_sparse_checkout; extern int core_apply_sparse_checkout;
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;
enum branch_track { enum branch_track {
BRANCH_TRACK_UNSPECIFIED = -1, BRANCH_TRACK_UNSPECIFIED = -1,
BRANCH_TRACK_NEVER = 0, BRANCH_TRACK_NEVER = 0,
...@@ -1153,14 +1125,6 @@ extern void trace_strbuf(const char *key, const struct strbuf *buf); ...@@ -1153,14 +1125,6 @@ extern void trace_strbuf(const char *key, const struct strbuf *buf);
void packet_trace_identity(const char *prog); void packet_trace_identity(const char *prog);
/* convert.c */
/* 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);
/* add */ /* add */
/* /*
* return 0 if success, 1 - if addition of a file failed and * return 0 if success, 1 - if addition of a file failed and
......
/*
* 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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册