simple-api: use correct prefixes for callback typedefs
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 11 Oct 2017 12:20:54 +0000 (14:20 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 11 Oct 2017 12:20:54 +0000 (14:20 +0200)
We want to have all simple-api-related symbols prefixed with
gpiod_simple_.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
include/gpiod.h
src/lib/simple.c
src/tools/gpioset.c

index 702fb87fa1bdcf1516e9d70d5890453ad87af38f..d1efd62d66d63fe351f26ddfa94121726f564ef0 100644 (file)
@@ -95,7 +95,7 @@ int gpiod_simple_get_value_multiple(const char *consumer, const char *device,
 /**
  * @brief Simple set value callback signature.
  */
-typedef void (*gpiod_set_value_cb)(void *);
+typedef void (*gpiod_simple_set_value_cb)(void *);
 
 /**
  * @brief Set value of a single GPIO line.
@@ -112,7 +112,7 @@ typedef void (*gpiod_set_value_cb)(void *);
  */
 int gpiod_simple_set_value(const char *consumer, const char *device,
                           unsigned int offset, int value, bool active_low,
-                          gpiod_set_value_cb cb, void *data) GPIOD_API;
+                          gpiod_simple_set_value_cb cb, void *data) GPIOD_API;
 
 /**
  * @brief Set values of a set of a set of GPIO lines.
@@ -130,7 +130,8 @@ int gpiod_simple_set_value(const char *consumer, const char *device,
 int gpiod_simple_set_value_multiple(const char *consumer, const char *device,
                                    const unsigned int *offsets,
                                    const int *values, unsigned int num_lines,
-                                   bool active_low, gpiod_set_value_cb cb,
+                                   bool active_low,
+                                   gpiod_simple_set_value_cb cb,
                                    void *data) GPIOD_API;
 
 /**
@@ -162,8 +163,8 @@ enum {
  * GPIO line offset (unsigned int), event timestamp (const struct timespec *)
  * and a pointer to user data (void *).
  */
-typedef int (*gpiod_event_handle_cb)(int, unsigned int,
-                                    const struct timespec *, void *);
+typedef int (*gpiod_simple_event_handle_cb)(int, unsigned int,
+                                           const struct timespec *, void *);
 
 /**
  * @brief Return status values that the simple event poll callback can return.
@@ -193,8 +194,9 @@ enum {
  * return an appropriate value that can be interpreted by the event loop
  * routine.
  */
-typedef int (*gpiod_event_poll_cb)(unsigned int, const int *, unsigned int *,
-                                  const struct timespec *, void *);
+typedef int (*gpiod_simple_event_poll_cb)(unsigned int,
+                                         const int *, unsigned int *,
+                                         const struct timespec *, void *);
 
 /**
  * @brief Wait for events on a single GPIO line.
@@ -214,8 +216,8 @@ typedef int (*gpiod_event_poll_cb)(unsigned int, const int *, unsigned int *,
 int gpiod_simple_event_loop(const char *consumer, const char *device,
                            unsigned int offset, bool active_low,
                            const struct timespec *timeout,
-                           gpiod_event_poll_cb poll_cb,
-                           gpiod_event_handle_cb event_cb,
+                           gpiod_simple_event_poll_cb poll_cb,
+                           gpiod_simple_event_handle_cb event_cb,
                            void *data) GPIOD_API;
 
 /**
@@ -237,8 +239,8 @@ int gpiod_simple_event_loop_multiple(const char *consumer, const char *device,
                                     const unsigned int *offsets,
                                     unsigned int num_lines, bool active_low,
                                     const struct timespec *timeout,
-                                    gpiod_event_poll_cb poll_cb,
-                                    gpiod_event_handle_cb event_cb,
+                                    gpiod_simple_event_poll_cb poll_cb,
+                                    gpiod_simple_event_handle_cb event_cb,
                                     void *data) GPIOD_API;
 
 /**
index 88fdeff8def4af40d3ab3456df638d238baea07b..905e1d6613bf57f7d8fd4ffe9e8c9ff5c0c99d7c 100644 (file)
@@ -79,7 +79,7 @@ int gpiod_simple_get_value_multiple(const char *consumer, const char *device,
 
 int gpiod_simple_set_value(const char *consumer, const char *device,
                           unsigned int offset, int value, bool active_low,
-                          gpiod_set_value_cb cb, void *data)
+                          gpiod_simple_set_value_cb cb, void *data)
 {
        return gpiod_simple_set_value_multiple(consumer, device, &offset,
                                               &value, 1, active_low,
@@ -89,7 +89,8 @@ int gpiod_simple_set_value(const char *consumer, const char *device,
 int gpiod_simple_set_value_multiple(const char *consumer, const char *device,
                                    const unsigned int *offsets,
                                    const int *values, unsigned int num_lines,
-                                   bool active_low, gpiod_set_value_cb cb,
+                                   bool active_low,
+                                   gpiod_simple_set_value_cb cb,
                                    void *data)
 {
        struct gpiod_line_bulk bulk;
@@ -171,8 +172,8 @@ static int basic_event_poll(unsigned int num_lines, const int *fds,
 int gpiod_simple_event_loop(const char *consumer, const char *device,
                            unsigned int offset, bool active_low,
                            const struct timespec *timeout,
-                           gpiod_event_poll_cb poll_cb,
-                           gpiod_event_handle_cb event_cb,
+                           gpiod_simple_event_poll_cb poll_cb,
+                           gpiod_simple_event_handle_cb event_cb,
                            void *data)
 {
        return gpiod_simple_event_loop_multiple(consumer, device, &offset, 1,
@@ -184,8 +185,8 @@ int gpiod_simple_event_loop_multiple(const char *consumer, const char *device,
                                     const unsigned int *offsets,
                                     unsigned int num_lines, bool active_low,
                                     const struct timespec *timeout,
-                                    gpiod_event_poll_cb poll_cb,
-                                    gpiod_event_handle_cb event_cb,
+                                    gpiod_simple_event_poll_cb poll_cb,
+                                    gpiod_simple_event_handle_cb event_cb,
                                     void *data)
 {
        unsigned int i, event_offset, line_offset;
index 6096e7cf5ad73a66eb126e8b6ec4dfa554082ea9..d1a46c18f02a92d5b8b19158bfeb36766d7bf41d 100644 (file)
@@ -137,7 +137,7 @@ enum {
 struct mode_mapping {
        int id;
        const char *name;
-       gpiod_set_value_cb callback;
+       gpiod_simple_set_value_cb callback;
 };
 
 static const struct mode_mapping modes[] = {