From cfe5e3905201349e9cf3f95d52ff4bd100bde37d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:10:49 +0200 Subject: Adding upstream version 2.39.3. Signed-off-by: Daniel Baumann --- misc-utils/lsfd-counter.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 misc-utils/lsfd-counter.h (limited to 'misc-utils/lsfd-counter.h') diff --git a/misc-utils/lsfd-counter.h b/misc-utils/lsfd-counter.h new file mode 100644 index 0000000..bac11a9 --- /dev/null +++ b/misc-utils/lsfd-counter.h @@ -0,0 +1,30 @@ +/* + * lsfd-counter.h - counter implementation used in --summary option + * + * Copyright (C) 2021 Red Hat, Inc. + * Copyright (C) 2021 Masatake YAMATO + * + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ +#ifndef UTIL_LINUX_LSFD_COUNTER_H +#define UTIL_LINUX_LSFD_COUNTER_H + +#include "libsmartcols.h" +#include "lsfd-filter.h" +#include + +struct lsfd_counter; + +/* The created counter takes the ownership of the filter; the filter is + * freed in lsfd_counter_free(). + */ +struct lsfd_counter *lsfd_counter_new(const char *const name, struct lsfd_filter *filter); +void lsfd_counter_free(struct lsfd_counter *counter); + +bool lsfd_counter_accumulate(struct lsfd_counter *counter, struct libscols_line *ln); + +const char *lsfd_counter_name(struct lsfd_counter *counter); +size_t lsfd_counter_value(struct lsfd_counter *counter); + +#endif /* UTIL_LINUX_LSFD_COUNTER_H */ -- cgit v1.2.3