summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/skalibs/bytestr.h6
-rw-r--r--src/libstddjb/case_diffn.c (renamed from src/libstddjb/case_diffb.c)11
2 files changed, 4 insertions, 13 deletions
diff --git a/src/include/skalibs/bytestr.h b/src/include/skalibs/bytestr.h
index fd602e0..b241197 100644
--- a/src/include/skalibs/bytestr.h
+++ b/src/include/skalibs/bytestr.h
@@ -25,7 +25,7 @@
#define str_diffn strncmp
#define str_copy(to, from) strlen(strcpy(to, from))
#define case_diffs strcasecmp
-#define case_diffb(a, n, b) strncasecmp(a, (b), n)
+#define case_diffn strncasecmp
#else
@@ -39,11 +39,10 @@ extern int str_diff (char const *, char const *) gccattr_pure ;
extern int str_diffn (char const *, char const *, unsigned int) gccattr_pure ;
extern unsigned int str_copy (char *, char const *) ;
extern int case_diffs (char const *, char const *) gccattr_pure ;
-extern int case_diffb (char const *, unsigned int, char const *) gccattr_pure ;
+extern int case_diffn (char const *, char const *, unsigned int) gccattr_pure ;
#endif
-
extern unsigned int byte_chr (char const *, unsigned int, int) gccattr_pure ;
extern unsigned int byte_rchr (char const *, unsigned int, int) gccattr_pure ;
extern unsigned int byte_in (char const *, unsigned int, char const *, unsigned int) gccattr_pure ;
@@ -61,6 +60,7 @@ extern void case_lowers (char *) ;
extern void case_lowerb (char *, unsigned int) ;
extern void case_uppers (char *) ;
extern void case_upperb (char *, unsigned int) ;
+#define case_diffb(a, n, b) case_diffn(a, (b), n)
#define case_equals(a, b) (!case_diffs(a, b))
#define case_equalb(a, n, b) (!case_diffb(a, n, b))
#define case_starts(s, t) case_startb(s, str_len(s), t)
diff --git a/src/libstddjb/case_diffb.c b/src/libstddjb/case_diffn.c
index 47e10bb..0e75aa5 100644
--- a/src/libstddjb/case_diffb.c
+++ b/src/libstddjb/case_diffn.c
@@ -5,7 +5,7 @@
#ifdef SKALIBS_FLAG_REPLACE_LIBC
-int case_diffb (char const *s, unsigned int len, char const *t)
+int case_diffn (char const *s, char const *t, unsigned int len)
{
register unsigned char x = 0, y = 0 ;
unsigned char const d = 'a' - 'A' ;
@@ -20,13 +20,4 @@ int case_diffb (char const *s, unsigned int len, char const *t)
return (int)(x - y) ;
}
-#else
-
-#include <strings.h>
-
-int case_diffb (char const *s, unsigned int len, char const *t)
-{
- return strncasecmp(s, t, len) ;
-}
-
#endif