Make graph_next_line() available in the graph.h API
In order to successfully use the graph API from a context other than the stdout/command-line scenario (where the graph_show_* functions are suitable), we need direct access to graph_next_line(), to drive the graph drawing process. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johan Herland committed
Jul 13, 2010 at 23:23 UTC
6bdc17d9a69bdd736901b115841479f5782a510e
2 files changed
+12
-12
graph.c
+1
-12
@@ -7,17 +7,6 @@
7
8
/* Internal API */
9
10
-/*
11
- * Output the next line for a graph.
12
- * This formats the next graph line into the specified strbuf. It is not
13
- * terminated with a newline.
14
- *
15
- * Returns 1 if the line includes the current commit, and 0 otherwise.
16
- * graph_next_line() will return 1 exactly once for each time
17
- * graph_update() is called.
18
- */
19
-static int graph_next_line(struct git_graph *graph, struct strbuf *sb);
20
-
10
/*
11
* Output a padding line in the graph.
12
* This is similar to graph_next_line(). However, it is guaranteed to
@@ -1143,7 +1132,7 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf
1132
graph_update_state(graph, GRAPH_PADDING);
1133
}
1134
1146
-static int graph_next_line(struct git_graph *graph, struct strbuf *sb)
1135
+int graph_next_line(struct git_graph *graph, struct strbuf *sb)
1136
{
1137
switch (graph->state) {
1138
case GRAPH_PADDING:
graph.h
+11
@@ -32,6 +32,17 @@ void graph_update(struct git_graph *graph, struct commit *commit);
32
*/
33
int graph_is_commit_finished(struct git_graph const *graph);
34
35
+/*
36
+ * Output the next line for a graph.
37
+ * This formats the next graph line into the specified strbuf. It is not
38
+ * terminated with a newline.
39
+ *
40
+ * Returns 1 if the line includes the current commit, and 0 otherwise.
41
+ * graph_next_line() will return 1 exactly once for each time
42
+ * graph_update() is called.
43
+ */
44
+int graph_next_line(struct git_graph *graph, struct strbuf *sb);
45
+
46
47
/*
48
* graph_show_*: helper functions for printing to stdout