summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/stdio-frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/stdio-frontend.c')
-rw-r--r--mdk-stage1/stdio-frontend.c31
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;