add -o/--output option

This commit is contained in:
Martin Dørum
2024-06-08 14:31:19 +02:00
parent ace8f44f59
commit 30763684b7
13 changed files with 122 additions and 63 deletions
+2 -1
View File
@@ -54,11 +54,12 @@ struct opts_s { /* structure describing run-time options */
bool stop_at_size; /* set if we stop at "size" bytes */
bool sync_after_write; /* set if we sync after every write */
bool direct_io; /* set if O_DIRECT is to be used */
bool discard_input; /* set to write nothing to stdout */
bool discard_input; /* set to write nothing to output */
double interval; /* interval between updates */
double delay_start; /* delay before first display */
pid_t watch_pid; /* process to watch fds of */
int watch_fd; /* fd to watch */
/*@keep@*/ /*@null@*/ char *output; /* fd to write output to */
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
unsigned int width; /* screen width */
unsigned int height; /* screen height */
+2
View File
@@ -123,6 +123,8 @@ struct pvstate_s {
double delay_start; /* delay before first display */
pid_t watch_pid; /* process to watch fds of */
int watch_fd; /* fd to watch */
int output_fd; /* fd to write output to */
/*@null@*/ char *output_name; /* name of the output, for diagnostics */
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
unsigned int width; /* screen width */
unsigned int height; /* screen height */
+1
View File
@@ -186,6 +186,7 @@ extern void pv_state_name_set(pvstate_t, /*@null@*/ const char *);
extern void pv_state_format_string_set(pvstate_t, /*@null@*/ const char *);
extern void pv_state_watch_pid_set(pvstate_t, pid_t);
extern void pv_state_watch_fd_set(pvstate_t, int);
extern void pv_state_output_set(pvstate_t, int, const char *);
extern void pv_state_average_rate_window_set(pvstate_t, unsigned int);
extern void pv_state_inputfiles(pvstate_t, unsigned int, const char **);