Lines Matching refs:prog

28 static errcode_t ext2fs_progress_display(ext2_sim_progmeter prog)  in ext2fs_progress_display()  argument
32 fputs(prog->label, prog->f); in ext2fs_progress_display()
33 width = prog->labelwidth - strlen(prog->label); in ext2fs_progress_display()
35 putc(' ', prog->f); in ext2fs_progress_display()
36 if (prog->labelwidth + prog->barwidth > 80) { in ext2fs_progress_display()
37 fputs("\n", prog->f); in ext2fs_progress_display()
38 for (width = prog->labelwidth; width > 0; width--) in ext2fs_progress_display()
39 putc(' ', prog->f); in ext2fs_progress_display()
41 for (i=0; i < prog->barwidth; i++) in ext2fs_progress_display()
42 putc('-', prog->f); in ext2fs_progress_display()
43 for (i=0; i < prog->barwidth; i++) in ext2fs_progress_display()
44 putc('\b', prog->f); in ext2fs_progress_display()
45 fflush(prog->f); in ext2fs_progress_display()
50 void ext2fs_progress_update(ext2_sim_progmeter prog, __u32 current) in ext2fs_progress_update() argument
54 level = prog->barwidth * current / prog->maxdone; in ext2fs_progress_update()
55 old_level = prog->barwidth * prog->current / prog->maxdone; in ext2fs_progress_update()
56 prog->current = current; in ext2fs_progress_update()
64 putc('X', prog->f); in ext2fs_progress_update()
68 putc('\b', prog->f); in ext2fs_progress_update()
70 putc('-', prog->f); in ext2fs_progress_update()
72 putc('\b', prog->f); in ext2fs_progress_update()
74 fflush(prog->f); in ext2fs_progress_update()
82 ext2_sim_progmeter prog; in ext2fs_progress_init() local
85 retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress), &prog); in ext2fs_progress_init()
88 memset(prog, 0, sizeof(struct ext2_sim_progress)); in ext2fs_progress_init()
90 retval = ext2fs_get_mem(strlen(label)+1, &prog->label); in ext2fs_progress_init()
92 free(prog); in ext2fs_progress_init()
95 strcpy(prog->label, label); in ext2fs_progress_init()
96 prog->labelwidth = labelwidth; in ext2fs_progress_init()
97 prog->barwidth = barwidth; in ext2fs_progress_init()
98 prog->flags = flags; in ext2fs_progress_init()
99 prog->maxdone = maxdone; in ext2fs_progress_init()
100 prog->current = 0; in ext2fs_progress_init()
101 prog->shown = 0; in ext2fs_progress_init()
102 prog->f = stdout; in ext2fs_progress_init()
104 *ret_prog = prog; in ext2fs_progress_init()
106 return ext2fs_progress_display(prog); in ext2fs_progress_init()
109 void ext2fs_progress_close(ext2_sim_progmeter prog) in ext2fs_progress_close() argument
112 if (prog->label) in ext2fs_progress_close()
113 ext2fs_free_mem(&prog->label); in ext2fs_progress_close()
114 ext2fs_free_mem(&prog); in ext2fs_progress_close()