progressbar: move progress bar state to progressbar.c and set via function

At the moment the progress_enabled flag is set in progressbar.c if
the progressbar should be enabled via enable_progress_bar() and disabled
via disable_progress_bar().  However, this does not allow for
temporary disabling of the progress bar.  A
{disable/enable}_progress_bar() sequence will enable the progress bar
even if it was never enabled in the first place.

Solve this by moving the overall progress flag (which determines if
the progress bar should be initially enabled) into progressbar.c
and set via the accessor function set_progressbar_state().

Now enable_progress_bar() only sets progress_enabled if the overall
display_progress_bar flag is set.  In effect progress_enabled
becomes a temporary status flag controlled by the overall
display_progress_bar flag.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
3 files changed
tree: 0757b0f391fe63bc2fea4ab7c81d09259a1554f2
  1. kernel/
  2. kernel-2.4/
  3. squashfs-tools/
  4. README