]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libsmartcols: implement filter based counters
authorKarel Zak <kzak@redhat.com>
Tue, 26 Sep 2023 10:43:01 +0000 (12:43 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Nov 2023 21:25:46 +0000 (22:25 +0100)
commit3aeacd6a47df358da0b945496e5e29c5063aca4d
tree538607c999caec39bff0fd15bb96ebb6056723c2
parent9f55de7896fa8580fdaf496c93c7839fad45dbb5
libsmartcols: implement filter based counters

* add support for empty filter; the result of the empty expression is
  always "true"

* Filter can hold arbitrary number of counters

* A counter is based on a built-in function. Now supported are count, max, min and sum functions.

* The default function is "count" (count lines)

* It's possible to assign column (param) to the counter, for example count sum
  of all data in the column

* The param is used in the same way as params in the filter (and
  initialized in the same way)

Based on Masatake YAMATO's work on lsfd.

Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/filter-param.c
libsmartcols/src/filter.c
libsmartcols/src/libsmartcols.h.in
libsmartcols/src/libsmartcols.sym
libsmartcols/src/smartcolsP.h