void build_output( char *buffer, int width, off64_t bytes_written, off64_t total_size) { int bar_size = width - END_OF_LINE_EMPTY; display_item_t item [ITEM_COUNT]; if( transfer_has_known_size( total_size)) { bar_size = build_item( &item[0], bytes_written, total_size, 0, bar_size, write_percent); } else { item[0].should_display=0; } bar_size = build_item( &item[1], bytes_written, total_size, 1, bar_size, write_bytes_written); bar_size = build_item( &item[2], bytes_written, total_size, 2, bar_size, write_avr_rate); bar_size = hide_items_for_minimum_bar_size( item, bar_size, 20); if( transfer_has_known_size( total_size)) { write_percentage_progress_bar(buffer, bar_size, bytes_written, total_size); } else { write_activity_progress_bar( buffer, bar_size, bytes_written); } write_items( buffer, item); }
static void a_writemuseumgiveback(const attrib * a, const void *owner, struct storage *store) { museumgiveback *gb = (museumgiveback *)a->data.v; WRITE_INT(store, gb->cookie); write_items(store, gb->items); }