summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-05-16 00:52:36 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-05-16 00:52:36 +0000
commitf476227930793f94e6ca9bd268b76bbf5c4f29c3 (patch)
tree733a6ac063c410f0012e7a6426d2f7d37d990adc /src/include
parentd85c1a21f3c3f3229d958aabc744756c3fa811b4 (diff)
downloadskalibs-f476227930793f94e6ca9bd268b76bbf5c4f29c3.tar.xz
C macros suck. Rewrote the case_diffb thing.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/bytestr.h6
1 files changed, 3 insertions, 3 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)