]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libsmartcols: (filter) Add on-demand data filler
authorKarel Zak <kzak@redhat.com>
Wed, 20 Sep 2023 11:47:43 +0000 (13:47 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Nov 2023 21:25:46 +0000 (22:25 +0100)
commit58b6bd7137dcff608e90db52da077d4940fa482f
tree781de0ef4c2e7425a4e5deba89f8f49895d99ed4
parent1db278f95fdc4916a57f038a60e0ef980a1eb57e
libsmartcols: (filter) Add on-demand data filler

When dealing with really large data sets, we need to reduce overhead
by filtering out unnecessary lines. The traditional approach, using:

 lstool | grep <expr>

requires the tool to read all data from the system and then filter out
(and throw away) a lot of data.

The filter-filler now allows us to use an empty line. The filter will
request data through a callback, and when a line passes the filter,
the application can fill in the rest of the columns.

For example, in a query like "FOO > 10 && BAR < 10," libsmartcols will
never ask for "BAR" if "FOO" is smaller than 10. This means the
application doesn't have to gather additional columns.

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