From 6bdc17d9a69bdd736901b115841479f5782a510e Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Tue, 13 Jul 2010 23:23:38 +0200 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- graph.c | 13 +------------ graph.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/graph.c b/graph.c index ac7c60540..47397daca 100644 --- a/graph.c +++ b/graph.c @@ -7,17 +7,6 @@ /* Internal API */ -/* - * Output the next line for a graph. - * This formats the next graph line into the specified strbuf. It is not - * terminated with a newline. - * - * Returns 1 if the line includes the current commit, and 0 otherwise. - * graph_next_line() will return 1 exactly once for each time - * graph_update() is called. - */ -static int graph_next_line(struct git_graph *graph, struct strbuf *sb); - /* * Output a padding line in the graph. * 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 graph_update_state(graph, GRAPH_PADDING); } -static int graph_next_line(struct git_graph *graph, struct strbuf *sb) +int graph_next_line(struct git_graph *graph, struct strbuf *sb) { switch (graph->state) { case GRAPH_PADDING: diff --git a/graph.h b/graph.h index b82ae87a4..f18816815 100644 --- a/graph.h +++ b/graph.h @@ -32,6 +32,17 @@ void graph_update(struct git_graph *graph, struct commit *commit); */ int graph_is_commit_finished(struct git_graph const *graph); +/* + * Output the next line for a graph. + * This formats the next graph line into the specified strbuf. It is not + * terminated with a newline. + * + * Returns 1 if the line includes the current commit, and 0 otherwise. + * graph_next_line() will return 1 exactly once for each time + * graph_update() is called. + */ +int graph_next_line(struct git_graph *graph, struct strbuf *sb); + /* * graph_show_*: helper functions for printing to stdout -- 2.26.2