Skip to content

Commit

Permalink
compat: Implement iio_channel_attr_get_filename()
Browse files Browse the repository at this point in the history
This function existed in the old API but was not present in the compat
layer until now.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Nov 28, 2023
1 parent c344e85 commit c85c0ac
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit c85c0ac

Please sign in to comment.