diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-05-09 20:50:23 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-06-09 15:09:28 -0400 |
commit | 1545d45707fa4fb2869d93274db4b772d69b7ed9 (patch) | |
tree | 634f9c1182ab678849815e6dbe594b8720f2faad /include/linux/debugobjects.h | |
parent | bfbb4713f4e5d6c23ba6006cbad07efe7d9550b8 (diff) |
lib/printbuf: Tabstops, indenting
This patch adds two new features to printbuf for structured formatting:
- Indent level: the indent level, as a number of spaces, may be
increased with pr_indent_add() and decreased with pr_indent_sub().
Subsequent lines, when started with pr_newline() (not "\n", although
that may change) will then be intended according to the current
indent level. This helps with pretty-printers that structure a large
amonut of data across multiple lines and multiple functions.
- Tabstops: Tabstops may be set by assigning to the printbuf->tabstops
array.
Then, pr_tab() may be used to advance to the next tabstop, printing
as many spaces as required - leaving previous output left justified
to the previous tabstop. pr_tab_rjust() advances to the next tabstop
but inserts the spaces just after the previous tabstop - right
justifying the previously-outputted text to the next tabstop.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions