diff options
author | pjd <pjd@FreeBSD.org> | 2007-04-06 11:18:57 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-04-06 11:18:57 +0000 |
commit | 6be01b7ba0845eb5a6d3772d0a9209aa967b19e7 (patch) | |
tree | 96f736347021ae2fbce29b0d7b935955986ff02d /sys/compat | |
parent | d3990a3c119a46ca4256c2b8e06b780bf83d37d7 (diff) | |
download | FreeBSD-src-6be01b7ba0845eb5a6d3772d0a9209aa967b19e7.zip FreeBSD-src-6be01b7ba0845eb5a6d3772d0a9209aa967b19e7.tar.gz |
We have strcasecmp() in libkern now.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/ndis/kern_ndis.c | 3 | ||||
-rw-r--r-- | sys/compat/ndis/ndis_var.h | 2 | ||||
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 51 | ||||
-rw-r--r-- | sys/compat/ndis/subr_pe.c | 2 |
4 files changed, 3 insertions, 55 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index 189636d..4957835 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -323,8 +323,7 @@ ndis_create_sysctls(arg) TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { #endif oidp = e->entry; - if (ndis_strcasecmp(oidp->oid_name, - vals->nc_cfgkey) == 0) + if (strcasecmp(oidp->oid_name, vals->nc_cfgkey) == 0) break; oidp = NULL; } diff --git a/sys/compat/ndis/ndis_var.h b/sys/compat/ndis/ndis_var.h index 24f147d..c53b429 100644 --- a/sys/compat/ndis/ndis_var.h +++ b/sys/compat/ndis/ndis_var.h @@ -1746,8 +1746,6 @@ extern int ndis_destroy_dma(void *); extern int ndis_create_sysctls(void *); extern int ndis_add_sysctl(void *, char *, char *, char *, int); extern int ndis_flush_sysctls(void *); -extern int ndis_strcasecmp(const char *, const char *); -extern int ndis_strncasecmp(const char *, const char *, size_t); extern uint32_t NdisAddDevice(driver_object *, device_object *); extern void NdisAllocatePacketPool(ndis_status *, diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 3ed857b..d86b8f4 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -613,53 +613,6 @@ ndis_encode_parm(block, oid, type, parm) return(NDIS_STATUS_SUCCESS); } -int -ndis_strcasecmp(s1, s2) - const char *s1; - const char *s2; -{ - char a, b; - - /* - * In the kernel, toupper() is a macro. Have to be careful - * not to use pointer arithmetic when passing it arguments. - */ - - while(1) { - a = *s1; - b = *s2++; - if (toupper(a) != toupper(b)) - break; - if (*s1++ == '\0') - return(0); - } - - return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); -} - -int -ndis_strncasecmp(s1, s2, n) - const char *s1; - const char *s2; - size_t n; -{ - char a, b; - - if (n != 0) { - do { - a = *s1; - b = *s2++; - if (toupper(a) != toupper(b)) - return (*(const unsigned char *)s1 - - *(const unsigned char *)(s2 - 1)); - if (*s1++ == '\0') - break; - } while (--n != 0); - } - - return(0); -} - static void NdisReadConfiguration(status, parm, cfg, key, type) ndis_status *status; @@ -700,7 +653,7 @@ NdisReadConfiguration(status, parm, cfg, key, type) TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { #endif oidp = e->entry; - if (ndis_strcasecmp(oidp->oid_name, keystr) == 0) { + if (strcasecmp(oidp->oid_name, keystr) == 0) { if (strcmp((char *)oidp->oid_arg1, "UNSET") == 0) { RtlFreeAnsiString(&as); *status = NDIS_STATUS_FAILURE; @@ -809,7 +762,7 @@ NdisWriteConfiguration(status, cfg, key, parm) TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { #endif oidp = e->entry; - if (ndis_strcasecmp(oidp->oid_name, keystr) == 0) { + if (strcasecmp(oidp->oid_name, keystr) == 0) { /* Found it, set the value. */ strcpy((char *)oidp->oid_arg1, val); RtlFreeAnsiString(&as); diff --git a/sys/compat/ndis/subr_pe.c b/sys/compat/ndis/subr_pe.c index ee8c0fe..1235ab0 100644 --- a/sys/compat/ndis/subr_pe.c +++ b/sys/compat/ndis/subr_pe.c @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include <sys/errno.h> #ifdef _KERNEL #include <sys/systm.h> -extern int ndis_strncasecmp(const char *, const char *, size_t); -#define strncasecmp(a, b, c) ndis_strncasecmp(a, b, c) #else #include <stdio.h> #include <stddef.h> |