]> sjero.net Git - wget/blobdiff - src/retr.c
[svn] Move extern declarations to .h files.
[wget] / src / retr.c
index 6fed26a1e5405bc92918fa34011bfd888389f196..450619360b639bdac49a4353a7c8a52ee32e01e0 100644 (file)
@@ -45,6 +45,7 @@ so, delete this exception statement from your version.  */
 #include "url.h"
 #include "recur.h"
 #include "ftp.h"
+#include "http.h"
 #include "host.h"
 #include "connect.h"
 #include "hash.h"
@@ -54,6 +55,9 @@ so, delete this exception statement from your version.  */
 /* Total size of downloaded files.  Used to enforce quota.  */
 SUM_SIZE_INT total_downloaded_bytes;
 
+/* Total download time in milliseconds. */
+double total_download_time;
+
 /* If non-NULL, the stream to which output should be written.  This
    stream is initialized when `-O' is used.  */
 FILE *output_stream;
@@ -495,18 +499,18 @@ fd_read_line (int fd)
   return fd_read_hunk (fd, line_terminator, 128, FD_READ_LINE_MAX);
 }
 \f
-/* Return a printed representation of the download rate, as
-   appropriate for the speed.  If PAD is true, strings will be padded
-   to the width of 7 characters (xxxx.xx).  */
-char *
-retr_rate (wgint bytes, double msecs, bool pad)
+/* Return a printed representation of the download rate, along with
+   the units appropriate for the download speed.  */
+
+const char *
+retr_rate (wgint bytes, double msecs)
 {
   static char res[20];
   static const char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s" };
   int units = 0;
 
   double dlrate = calc_rate (bytes, msecs, &units);
-  sprintf (res, pad ? "%7.2f %s" : "%.2f %s", dlrate, rate_names[units]);
+  sprintf (res, "%.2f %s", dlrate, rate_names[units]);
 
   return res;
 }