• Home
  • Raw
  • Download

Lines Matching full:bar

69 static void fly(struct ProgressData *bar, bool moved)  in fly()  argument
73 int check = bar->width - 2; in fly()
75 msnprintf(buf, sizeof(buf), "%*s\r", bar->width-1, " "); in fly()
76 memcpy(&buf[bar->bar], "-=O=-", 5); in fly()
78 pos = sinus[bar->tick%200] / (10000 / check); in fly()
80 pos = sinus[(bar->tick + 5)%200] / (10000 / check); in fly()
82 pos = sinus[(bar->tick + 10)%200] / (10000 / check); in fly()
84 pos = sinus[(bar->tick + 15)%200] / (10000 / check); in fly()
87 fputs(buf, bar->out); in fly()
88 bar->tick += 2; in fly()
89 if(bar->tick >= 200) in fly()
90 bar->tick -= 200; in fly()
92 bar->bar += (moved?bar->barmove:0); in fly()
93 if(bar->bar >= (bar->width - 6)) { in fly()
94 bar->barmove = -1; in fly()
95 bar->bar = bar->width - 6; in fly()
97 else if(bar->bar < 0) { in fly()
98 bar->barmove = 1; in fly()
99 bar->bar = 0; in fly()
120 /* The original progress-bar source code was written for curl by Lars Aas, in tool_progress_cb()
124 struct ProgressData *bar = (struct ProgressData *)clientp; in tool_progress_cb() local
129 if((CURL_OFF_T_MAX - bar->initial_size) < (dltotal + ultotal)) in tool_progress_cb()
132 total = dltotal + ultotal + bar->initial_size; in tool_progress_cb()
135 if((CURL_OFF_T_MAX - bar->initial_size) < (dlnow + ulnow)) in tool_progress_cb()
138 point = dlnow + ulnow + bar->initial_size; in tool_progress_cb()
140 if(bar->calls) { in tool_progress_cb()
144 if(bar->prev == point) in tool_progress_cb()
147 else if((tvdiff(now, bar->prevtime) < 100L) && point < total) in tool_progress_cb()
148 /* limit progress-bar updating to 10 Hz except when we're at 100% */ in tool_progress_cb()
153 if(tvdiff(now, bar->prevtime) < 100L) in tool_progress_cb()
154 /* limit progress-bar updating to 10 Hz */ in tool_progress_cb()
156 fly(bar, point != bar->prev); in tool_progress_cb()
161 bar->calls++; in tool_progress_cb()
163 if((total > 0) && (point != bar->prev)) { in tool_progress_cb()
176 barwidth = bar->width - 7; in tool_progress_cb()
183 fprintf(bar->out, format, line, percent); in tool_progress_cb()
185 fflush(bar->out); in tool_progress_cb()
186 bar->prev = point; in tool_progress_cb()
187 bar->prevtime = now; in tool_progress_cb()
192 void progressbarinit(struct ProgressData *bar, in progressbarinit() argument
196 memset(bar, 0, sizeof(struct ProgressData)); in progressbarinit()
202 bar->initial_size = config->resume_from; in progressbarinit()
209 bar->width = (int)num; in progressbarinit()
213 if(!bar->width) { in progressbarinit()
240 bar->width = cols; in progressbarinit()
243 if(!bar->width) in progressbarinit()
244 bar->width = 79; in progressbarinit()
245 else if(bar->width > MAX_BARLENGTH) in progressbarinit()
246 bar->width = MAX_BARLENGTH; in progressbarinit()
248 bar->out = config->global->errors; in progressbarinit()
249 bar->tick = 150; in progressbarinit()
250 bar->barmove = 1; in progressbarinit()