return p;
}
+static struct version_stats *version_stats_new(const char *version)
+{
+ struct version_stats *v;
+
+ v = malloc(sizeof(struct version_stats));
+ v->version = strdup(version);
+ v->distros = NULL;
+ v->download_count = 0;
+ v->daily_download_totals = NULL;
+ v->date_created = 0;
+
+ return v;
+}
+
static struct version_stats *get_version_stats(struct package_stats *package,
const char *version)
{
cur++;
}
- v = malloc(sizeof(struct version_stats));
- v->version = strdup(version);
- v->distros = NULL;
- v->download_count = 0;
- v->daily_download_totals = NULL;
+ v = version_stats_new(version);
tmp = (struct version_stats **)list_add((void **)package->versions,
v);
pkg->daily_download_totals = tmp;
version = get_version_stats(pkg, pkg_version);
+ version->date_created = h->date_created;
+
version->download_count += count;
tmp = add_totals(version->daily_download_totals, totals);
if (version->daily_download_totals != tmp)