[RFC v2 1/4] svndump: move struct definitions to .h
From: Florian Achleitner <hidden>
Date: 2016-06-15 22:54:35
Subsystem:
the rest · Maintainer:
Linus Torvalds
This is a preparation for adding branch detection code in separate .c files. External branch detection functions will need to use these. Signed-off-by: Florian Achleitner <redacted> Signed-off-by: Junio C Hamano <redacted> --- vcs-svn/svndump.c | 21 ++++----------------- vcs-svn/svndump.h | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 31d1d83..6ca94de 100644
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c@@ -38,23 +38,10 @@ static struct line_buffer input = LINE_BUFFER_INIT; -static struct { - uint32_t action, srcRev, type; - off_t prop_length, text_length; - struct strbuf src, dst; - uint32_t text_delta, prop_delta; -} node_ctx; - -static struct { - uint32_t revision; - unsigned long timestamp; - struct strbuf log, author, note; -} rev_ctx; - -static struct { - uint32_t version; - struct strbuf uuid, url; -} dump_ctx; +static struct node_ctx_t node_ctx; +static struct rev_ctx_t rev_ctx; +static struct dump_ctx_t dump_ctx; + static void reset_node_ctx(char *fname) {
diff --git a/vcs-svn/svndump.h b/vcs-svn/svndump.h
index b8eb129..d545453 100644
--- a/vcs-svn/svndump.h
+++ b/vcs-svn/svndump.h@@ -1,5 +1,6 @@ #ifndef SVNDUMP_H_ #define SVNDUMP_H_ +#include "cache.h" int svndump_init(const char *filename); int svndump_init_fd(int in_fd, int back_fd);
@@ -7,4 +8,22 @@ void svndump_read(const char *url, const char *local_ref, const char *notes_ref) void svndump_deinit(void); void svndump_reset(void); +struct node_ctx_t { + uint32_t action, srcRev, type; + off_t prop_length, text_length; + struct strbuf src, dst; + uint32_t text_delta, prop_delta; +}; + +struct rev_ctx_t { + uint32_t revision; + unsigned long timestamp; + struct strbuf log, author, note; +}; + +struct dump_ctx_t { + uint32_t version; + struct strbuf uuid, url; +}; + #endif
--
1.7.9.5