From 78c546d40cff285747ead9c15e5cb5b9496b7164 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 11 Jan 2001 18:21:13 +0000 Subject: - add FTP - add HTTP - use single place for mountpoints and static directories --- mdk-stage1/stdio-frontend.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'mdk-stage1/stdio-frontend.c') diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c index 9fe110ca9..277c47da1 100644 --- a/mdk-stage1/stdio-frontend.c +++ b/mdk-stage1/stdio-frontend.c @@ -127,31 +127,42 @@ void remove_wait_message(void) static int size_progress; static int actually_drawn; - +#define PROGRESS_SIZE 60 void init_progression(char *msg, int size) { int i; size_progress = size; - actually_drawn = 0; - printf("%s\n[", msg); - for (i=0; i<60; i++) - printf("."); - printf("]\033[G["); /* only works on ANSI-compatibles */ - fflush(stdout); + printf("%s\n", msg); + if (size) { + printf("["); + actually_drawn = 0; + for (i=0; i actually_drawn) { - printf("*"); - actually_drawn++; - } + if (size_progress) { + while ((int)((current_size*PROGRESS_SIZE)/size_progress) > actually_drawn) { + printf("*"); + actually_drawn++; + } + } else + printf("\033[G%d bytes read", current_size); + fflush(stdout); } void end_progression(void) { - printf("]\n"); + if (size_progress) { + update_progression(size_progress); + printf("]\n"); + } else + printf(" done.\n"); } -- cgit v1.2.1