From b61dcfdbff02236740aa461bc6b7ed43d321ed05 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 19 Nov 2007 20:07:21 +0000 Subject: [PATCH] add "this session" stats stubs for BentMyWookie --- libtransmission/transmission.c | 8 +++++++- libtransmission/transmission.h | 13 ++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/libtransmission/transmission.c b/libtransmission/transmission.c index a4fceeb02..07e8e8371 100644 --- a/libtransmission/transmission.c +++ b/libtransmission/transmission.c @@ -341,7 +341,7 @@ tr_close( tr_handle * h ) } void -tr_getGlobalStats( const tr_handle * handle, tr_global_stats * setme ) +tr_getSessionStats( const tr_handle * handle, tr_session_stats * setme ) { assert( handle != NULL ); assert( setme != NULL ); @@ -357,6 +357,12 @@ tr_getGlobalStats( const tr_handle * handle, tr_global_stats * setme ) setme->secondsActive = 2112; } +void +tr_getAccumulatedStats( const tr_handle * handle, tr_session_stats * setme ) +{ + tr_getSessionStats( handle, setme ); +} + tr_torrent ** tr_loadTorrents ( tr_handle * h, const char * fallbackDestination, diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 4c17e9055..16346653d 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -116,7 +116,7 @@ void tr_close( tr_handle * ); *** **/ -typedef struct tr_global_stats +typedef struct tr_session_stats { uint64_t downloadedGigs; /* total down / GiB */ uint64_t downloadedBytes; /* total down % GiB */ @@ -127,9 +127,16 @@ typedef struct tr_global_stats uint64_t sessionCount; /* program started N times */ uint64_t secondsActive; /* how long Transmisson's been running */ } -tr_global_stats; +tr_session_stats; -void tr_getGlobalStats( const tr_handle * handle, tr_global_stats * setme ); +/* stats accumulated across all the times that Transmission's been used. */ +void tr_getCumulativeSessionStats( const tr_handle * handle, + tr_session_stats * setme ); + +/* stats accumulated during this current session. + 'sessionCount' is pretty useless here, eh? :) */ +void tr_getSessionStats( const tr_handle * handle, + tr_session_stats * setme ); /**