From: Florian Forster Date: Mon, 21 Jun 2010 13:26:16 +0000 (+0200) Subject: "list graphs" action: Limit the number of graphs and instances separately. X-Git-Tag: v4.0.0~209 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=29ed9845a482b6eb5b4ced51fef43129be0e2fd3;p=collection4.git "list graphs" action: Limit the number of graphs and instances separately. --- diff --git a/src/action_list_graphs.c b/src/action_list_graphs.c index 7c8768a..e32b999 100644 --- a/src/action_list_graphs.c +++ b/src/action_list_graphs.c @@ -18,8 +18,12 @@ struct callback_data_s { graph_config_t *cfg; - int limit; - _Bool first; + int graph_index; + int graph_limit; + _Bool graph_more; + int inst_index; + int inst_limit; + _Bool inst_more; }; typedef struct callback_data_s callback_data_t; @@ -33,6 +37,13 @@ static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */ if (data->cfg != cfg) { + data->graph_index++; + if (data->graph_index >= data->graph_limit) + { + data->graph_more = 1; + return (1); + } + if (data->cfg != NULL) printf (" \n"); @@ -44,6 +55,19 @@ static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */ " \n"); + if (cb_data.graph_more) + { + printf ("
  • More ...
  • \n"); + } + printf (" \n"); return (0);