Commit | Line | Data |
---|---|---|
f5ba75b4 JG |
1 | /* |
2 | * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: GPL-2.0-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef METADATA_BUCKET_H | |
9 | #define METADATA_BUCKET_H | |
10 | ||
c9e313bc | 11 | #include <common/consumer/consumer.hpp> |
f5ba75b4 JG |
12 | |
13 | struct metadata_bucket; | |
14 | ||
15 | typedef ssize_t (*metadata_bucket_flush_cb)( | |
16 | const struct stream_subbuffer *buffer, void *data); | |
17 | ||
18 | enum metadata_bucket_status { | |
19 | METADATA_BUCKET_STATUS_OK, | |
20 | METADATA_BUCKET_STATUS_ERROR, | |
21 | }; | |
22 | ||
23 | struct metadata_bucket *metadata_bucket_create( | |
24 | metadata_bucket_flush_cb flush, void *data); | |
25 | ||
26 | void metadata_bucket_destroy(struct metadata_bucket *bucket); | |
27 | ||
28 | enum metadata_bucket_status metadata_bucket_fill(struct metadata_bucket *bucket, | |
29 | const struct stream_subbuffer *buffer); | |
30 | ||
31 | void metadata_bucket_reset(struct metadata_bucket *bucket); | |
32 | ||
97535efa | 33 | #endif /* METADATA_BUCKET_H */ |