From: Joel Rosdahl Date: Thu, 15 Jul 2010 14:57:12 +0000 (+0200) Subject: Add stats_get_pending() function X-Git-Tag: v3.1~180^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=117e0c6e3af83fcd1ec9665d2088fe2e2702ab05;p=thirdparty%2Fccache.git Add stats_get_pending() function --- diff --git a/ccache.h b/ccache.h index 5c155f06a..b3febfb53 100644 --- a/ccache.h +++ b/ccache.h @@ -111,6 +111,7 @@ void update_mtime(const char *path); void stats_update(enum stats stat); void stats_flush(void); +unsigned stats_get_pending(enum stats stat); void stats_zero(void); void stats_summary(void); void stats_update_size(enum stats stat, size_t size, unsigned files); diff --git a/stats.c b/stats.c index b77794c37..aeb3ff032 100644 --- a/stats.c +++ b/stats.c @@ -221,6 +221,12 @@ void stats_update(enum stats stat) stats_update_size(stat, 0, 0); } +/* Get the pending update a counter value. */ +unsigned stats_get_pending(enum stats stat) +{ + return counter_updates[stat]; +} + /* read in the stats from one dir and add to the counters */ void stats_read(const char *stats_file, unsigned counters[STATS_END]) {