diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2000-12-12 21:49:14 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2000-12-12 21:49:14 +0000 |
commit | b8a6765874054e3f3966896a8763f7352d9ff8f1 (patch) | |
tree | 58a6aacfc446cf363ef147e1cb8b5166ca410d12 /mdk-stage1/stdio-frontend.c | |
parent | 2b2914cc04a93ca362e4eb3663061c3039aa4049 (diff) | |
download | drakx-backup-do-not-use-b8a6765874054e3f3966896a8763f7352d9ff8f1.tar drakx-backup-do-not-use-b8a6765874054e3f3966896a8763f7352d9ff8f1.tar.gz drakx-backup-do-not-use-b8a6765874054e3f3966896a8763f7352d9ff8f1.tar.bz2 drakx-backup-do-not-use-b8a6765874054e3f3966896a8763f7352d9ff8f1.tar.xz drakx-backup-do-not-use-b8a6765874054e3f3966896a8763f7352d9ff8f1.zip |
progressbar for newt+stdio while loading ramdisk
Diffstat (limited to 'mdk-stage1/stdio-frontend.c')
-rw-r--r-- | mdk-stage1/stdio-frontend.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c index bb6755176..ec448224a 100644 --- a/mdk-stage1/stdio-frontend.c +++ b/mdk-stage1/stdio-frontend.c @@ -106,6 +106,37 @@ void remove_wait_message(void) } +static int size_progress; +static int actually_drawn; + +void init_progression(char *msg, int size) +{ + size_progress = size; + actually_drawn = 0; + printf("%s\n[", msg); +} + +void update_progression(int current_size) +{ + while ((int)((current_size*40)/size_progress) > actually_drawn) { + printf("."); + actually_drawn++; + if (actually_drawn == 10) + printf("(25%%)"); + if (actually_drawn == 20) + printf("(50%%)"); + if (actually_drawn == 30) + printf("(75%%)"); + } + fflush(stdout); +} + +void end_progression(void) +{ + printf("]\n"); +} + + enum return_type ask_from_list_comments(char *msg, char ** elems, char ** elems_comments, char ** choice) { char ** sav_elems = elems; |