• Home
  • Raw
  • Download

Lines Matching refs:prog

29 static errcode_t ext2fs_progress_display(ext2_sim_progmeter prog)  in ext2fs_progress_display()  argument
33 fputs(prog->label, prog->f); in ext2fs_progress_display()
34 width = prog->labelwidth - strlen(prog->label); in ext2fs_progress_display()
36 putc(' ', prog->f); in ext2fs_progress_display()
37 if (prog->labelwidth + prog->barwidth > 80) { in ext2fs_progress_display()
38 fputs("\n", prog->f); in ext2fs_progress_display()
39 for (width = prog->labelwidth; width > 0; width--) in ext2fs_progress_display()
40 putc(' ', prog->f); in ext2fs_progress_display()
42 for (i=0; i < prog->barwidth; i++) in ext2fs_progress_display()
43 putc('-', prog->f); in ext2fs_progress_display()
44 for (i=0; i < prog->barwidth; i++) in ext2fs_progress_display()
45 putc('\b', prog->f); in ext2fs_progress_display()
46 fflush(prog->f); in ext2fs_progress_display()
51 void ext2fs_progress_update(ext2_sim_progmeter prog, __u32 current) in ext2fs_progress_update() argument
55 level = prog->barwidth * current / prog->maxdone; in ext2fs_progress_update()
56 old_level = prog->barwidth * prog->current / prog->maxdone; in ext2fs_progress_update()
57 prog->current = current; in ext2fs_progress_update()
65 putc('X', prog->f); in ext2fs_progress_update()
69 putc('\b', prog->f); in ext2fs_progress_update()
71 putc('-', prog->f); in ext2fs_progress_update()
73 putc('\b', prog->f); in ext2fs_progress_update()
75 fflush(prog->f); in ext2fs_progress_update()
83 ext2_sim_progmeter prog; in ext2fs_progress_init() local
86 retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress), &prog); in ext2fs_progress_init()
89 memset(prog, 0, sizeof(struct ext2_sim_progress)); in ext2fs_progress_init()
91 retval = ext2fs_get_mem(strlen(label)+1, &prog->label); in ext2fs_progress_init()
93 free(prog); in ext2fs_progress_init()
96 strcpy(prog->label, label); in ext2fs_progress_init()
97 prog->labelwidth = labelwidth; in ext2fs_progress_init()
98 prog->barwidth = barwidth; in ext2fs_progress_init()
99 prog->flags = flags; in ext2fs_progress_init()
100 prog->maxdone = maxdone; in ext2fs_progress_init()
101 prog->current = 0; in ext2fs_progress_init()
102 prog->shown = 0; in ext2fs_progress_init()
103 prog->f = stdout; in ext2fs_progress_init()
105 *ret_prog = prog; in ext2fs_progress_init()
107 return ext2fs_progress_display(prog); in ext2fs_progress_init()
110 void ext2fs_progress_close(ext2_sim_progmeter prog) in ext2fs_progress_close() argument
113 if (prog->label) in ext2fs_progress_close()
114 ext2fs_free_mem(&prog->label); in ext2fs_progress_close()
115 ext2fs_free_mem(&prog); in ext2fs_progress_close()