diff --git a/iio-private.h b/iio-private.h index 6d7c4e01c..fff93470f 100644 --- a/iio-private.h +++ b/iio-private.h @@ -161,8 +161,6 @@ struct iio_channels_mask { uint32_t mask[]; }; -struct iio_channels_mask *iio_create_channels_mask(unsigned int nb_channels); - int iio_channels_mask_copy(struct iio_channels_mask *dst, const struct iio_channels_mask *src); diff --git a/include/iio/iio.h b/include/iio/iio.h index e95ac404b..7ef6f0fd6 100644 --- a/include/iio/iio.h +++ b/include/iio/iio.h @@ -1407,6 +1407,20 @@ struct iio_data_format { }; +/** @brief Create a new empty channels mask + * @param nb_channels The number of channels in the mask + * @return On success, a pointer to an iio_channels_mask structure + * @return On error, NULL is returned */ +__api struct iio_channels_mask * +iio_create_channels_mask(unsigned int nb_channels); + + +/** @brief Destroy a channels mask + * @param mask A pointer to an iio_channels_mask structure */ +__api void +iio_channels_mask_destroy(struct iio_channels_mask *mask); + + /** @brief Get a mask of the currently enabled channels * @param dev A pointer to an iio_device structure * @return A pointer to an iio_channels_mask structure */ diff --git a/mask.c b/mask.c index 39f9c96c6..c7be62d92 100644 --- a/mask.c +++ b/mask.c @@ -36,3 +36,8 @@ int iio_channels_mask_copy(struct iio_channels_mask *dst, return 0; } + +void iio_channels_mask_destroy(struct iio_channels_mask *mask) +{ + free(mask); +}