Added all changes made between v1.6.6 and June 2020

This commit is contained in:
Andrew Wood
2021-09-04 21:00:00 +01:00
parent 9dd06d8acb
commit 7d68a574ca
33 changed files with 2067 additions and 1825 deletions
+19 -19
View File
@@ -14,30 +14,30 @@ typedef struct opts_s *opts_t;
struct opts_s { /* structure describing run-time options */
char *program_name; /* name the program is running as */
unsigned char do_nothing; /* exit-without-doing-anything flag */
unsigned char progress; /* progress bar flag */
unsigned char timer; /* timer flag */
unsigned char eta; /* ETA flag */
unsigned char fineta; /* absolute ETA flag */
unsigned char rate; /* rate counter flag */
unsigned char average_rate; /* average rate counter flag */
unsigned char bytes; /* bytes transferred flag */
unsigned char bufpercent; /* transfer buffer percentage flag */
bool do_nothing; /* exit-without-doing-anything flag */
bool progress; /* progress bar flag */
bool timer; /* timer flag */
bool eta; /* ETA flag */
bool fineta; /* absolute ETA flag */
bool rate; /* rate counter flag */
bool average_rate; /* average rate counter flag */
bool bytes; /* bytes transferred flag */
bool bufpercent; /* transfer buffer percentage flag */
unsigned int lastwritten; /* show N bytes last written */
unsigned char force; /* force-if-not-terminal flag */
unsigned char cursor; /* whether to use cursor positioning */
unsigned char numeric; /* numeric output only */
unsigned char wait; /* wait for transfer before display */
unsigned char linemode; /* count lines instead of bytes */
unsigned char null; /* lines are null-terminated */
unsigned char no_op; /* do nothing other than pipe data */
bool force; /* force-if-not-terminal flag */
bool cursor; /* whether to use cursor positioning */
bool numeric; /* numeric output only */
bool wait; /* wait for transfer before display */
bool linemode; /* count lines instead of bytes */
bool null; /* lines are null-terminated */
bool no_op; /* do nothing other than pipe data */
unsigned long long rate_limit; /* rate limit, in bytes per second */
unsigned long long buffer_size;/* buffer size, in bytes (0=default) */
unsigned int remote; /* PID of pv to update settings of */
unsigned long long size; /* total size of data */
unsigned char no_splice; /* flag set if never to use splice */
unsigned char skip_errors; /* skip read errors flag */
unsigned char stop_at_size; /* set if we stop at "size" bytes */
bool no_splice; /* flag set if never to use splice */
unsigned int skip_errors; /* skip read errors counter */
bool stop_at_size; /* set if we stop at "size" bytes */
double interval; /* interval between updates */
double delay_start; /* delay before first display */
unsigned int watch_pid; /* process to watch fds of */
+13 -13
View File
@@ -58,16 +58,16 @@ struct pvstate_s {
/*******************
* Program control *
*******************/
unsigned char force; /* display even if not on terminal */
unsigned char cursor; /* use cursor positioning */
unsigned char numeric; /* numeric output only */
unsigned char wait; /* wait for data before display */
unsigned char linemode; /* count lines instead of bytes */
unsigned char null; /* lines are null-terminated */
unsigned char no_op; /* do nothing other than pipe data */
unsigned char skip_errors; /* skip read errors flag */
unsigned char stop_at_size; /* set if we stop at "size" bytes */
unsigned char no_splice; /* never use splice() */
bool force; /* display even if not on terminal */
bool cursor; /* use cursor positioning */
bool numeric; /* numeric output only */
bool wait; /* wait for data before display */
bool linemode; /* count lines instead of bytes */
bool null; /* lines are null-terminated */
bool no_op; /* do nothing other than pipe data */
unsigned int skip_errors; /* skip read errors counter */
bool stop_at_size; /* set if we stop at "size" bytes */
bool no_splice; /* never use splice() */
unsigned long long rate_limit; /* rate limit, in bytes per second */
unsigned long long target_buffer_size; /* buffer size (0=default) */
unsigned long long size; /* total size of data */
@@ -135,7 +135,7 @@ struct pvstate_s {
const char *string;
int length;
} format[100];
unsigned char display_visible; /* set once anything written to terminal */
bool display_visible; /* set once anything written to terminal */
/********************
* Cursor/IPC state *
@@ -147,8 +147,8 @@ struct pvstate_s {
int *crs_y_top; /* pointer to Y coord of topmost `pv' */
int crs_y_lastread; /* last value of _y_top seen */
int crs_y_offset; /* our Y offset from this top position */
int crs_needreinit; /* set if we need to reinit cursor pos */
int crs_noipc; /* set if we can't use IPC */
int crs_needreinit; /* counter if we need to reinit cursor pos */
bool crs_noipc; /* set if we can't use IPC */
#endif /* HAVE_IPC */
int crs_lock_fd; /* fd of lockfile, -1 if none open */
char crs_lock_file[1024];
+24 -19
View File
@@ -34,14 +34,14 @@ typedef enum {
extern double pv_getnum_d(const char *);
/*
* Return the given string converted to an integer.
* Return the given string converted to an unsigned integer.
*/
extern int pv_getnum_i(const char *);
extern unsigned int pv_getnum_ui(const char *);
/*
* Return the given string converted to a long long.
* Return the given string converted to an unsigned long long.
*/
extern long long pv_getnum_ll(const char *);
extern unsigned long long pv_getnum_ull(const char *);
/*
* Return zero if the given string is a number of the given type. NB an
@@ -61,30 +61,30 @@ extern pvstate_t pv_state_alloc(const char *);
/*
* Set the formatting string, given a set of old-style formatting options.
*/
extern void pv_state_set_format(pvstate_t state, unsigned char progress,
unsigned char timer, unsigned char eta,
unsigned char fineta, unsigned char rate,
unsigned char average_rate, unsigned char bytes,
unsigned char bufpercent,
extern void pv_state_set_format(pvstate_t state, bool progress,
bool timer, bool eta,
bool fineta, bool rate,
bool average_rate, bool bytes,
bool bufpercent,
unsigned int lastwritten,
const char *name);
/*
* Set the various options.
*/
extern void pv_state_force_set(pvstate_t, unsigned char);
extern void pv_state_cursor_set(pvstate_t, unsigned char);
extern void pv_state_numeric_set(pvstate_t, unsigned char);
extern void pv_state_wait_set(pvstate_t, unsigned char);
extern void pv_state_force_set(pvstate_t, bool);
extern void pv_state_cursor_set(pvstate_t, bool);
extern void pv_state_numeric_set(pvstate_t, bool);
extern void pv_state_wait_set(pvstate_t, bool);
extern void pv_state_delay_start_set(pvstate_t, double);
extern void pv_state_linemode_set(pvstate_t, unsigned char);
extern void pv_state_null_set(pvstate_t, unsigned char);
extern void pv_state_no_op_set(pvstate_t, unsigned char);
extern void pv_state_skip_errors_set(pvstate_t, unsigned char);
extern void pv_state_stop_at_size_set(pvstate_t, unsigned char);
extern void pv_state_linemode_set(pvstate_t, bool);
extern void pv_state_null_set(pvstate_t, bool);
extern void pv_state_no_op_set(pvstate_t, bool);
extern void pv_state_skip_errors_set(pvstate_t, unsigned int);
extern void pv_state_stop_at_size_set(pvstate_t, bool);
extern void pv_state_rate_limit_set(pvstate_t, unsigned long long);
extern void pv_state_target_buffer_size_set(pvstate_t, unsigned long long);
extern void pv_state_no_splice_set(pvstate_t, unsigned char);
extern void pv_state_no_splice_set(pvstate_t, bool);
extern void pv_state_size_set(pvstate_t, unsigned long long);
extern void pv_state_interval_set(pvstate_t, double);
extern void pv_state_width_set(pvstate_t, unsigned int);
@@ -96,6 +96,11 @@ extern void pv_state_watch_fd_set(pvstate_t, int);
extern void pv_state_inputfiles(pvstate_t, int, const char **);
/*
* Work out whether we are in the foreground.
*/
extern bool pv_in_foreground(void);
/*
* Work out the terminal size.
*/