diff options
Diffstat (limited to 'tools/iio/iio_utils.h')
-rw-r--r-- | tools/iio/iio_utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/iio/iio_utils.h b/tools/iio/iio_utils.h index e3503bfe538b..780f2014f8fa 100644 --- a/tools/iio/iio_utils.h +++ b/tools/iio/iio_utils.h | |||
@@ -52,6 +52,13 @@ struct iio_channel_info { | |||
52 | unsigned location; | 52 | unsigned location; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | static inline int iioutils_check_suffix(const char *str, const char *suffix) | ||
56 | { | ||
57 | return strlen(str) >= strlen(suffix) && | ||
58 | strncmp(str+strlen(str)-strlen(suffix), | ||
59 | suffix, strlen(suffix)) == 0; | ||
60 | } | ||
61 | |||
55 | int iioutils_break_up_name(const char *full_name, char **generic_name); | 62 | int iioutils_break_up_name(const char *full_name, char **generic_name); |
56 | int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used, | 63 | int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used, |
57 | unsigned *shift, uint64_t *mask, unsigned *be, | 64 | unsigned *shift, uint64_t *mask, unsigned *be, |