]> git.karo-electronics.de Git - linux-beck.git/blobdiff - tools/iio/iio_utils.h
Merge branch 'drm-next-4.7' of git://people.freedesktop.org/~agd5f/linux into drm...
[linux-beck.git] / tools / iio / iio_utils.h
index e3503bfe538b951102449e24e2e90e1a00fe407b..780f2014f8fa224e761f312fd7124c5d73e70ce2 100644 (file)
@@ -52,6 +52,13 @@ struct iio_channel_info {
        unsigned location;
 };
 
+static inline int iioutils_check_suffix(const char *str, const char *suffix)
+{
+       return strlen(str) >= strlen(suffix) &&
+               strncmp(str+strlen(str)-strlen(suffix),
+                       suffix, strlen(suffix)) == 0;
+}
+
 int iioutils_break_up_name(const char *full_name, char **generic_name);
 int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
                      unsigned *shift, uint64_t *mask, unsigned *be,