From c85c0ac2a52bc63259f3dd78d7e41240952d219b Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Mon, 27 Nov 2023 12:40:57 +0100 Subject: [PATCH] compat: Implement iio_channel_attr_get_filename() This function existed in the old API but was not present in the compat layer until now. Signed-off-by: Paul Cercueil --- compat.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compat.c b/compat.c index 7062882f8..633485eb4 100644 --- a/compat.c +++ b/compat.c @@ -1685,6 +1685,19 @@ const char * iio_channel_find_attr(const struct iio_channel *chn, return IIO_CALL(iio_attr_get_name)(attr); } +const char * iio_channel_attr_get_filename(const struct iio_channel *chn, + const char *name) +{ + const struct iio_attr *attr; + + attr = IIO_CALL(iio_channel_find_attr)(chn, name); + if (!attr) + return NULL; + + return IIO_CALL(iio_attr_get_filename)(attr); +} + + ssize_t iio_channel_attr_read(const struct iio_channel *chn, const char *name, char *dst, size_t len) {