summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b4281e)
raw | patch | inline | side by side (parent: 7b4281e)
author | Florian Forster <ff@octo.it> | |
Sat, 19 Jun 2010 08:19:15 +0000 (10:19 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 19 Jun 2010 08:19:15 +0000 (10:19 +0200) |
src/action_list_graphs.c | patch | blob | history |
index cb2e31de143a6e123b2fea81d75e1eb4337cdac3..b6fc0394fe439d5e1bd0f9dcfcdf793869f41fc3 100644 (file)
--- a/src/action_list_graphs.c
+++ b/src/action_list_graphs.c
struct callback_data_s
{
graph_config_t *cfg;
+ int limit;
};
typedef struct callback_data_s callback_data_t;
printf (" <li><a href=\"%s?action=graph;%s\">%s</a></li>\n",
script_name (), params, desc);
+ if (data->limit > 0)
+ data->limit--;
+
+ /* Abort scan if limit is reached. */
+ if (data->limit == 0)
+ return (1);
+
return (0);
} /* }}} int print_graph_inst_html */
static int list_graphs_html (const char *term) /* {{{ */
{
- callback_data_t data = { NULL };
+ callback_data_t data = { NULL, /* limit = */ 20 };
printf ("Content-Type: text/html\n\n");
printf ("<html>\n <head>\n");