* Made ThrottleNode an object held by PCB, rather than ThrottleList

which now holds ThrottleNode*. Moved Rate from PCB to ThrottleNode.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@596 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-11-14 15:42:13 +00:00
parent a97408328a
commit e8deac9f79
6 changed files with 50 additions and 50 deletions
+32 -24
View File
@@ -59,6 +59,30 @@ print_string(char* buf, unsigned int length, char* str) {
return buf;
}
char*
print_hhmmss(char* buf, unsigned int length, time_t t) {
std::tm *u = std::localtime(&t);
if (u == NULL)
return "inv_time";
unsigned int s = snprintf(buf, length, "%02u:%02u:%02u", u->tm_hour, u->tm_min, u->tm_sec);
return buf + std::min(s, length);
}
char*
print_ddmmyyyy(char* buf, unsigned int length, time_t t) {
std::tm *u = std::gmtime(&t);
if (u == NULL)
return "inv_time";
unsigned int s = snprintf(buf, length, "%02u/%02u/%04u", u->tm_mday, (u->tm_mon + 1), (1900 + u->tm_year));
return buf + std::min(s, length);
}
char*
print_download_title(char* buf, unsigned int length, core::Download* d) {
return buf + std::max(0, snprintf(buf, length, "%s",
@@ -82,9 +106,9 @@ print_download_info(char* buf, unsigned int length, core::Download* d) {
(double)d->get_download().bytes_total() / (double)(1 << 20)));
buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KB Uploaded: %.1f MB",
(double)d->get_download().up_rate().rate() / (1 << 10),
(double)d->get_download().down_rate().rate() / (1 << 10),
(double)d->get_download().up_rate().total() / (1 << 20)));
(double)d->get_download().up_rate()->rate() / (1 << 10),
(double)d->get_download().down_rate()->rate() / (1 << 10),
(double)d->get_download().up_rate()->total() / (1 << 20)));
return buf;
}
@@ -113,28 +137,12 @@ print_download_status(char* buf, unsigned int length, core::Download* d) {
return buf;
}
char*
print_hhmmss(char* buf, unsigned int length, time_t t) {
std::tm *u = std::localtime(&t);
// char*
// print_entry_tags(char* buf, unsigned int length) {
if (u == NULL)
return "inv_time";
// }
unsigned int s = snprintf(buf, length, "%02u:%02u:%02u", u->tm_hour, u->tm_min, u->tm_sec);
return buf + std::min(s, length);
}
char*
print_ddmmyyyy(char* buf, unsigned int length, time_t t) {
std::tm *u = std::gmtime(&t);
if (u == NULL)
return "inv_time";
unsigned int s = snprintf(buf, length, "%02u/%02u/%04u", u->tm_mday, (u->tm_mon + 1), (1900 + u->tm_year));
return buf + std::min(s, length);
}
// char*
// print_entry_file(char* buf, unsigned int length, const torrent::Entry& entry);
}