]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/lsfd-counter.h
lsblk: rename sortdata to rawdata
[thirdparty/util-linux.git] / misc-utils / lsfd-counter.h
CommitLineData
7d8c81d7
MY
1/*
2 * lsfd-counter.h - counter implementation used in --summary option
3 *
4 * Copyright (C) 2021 Red Hat, Inc.
5 * Copyright (C) 2021 Masatake YAMATO <yamato@redhat.com>
6 *
7 * This file may be redistributed under the terms of the
8 * GNU Lesser General Public License.
9 */
10#ifndef UTIL_LINUX_LSFD_COUNTER_H
11#define UTIL_LINUX_LSFD_COUNTER_H
12
13#include "libsmartcols.h"
14#include "lsfd-filter.h"
15#include <stdbool.h>
16
17struct lsfd_counter;
18
19/* The created counter takes the ownership of the filter; the filter is
20 * freed in lsfd_counter_free().
21 */
22struct lsfd_counter *lsfd_counter_new(const char *const name, struct lsfd_filter *filter);
23void lsfd_counter_free(struct lsfd_counter *counter);
24
25bool lsfd_counter_accumulate(struct lsfd_counter *counter, struct libscols_line *ln);
26
27const char *lsfd_counter_name(struct lsfd_counter *counter);
28size_t lsfd_counter_value(struct lsfd_counter *counter);
29
30#endif /* UTIL_LINUX_LSFD_COUNTER_H */