From d452c6be2baae83d61edcc33b3407d5d84f1eca2 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 6 Jan 2017 10:51:17 +0100 Subject: [PATCH] gpiod.h: shuffle some declarations Move the opaque structs declarations to the top of the file - they are ignored by doxygen anyway and that way we can move gpiod_line_get_chip() to the line defgroup. Signed-off-by: Bartosz Golaszewski --- gpiod.h | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/gpiod.h b/gpiod.h index 74ba586..5b6d922 100644 --- a/gpiod.h +++ b/gpiod.h @@ -28,6 +28,10 @@ extern "C" { #endif +struct gpiod_chip; +struct gpiod_line; +struct gpiod_chip_iter; + /** * @defgroup __common__ Common helper macros * @{ @@ -160,11 +164,6 @@ enum { */ #define GPIOD_REQUEST_MAX_LINES 64 -/** - * @brief Opaque structure representing a single GPIO line. - */ -struct gpiod_line; - /** * @brief Helper structure for storing a set of GPIO line objects. * @@ -406,6 +405,13 @@ int gpiod_line_set_value_bulk(struct gpiod_line_bulk *line_bulk, */ struct gpiod_line * gpiod_line_find_by_name(const char *name) GPIOD_API; +/** + * @brief Get the handle to the GPIO chip controlling this line. + * @param line The GPIO line object. + * @return Pointer to the GPIO chip handle controlling this line. + */ +struct gpiod_chip * gpiod_line_get_chip(struct gpiod_line *line) GPIOD_API; + /** * @defgroup __line_events__ Line event operations * @{ @@ -515,11 +521,6 @@ int gpiod_line_event_get_fd(struct gpiod_line *line) GPIOD_API; * Functions and data structures dealing with GPIO chips. */ -/** - * @brief Opaque structure representing a single GPIO line. - */ -struct gpiod_chip; - /** * @brief Open a gpiochip by path. * @param path Path to the gpiochip device file. @@ -595,13 +596,6 @@ gpiod_chip_get_line(struct gpiod_chip *chip, unsigned int offset) GPIOD_API; /* FIXME This shouldn't be needed. Make it private maybe? */ int gpiod_chip_get_fd(struct gpiod_chip *chip) GPIOD_API; -/** - * @brief Get the handle to the GPIO chip controlling this line. - * @param line The GPIO line object. - * @return Pointer to the GPIO chip handle controlling this line. - */ -struct gpiod_chip * gpiod_line_get_chip(struct gpiod_line *line) GPIOD_API; - /** * @} * @@ -612,11 +606,6 @@ struct gpiod_chip * gpiod_line_get_chip(struct gpiod_line *line) GPIOD_API; * chips and lines. */ -/** - * @brief Opaque structure representing a chip iterator. - */ -struct gpiod_chip_iter; - /** * @brief Create a new gpiochip iterator. * @return Pointer to a new chip iterator object or NULL if an error occurred. -- 2.30.2