1 /* $NetBSD: option.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $ */ 2 3 /* SPDX-License-Identifier: MIT */ 4 #ifndef __NVKM_OPTION_H__ 5 #define __NVKM_OPTION_H__ 6 #include <core/os.h> 7 8 const char *nvkm_stropt(const char *optstr, const char *opt, int *len); 9 bool nvkm_boolopt(const char *optstr, const char *opt, bool value); 10 long nvkm_longopt(const char *optstr, const char *opt, long value); 11 int nvkm_dbgopt(const char *optstr, const char *sub); 12 13 /* compares unterminated string 'str' with zero-terminated string 'cmp' */ 14 static inline int 15 strncasecmpz(const char *str, const char *cmp, size_t len) 16 { 17 if (strlen(cmp) != len) 18 return len; 19 return strncasecmp(str, cmp, len); 20 } 21 #endif 22