diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-02-10 17:18:02 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-02-10 17:18:02 +0000 |
commit | 6807d239366a6953517a228b73ab7417033bf4aa (patch) | |
tree | 8e32e1f9cd5993e3a33faf2148e8bde68ac74f7e /risugen | |
parent | 71c81d66264f8adeed2787eab056a9f62c12e079 (diff) |
Move progress bar functions to risugen_common
The progress bar functions are the same in every backend, so move
them to the common file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'risugen')
-rwxr-xr-x | risugen | 30 |
1 files changed, 0 insertions, 30 deletions
@@ -37,36 +37,6 @@ my @not_pattern_re = (); # exclude pattern # Valid block names (keys in blocks hash) my %valid_blockname = ( constraints => 1, memory => 1 ); -my $lastprog; -my $proglen; -my $progmax; - -sub progress_start($$) -{ - ($proglen, $progmax) = @_; - $proglen -= 2; # allow for [] chars - $| = 1; # disable buffering so we can see the meter... - print "[" . " " x $proglen . "]\r"; - $lastprog = 0; -} - -sub progress_update($) -{ - # update the progress bar with current progress - my ($done) = @_; - my $barlen = int($proglen * $done / $progmax); - if ($barlen != $lastprog) { - $lastprog = $barlen; - print "[" . "-" x $barlen . " " x ($proglen - $barlen) . "]\r"; - } -} - -sub progress_end() -{ - print "[" . "-" x $proglen . "]\n"; - $| = 0; -} - sub parse_risu_directive($$@) { # Parse a line beginning with ".", which is a directive used |