anchor.diff:  -include_lib("kernel/include/file.hrl").
   
   -record(progress, {
  -	  file,                 % string()
  -	  cb_module,            % atom()
  -	  cb_function,          % atom()
  -	  init_progress_term,   % term()
  -	  current_progress_term % term()
  +	  file                  :: string() | 'undefined',
  +	  cb_module             :: module(),
  +	  cb_function           :: atom(),
  +	  init_progress_term    :: term(),
  +	  current_progress_term :: term()
   	 }).
   
   %%%=========================================================================
  
positive.code: %% Description: Reports progress to the reporting process that calls the
  %% user defined callback function.
  %%--------------------------------------------------------------------------
  report(Pid, Report) ->
      Pid ! {progress_report, Report}.
  
  %%--------------------------------------------------------------------------
  %% stop(Pid) -> _
  %%	Pid = pid()
  %%
  %% Description: 
  %%--------------------------------------------------------------------------   
  stop(Pid) ->
      Pid ! stop.
  
  %%%=========================================================================
  %%%  Internal functions
  
negative.code: %% Description: Starts the progress report process unless progress reporting
  %% should not be performed.
  %%--------------------------------------------------------------------------
  -type options() :: 'ignore' | {module(), atom(), term()}.
  -spec start_link(options()) -> 'ignore' | pid().
  start_link(ignore) ->
      ignore;
  start_link(Options) ->
      spawn_link(?MODULE, init, [Options]).
  
  %%--------------------------------------------------------------------------
  %% report_progress(Pid, Report) -> ok
  %%      Pid = pid()
  %%	Report = {local_file, File} | {remote_file, File} | 
  %%               {transfer_size, Size}
  