summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-04-08 12:28:47 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-04-08 12:28:47 +0000
commit73ebb5709dc2a5aaee1e676a3c1b0bb7cebcd392 (patch)
tree5b90934904fa42b1b979b83bd223b3e94bf3676f /src/include
parent90767eae542f72b7069a3575bc55944cebc749b6 (diff)
downloadskalibs-73ebb5709dc2a5aaee1e676a3c1b0bb7cebcd392.tar.xz
- added str_nlen()
- various fixes for --enable-libc-replacements
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/bytestr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/skalibs/bytestr.h b/src/include/skalibs/bytestr.h
index 52e9bd6..ff2851c 100644
--- a/src/include/skalibs/bytestr.h
+++ b/src/include/skalibs/bytestr.h
@@ -19,6 +19,7 @@
#define byte_diff(a, n, b) memcmp(a, (b), n)
#define byte_zero(p, n) memset(p, 0, n)
#define str_len(s) strlen(s)
+#define str_nlen(s, max) strnlen(s, max)
#define str_diff(a, b) strcmp(a, b)
#define str_diffn(a, b, n) strncmp(a, b, n)
#define str_copy(to, from) strlen(strcpy(to, from))
@@ -30,6 +31,7 @@ extern void byte_copyr (char *, unsigned int, char const *) ;
extern int byte_diff (char const *, unsigned int, char const *) gccattr_pure ;
extern void byte_zero (void *, unsigned int) ;
extern unsigned int str_len (char const *) gccattr_pure ;
+#define str_nlen(s, max) byte_chr(s, (max), 0)
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 *) ;