• Home
  • Raw
  • Download

Lines Matching full:bar

79 static void fly(struct ProgressData *bar, bool moved)  in fly()  argument
83 int check = bar->width - 2; in fly()
85 msnprintf(buf, sizeof(buf), "%*s\r", bar->width-1, " "); in fly()
86 memcpy(&buf[bar->bar], "-=O=-", 5); in fly()
88 pos = sinus[bar->tick%200] / (1000000 / check); in fly()
90 pos = sinus[(bar->tick + 5)%200] / (1000000 / check); in fly()
92 pos = sinus[(bar->tick + 10)%200] / (1000000 / check); in fly()
94 pos = sinus[(bar->tick + 15)%200] / (1000000 / check); in fly()
97 fputs(buf, bar->out); in fly()
98 bar->tick += 2; in fly()
99 if(bar->tick >= 200) in fly()
100 bar->tick -= 200; in fly()
102 bar->bar += (moved?bar->barmove:0); in fly()
103 if(bar->bar >= (bar->width - 6)) { in fly()
104 bar->barmove = -1; in fly()
105 bar->bar = bar->width - 6; in fly()
107 else if(bar->bar < 0) { in fly()
108 bar->barmove = 1; in fly()
109 bar->bar = 0; in fly()
133 struct ProgressData *bar = &per->progressbar; in tool_progress_cb() local
139 if(bar->initial_size < 0) { in tool_progress_cb()
145 else if((CURL_OFF_T_MAX - bar->initial_size) < (dltotal + ultotal)) in tool_progress_cb()
148 total = dltotal + ultotal + bar->initial_size; in tool_progress_cb()
152 if(bar->initial_size < 0) { in tool_progress_cb()
158 else if((CURL_OFF_T_MAX - bar->initial_size) < (dlnow + ulnow)) in tool_progress_cb()
161 point = dlnow + ulnow + bar->initial_size; in tool_progress_cb()
163 if(bar->calls) { in tool_progress_cb()
167 if(bar->prev == point) in tool_progress_cb()
170 else if((tvdiff(now, bar->prevtime) < 100L) && point < total) in tool_progress_cb()
171 /* limit progress-bar updating to 10 Hz except when we're at 100% */ in tool_progress_cb()
176 if(tvdiff(now, bar->prevtime) < 100L) in tool_progress_cb()
177 /* limit progress-bar updating to 10 Hz */ in tool_progress_cb()
179 fly(bar, point != bar->prev); in tool_progress_cb()
184 bar->calls++; in tool_progress_cb()
186 if((total > 0) && (point != bar->prev)) { in tool_progress_cb()
199 barwidth = bar->width - 7; in tool_progress_cb()
206 fprintf(bar->out, format, line, percent); in tool_progress_cb()
208 fflush(bar->out); in tool_progress_cb()
209 bar->prev = point; in tool_progress_cb()
210 bar->prevtime = now; in tool_progress_cb()
220 void progressbarinit(struct ProgressData *bar, in progressbarinit() argument
224 memset(bar, 0, sizeof(struct ProgressData)); in progressbarinit()
229 bar->initial_size = config->resume_from; in progressbarinit()
237 bar->width = (int)num; in progressbarinit()
241 if(!bar->width) { in progressbarinit()
269 bar->width = cols; in progressbarinit()
272 if(!bar->width) in progressbarinit()
273 bar->width = 79; in progressbarinit()
274 else if(bar->width > MAX_BARLENGTH) in progressbarinit()
275 bar->width = MAX_BARLENGTH; in progressbarinit()
277 bar->out = stderr; in progressbarinit()
278 bar->tick = 150; in progressbarinit()
279 bar->barmove = 1; in progressbarinit()