blob: 3479732a2bd2264fa9d6c89bf481af7754c43e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * The statistics page, which counts commits per author over a window of
 * recent weeks, months, quarters or years, and the period lookups that cgit.c
 * resolves a max-stats setting with.
 */

#ifndef CGIT_UI_STATS_H
#define CGIT_UI_STATS_H

struct cgit_period;

/*
 * Look a period up by its one letter code or by its full name, storing the
 * match through period when that is not NULL. The return is a one based index
 * into the table of periods, or 0 when nothing matches, and because that
 * table runs from the finest window to the coarsest, the index is what
 * max-stats is compared against.
 */
extern int cgit_find_stats_period(const char *expr, const struct cgit_period **period);

/*
 * The name of the period at a one based index, or an empty string when the
 * index names no period.
 */
extern const char *cgit_find_stats_periodname(int idx);

extern void cgit_show_stats(void);

#endif // CGIT_UI_STATS_H