From: Bartosz Golaszewski Date: Sun, 24 Sep 2017 20:06:31 +0000 (+0200) Subject: core: add gpiod_line_bulk_get_line() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=52bfc4f2aab3d35a9171cb1b5f7409abe98646cc;p=qemu-gpiodev%2Flibgpiod.git core: add gpiod_line_bulk_get_line() Add a getter function for retrieving line handles from bulk objects. Signed-off-by: Bartosz Golaszewski --- diff --git a/include/gpiod.h b/include/gpiod.h index fb173be..6946a33 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -373,6 +373,18 @@ static inline void gpiod_line_bulk_add(struct gpiod_line_bulk *bulk, bulk->lines[bulk->num_lines++] = line; } +/** + * @brief Retrieve the line handle from a line bulk object at given offset. + * @param bulk Line bulk object. + * @param offset Line offset. + * @return Line handle at given offset. + */ +static inline struct gpiod_line * +gpiod_line_bulk_get_line(struct gpiod_line_bulk *bulk, unsigned int offset) +{ + return bulk->lines[offset]; +} + /** * @brief Read the GPIO line offset. * @param line GPIO line object.