2 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #ifndef METADATA_BUCKET_H
9 #define METADATA_BUCKET_H
11 #include <common/consumer/consumer.hpp>
13 struct metadata_bucket;
15 typedef ssize_t (*metadata_bucket_flush_cb)(
16 const struct stream_subbuffer *buffer, void *data);
18 enum metadata_bucket_status {
19 METADATA_BUCKET_STATUS_OK,
20 METADATA_BUCKET_STATUS_ERROR,
23 struct metadata_bucket *metadata_bucket_create(
24 metadata_bucket_flush_cb flush, void *data);
26 void metadata_bucket_destroy(struct metadata_bucket *bucket);
28 enum metadata_bucket_status metadata_bucket_fill(struct metadata_bucket *bucket,
29 const struct stream_subbuffer *buffer);
31 void metadata_bucket_reset(struct metadata_bucket *bucket);
33 #endif /* METADATA_BUCKET_H */