2 Copyright (C) 2011 jeanfi@gmail.com
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30 static char *get_path(const char *dir, const char *file)
32 char *path = malloc(strlen(dir)+1+
40 strcat(path, ".html");
46 packages_to_html(struct package_stats **packages,
49 struct package_stats **cur;
50 struct package_stats *p;
57 path = get_path(dir, p->name);
58 generate_chart(path, p->name, p->name,
59 p->daily_download_totals);
67 ppa_to_html(const char *owner,
69 const char *package_status,
70 const char *output_dir)
73 struct ppa_stats *ppastats;
74 struct daily_download_total **totals;
76 ppastats = create_ppa_stats(owner, ppa, package_status);
77 totals = ppastats->daily_download_totals;
79 path = get_path(output_dir, "ppa");
80 generate_chart(path, "PPA Statistics", ppa, totals);
83 packages_to_html(ppastats->packages, output_dir);
85 ppa_stats_free(ppastats);