Lines Matching full:prefix
210 * strstarts - does @str start with @prefix?
212 * @prefix: prefix to look for.
214 static inline bool strstarts(const char *str, const char *prefix) in strstarts() argument
216 return strncmp(str, prefix, strlen(prefix)) == 0; in strstarts()
284 * str_has_prefix - Test if a string has a given prefix
286 * @prefix: The string to see if @str starts with
288 * A common way to test a prefix of a string is to do:
289 * strncmp(str, prefix, sizeof(prefix) - 1)
291 * But this can lead to bugs due to typos, or if prefix is a pointer
295 * * strlen(@prefix) if @str starts with @prefix
296 * * 0 if @str does not start with @prefix
298 static __always_inline size_t str_has_prefix(const char *str, const char *prefix) in str_has_prefix() argument
300 size_t len = strlen(prefix); in str_has_prefix()
301 return strncmp(str, prefix, len) == 0 ? len : 0; in str_has_prefix()