aboutsummaryrefslogtreecommitdiff
path: root/vcs-svn/line_buffer.h
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-10-10 21:39:21 -0500
committerJonathan Nieder <jrnieder@gmail.com>2011-02-26 04:57:58 -0600
commitd350822fa7d14052713bea0ec62ff1246d8a2f7a (patch)
tree69c814ce03a8fe219de028f7b6459f700bfae437 /vcs-svn/line_buffer.h
parentdeadcef4c15d54d0a397180a1783ae8939254188 (diff)
downloadgit-d350822fa7d14052713bea0ec62ff1246d8a2f7a.tar.gz
git-d350822fa7d14052713bea0ec62ff1246d8a2f7a.tar.xz
vcs-svn: collect line_buffer data in a struct
Prepare for the line_buffer lib to support input from multiple files, by collecting global state in a struct that can be easily passed around. No API change yet. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'vcs-svn/line_buffer.h')
-rw-r--r--vcs-svn/line_buffer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcs-svn/line_buffer.h b/vcs-svn/line_buffer.h
index 9c78ae11a..4ae1133a9 100644
--- a/vcs-svn/line_buffer.h
+++ b/vcs-svn/line_buffer.h
@@ -1,6 +1,17 @@
#ifndef LINE_BUFFER_H_
#define LINE_BUFFER_H_
+#include "strbuf.h"
+
+#define LINE_BUFFER_LEN 10000
+
+struct line_buffer {
+ char line_buffer[LINE_BUFFER_LEN];
+ struct strbuf blob_buffer;
+ FILE *infile;
+};
+#define LINE_BUFFER_INIT {"", STRBUF_INIT, NULL}
+
int buffer_init(const char *filename);
int buffer_deinit(void);
char *buffer_read_line(void);