| 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 | |
| 11 | #include <common/consumer/consumer.h> |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | struct metadata_bucket; |
| 18 | |
| 19 | typedef ssize_t (*metadata_bucket_flush_cb)( |
| 20 | const struct stream_subbuffer *buffer, void *data); |
| 21 | |
| 22 | enum metadata_bucket_status { |
| 23 | METADATA_BUCKET_STATUS_OK, |
| 24 | METADATA_BUCKET_STATUS_ERROR, |
| 25 | }; |
| 26 | |
| 27 | struct metadata_bucket *metadata_bucket_create( |
| 28 | metadata_bucket_flush_cb flush, void *data); |
| 29 | |
| 30 | void metadata_bucket_destroy(struct metadata_bucket *bucket); |
| 31 | |
| 32 | enum metadata_bucket_status metadata_bucket_fill(struct metadata_bucket *bucket, |
| 33 | const struct stream_subbuffer *buffer); |
| 34 | |
| 35 | void metadata_bucket_reset(struct metadata_bucket *bucket); |
| 36 | |
| 37 | #ifdef __cplusplus |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 | #endif /* METADATA_BUCKET_H */ |