* Added the framework for a download scheduler.

* Added "state_changed" variable to downloads that returns the last
time the download called DownloadList::pause/resume.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@674 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-04-25 19:33:53 +00:00
parent 19179bd160
commit c5c9a1ddae
20 changed files with 339 additions and 45 deletions
+12 -2
View File
@@ -55,21 +55,31 @@ namespace display {
char*
print_string(char* first, char* last, char* str) {
if (first == last)
return first;
// We don't have any nice simple functions for copying strings that
// return the end address.
while (first != last && *str != '\0')
while (first + 1 != last && *str != '\0')
*(first++) = *(str++);
*first = '\0';
return first;
}
char*
print_hhmmss(char* first, char* last, time_t t) {
return print_buffer(first, last, "%2d:%02d:%02d", (int)t / 3600, ((int)t / 60) % 60, (int)t % 60);
}
char*
print_hhmmss_local(char* first, char* last, time_t t) {
std::tm *u = std::localtime(&t);
if (u == NULL)
//return "inv_time";
throw torrent::internal_error("print_hhmmss(...) failed.");
throw torrent::internal_error("print_hhmmss_local(...) failed.");
return print_buffer(first, last, "%2u:%02u:%02u", u->tm_hour, u->tm_min, u->tm_sec);
}