1 #ifndef __NVKM_OPTION_H__
2 #define __NVKM_OPTION_H__
3 #include <core/os.h>
4
5 const char *nvkm_stropt(const char *optstr, const char *opt, int *len);
6 bool nvkm_boolopt(const char *optstr, const char *opt, bool value);
7 int nvkm_dbgopt(const char *optstr, const char *sub);
8
9 /* compares unterminated string 'str' with zero-terminated string 'cmp' */
10 static inline int
strncasecmpz(const char * str,const char * cmp,size_t len)11 strncasecmpz(const char *str, const char *cmp, size_t len)
12 {
13 if (strlen(cmp) != len)
14 return len;
15 return strncasecmp(str, cmp, len);
16 }
17 #endif
18