wget2  1.0.0
Progress Display Functions

Enumerations

enum  
 
enum  
 
enum  { DEFAULT_SCREEN_WIDTH = 70, MINIMUM_SCREEN_WIDTH = 45 }
 

Functions

wget_bar_t * wget_bar_init (wget_bar_t *bar, int nslots)
 
void wget_bar_set_slots (wget_bar_t *bar, int nslots)
 
void wget_bar_slot_begin (wget_bar_t *bar, int slot, const char *filename, ssize_t file_size)
 
void wget_bar_slot_downloaded (wget_bar_t *bar, int slot, size_t nbytes)
 
void wget_bar_slot_deregister (wget_bar_t *bar, int slot)
 
void wget_bar_update (wget_bar_t *bar)
 
void wget_bar_deinit (wget_bar_t *bar)
 
void wget_bar_free (wget_bar_t **bar)
 
void wget_bar_print (wget_bar_t *bar, int slot, const char *s)
 
ssize_t wget_bar_vprintf (wget_bar_t *bar, int slot, const char *fmt, va_list args)
 
ssize_t wget_bar_printf (wget_bar_t *bar, int slot, const char *fmt,...)
 
void wget_bar_screen_resized (void)
 
void wget_bar_write_line (wget_bar_t *bar, const char *buf, size_t len)
 

Detailed Description

Methods for creating and printing a progress bar display.

Function Documentation

◆ wget_bar_init()

wget_bar_t* wget_bar_init ( wget_bar_t *  bar,
int  nslots 
)
Parameters
[in]barPointer to a wget_bar_t object
[in]nslotsNumber of progress bars
[in]max_widthMaximum width of the progress bars
Returns
Pointer to a wget_bar_t object

Initialize a new progress bar instance for Wget. If bar is a NULL pointer, it will be allocated on the heap and a pointer to the newly allocated memory will be returned.

nslots is the number of screen lines to reserve for printing the progress bars. This may be any number, but you generally want at least as many slots as there are downloader threads.

max_width is the maximum number of screen columns that the progress bar may occupy.

◆ wget_bar_deinit()

void wget_bar_deinit ( wget_bar_t *  bar)
Parameters
[in]barPointer to wget_bar_t

Free the various progress bar data structures

◆ wget_bar_free()

void wget_bar_free ( wget_bar_t **  bar)

Free the pointer holding the *wget_bar_t structure as well