This source file includes following definitions.
- check_prefix
1
2
3
4
5
6
7
8
9
10
11
12 #ifndef _GPIO_UTILS_H_
13 #define _GPIO_UTILS_H_
14
15 #include <string.h>
16
17 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
18
19 static inline int check_prefix(const char *str, const char *prefix)
20 {
21 return strlen(str) > strlen(prefix) &&
22 strncmp(str, prefix, strlen(prefix)) == 0;
23 }
24
25 int gpiotools_request_linehandle(const char *device_name, unsigned int *lines,
26 unsigned int nlines, unsigned int flag,
27 struct gpiohandle_data *data,
28 const char *consumer_label);
29 int gpiotools_set_values(const int fd, struct gpiohandle_data *data);
30 int gpiotools_get_values(const int fd, struct gpiohandle_data *data);
31 int gpiotools_release_linehandle(const int fd);
32
33 int gpiotools_get(const char *device_name, unsigned int line);
34 int gpiotools_gets(const char *device_name, unsigned int *lines,
35 unsigned int nlines, struct gpiohandle_data *data);
36 int gpiotools_set(const char *device_name, unsigned int line,
37 unsigned int value);
38 int gpiotools_sets(const char *device_name, unsigned int *lines,
39 unsigned int nlines, struct gpiohandle_data *data);
40
41 #endif