From: Juarez Rudsatz Date: Mon, 5 Feb 2024 18:59:15 +0000 (-0300) Subject: column: add doc comment explaining ansi code detection X-Git-Tag: v2.42-start~543^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c25fc4b0933e4f51fba4c97a12a4d3caef8dfe1;p=thirdparty%2Futil-linux.git column: add doc comment explaining ansi code detection --- diff --git a/text-utils/column.c b/text-utils/column.c index 63c7def33..9d11fe7ac 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -113,6 +113,13 @@ typedef enum { ANSI_BSL = '\\' } ansi_esc_states; +/** + * Count how many characters are non-printable due to ANSI X3.41 escape codes. + * + * It detects and count only Fe Escape sequences. These sequences contains characters + * that normally are printable, but due to being part of a escape sequence are ignored + * when displayed in console terminals. + */ static inline size_t ansi_esc_width(ansi_esc_states *state, size_t *found, const wchar_t *str) { switch (*state) {