diff --git a/eeshow/misc/util.h b/eeshow/misc/util.h index e9bc4f3..b71a8ea 100644 --- a/eeshow/misc/util.h +++ b/eeshow/misc/util.h @@ -14,8 +14,9 @@ #ifndef MISC_UTIL_H #define MISC_UTIL_H -#include +#include #include +#include #include @@ -63,4 +64,10 @@ #define unsupported(s) \ fprintf(stderr, __FILE__ ":%d: unsupported: " s "\n", __LINE__) + +static inline bool strbegins(const char *s, const char *prefix) +{ + return !strncmp(s, prefix, strlen(prefix)); +} + #endif /* !MISC_UTIL_H */