Track the chosen size of format segments so that "%nA" can appear more than once, with different "n" values (#122).

This commit is contained in:
Andrew Wood
2024-12-07 19:39:44 +00:00
parent c4c7b9ec00
commit 53b5ea54c6
11 changed files with 102 additions and 77 deletions
+2 -1
View File
@@ -192,6 +192,7 @@ struct pvstate_s {
struct { /* format string broken into display components */
size_t str_start; /* for strings: start offset */
size_t str_bytes; /* for strings: length in bytes */
size_t chosen_size; /* "n" from %<n>A, or 0 */
pv_display_component type; /* type of display component */
} format[PV_FORMAT_ARRAY_MAX];
@@ -207,7 +208,7 @@ struct pvstate_s {
size_t display_buffer_size; /* size allocated to display buffer */
size_t display_string_len; /* length of string in display buffer */
off_t initial_offset; /* offset when first opened (when watching fds) */
size_t lastoutput_bytes; /* number of last-output bytes to show */
size_t lastoutput_bytes; /* largest number of last-output bytes to show */
size_t format_segment_count; /* number of format string segments */