From: Bartosz Golaszewski Date: Wed, 1 Mar 2017 21:16:56 +0000 (+0100) Subject: core: remove doxygen hack X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d15edb03d1ee31e1565faf8e1b6bff0f06f045f1;p=qemu-gpiodev%2Flibgpiod.git core: remove doxygen hack Keep gpiod.h clean - pull _gpiod_line_event_request_type() into core.c and un-inline the gpiod_line_event_request_*() routines. Signed-off-by: Bartosz Golaszewski --- diff --git a/Doxyfile b/Doxyfile index dbf877d..c9e2738 100644 --- a/Doxyfile +++ b/Doxyfile @@ -58,7 +58,6 @@ COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = SEARCHENGINE = NO ENABLE_PREPROCESSING = YES -PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS # HTML output GENERATE_HTML = YES diff --git a/include/gpiod.h b/include/gpiod.h index 4adf4c2..2750f49 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -665,12 +665,6 @@ struct gpiod_line_event { int gpiod_line_event_request(struct gpiod_line *line, struct gpiod_line_evreq_config *config) GPIOD_API; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -int _gpiod_line_event_request_type(struct gpiod_line *line, - const char *consumer, bool active_low, - int type) GPIOD_API; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - /** * @brief Request rising edge event notifications on a single line. * @param line GPIO line object. @@ -678,13 +672,9 @@ int _gpiod_line_event_request_type(struct gpiod_line *line, * @param active_low Active state of the line - true if low. * @return 0 if the operation succeeds, -1 on failure. */ -static inline int gpiod_line_event_request_rising(struct gpiod_line *line, - const char *consumer, - bool active_low) -{ - return _gpiod_line_event_request_type(line, consumer, active_low, - GPIOD_EVENT_RISING_EDGE); -} +int gpiod_line_event_request_rising(struct gpiod_line *line, + const char *consumer, + bool active_low) GPIOD_API; /** * @brief Request falling edge event notifications on a single line. @@ -693,13 +683,9 @@ static inline int gpiod_line_event_request_rising(struct gpiod_line *line, * @param active_low Active state of the line - true if low. * @return 0 if the operation succeeds, -1 on failure. */ -static inline int gpiod_line_event_request_falling(struct gpiod_line *line, - const char *consumer, - bool active_low) -{ - return _gpiod_line_event_request_type(line, consumer, active_low, - GPIOD_EVENT_FALLING_EDGE); -} +int gpiod_line_event_request_falling(struct gpiod_line *line, + const char *consumer, + bool active_low) GPIOD_API; /** * @brief Request all event type notifications on a single line. @@ -708,13 +694,9 @@ static inline int gpiod_line_event_request_falling(struct gpiod_line *line, * @param active_low Active state of the line - true if low. * @return 0 if the operation succeeds, -1 on failure. */ -static inline int gpiod_line_event_request_all(struct gpiod_line *line, - const char *consumer, - bool active_low) -{ - return _gpiod_line_event_request_type(line, consumer, active_low, - GPIOD_EVENT_BOTH_EDGES); -} +int gpiod_line_event_request_all(struct gpiod_line *line, + const char *consumer, + bool active_low) GPIOD_API; /** * @brief Stop listening for events and release the line. diff --git a/src/lib/core.c b/src/lib/core.c index d7f1547..4d5be57 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -838,9 +838,9 @@ int gpiod_line_event_request(struct gpiod_line *line, return 0; } -int _gpiod_line_event_request_type(struct gpiod_line *line, - const char *consumer, bool active_low, - int type) +static int line_event_request_type(struct gpiod_line *line, + const char *consumer, + bool active_low, int type) { struct gpiod_line_evreq_config config = { .consumer = consumer, @@ -852,6 +852,27 @@ int _gpiod_line_event_request_type(struct gpiod_line *line, return gpiod_line_event_request(line, &config); } +int gpiod_line_event_request_rising(struct gpiod_line *line, + const char *consumer, bool active_low) +{ + return line_event_request_type(line, consumer, active_low, + GPIOD_EVENT_RISING_EDGE); +} + +int gpiod_line_event_request_falling(struct gpiod_line *line, + const char *consumer, bool active_low) +{ + return line_event_request_type(line, consumer, active_low, + GPIOD_EVENT_FALLING_EDGE); +} + +int gpiod_line_event_request_all(struct gpiod_line *line, + const char *consumer, bool active_low) +{ + return line_event_request_type(line, consumer, active_low, + GPIOD_EVENT_BOTH_EDGES); +} + void gpiod_line_event_release(struct gpiod_line *line) { close(line_get_event_fd(line));