summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-10-25 10:56:25 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-10-25 10:56:25 +0000
commitc9e549afa60dc3c4660e1de42a79f810299c2ade (patch)
tree83f0416c10cfab5079d9aee1a046ecaf5c73c2cc /src/include
parent9945737a8f0612b8980d9da3db3e6a4ab8a247f4 (diff)
downloadskalibs-c9e549afa60dc3c4660e1de42a79f810299c2ade.tar.xz
Better bigkv
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/bigkv.h7
-rw-r--r--src/include/skalibs/bytestr.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/include/skalibs/bigkv.h b/src/include/skalibs/bigkv.h
index a5b06c2..1b6229b 100644
--- a/src/include/skalibs/bigkv.h
+++ b/src/include/skalibs/bigkv.h
@@ -32,9 +32,10 @@ extern bigkv_t const bigkv_zero ;
#define bigkv_len(b) avltree_len(&(b)->map)
-extern int bigkv_init (bigkv_t *, char const *const *, char, char const *, char const *, uint32_t) ;
-#define bigkv_init_argv(b, argv) bigkv_init(b, (argv), '=', "--", "--", 0)
-#define bigkv_init_envp(b, envp) bigkv_init(b, (envp), '=', 0, 0, 0)
+#define bigkv_init(b) (*(b) = bigkv_zero)
+extern int bigkv_fill (bigkv_t *, char const *const *, char, char const *, char const *, uint32_t) ;
+#define bigkv_fill_argv(b, argv) bigkv_fill(b, (argv), '=', "--", "--", 0)
+#define bigkv_fill_envp(b, envp) bigkv_fill(b, (envp), '=', 0, 0, 0)
extern char const *bigkv_search (bigkv_t const *, char const *) ;
extern void bigkv_free (bigkv_t *) ;
diff --git a/src/include/skalibs/bytestr.h b/src/include/skalibs/bytestr.h
index a0dc027..35fe8d2 100644
--- a/src/include/skalibs/bytestr.h
+++ b/src/include/skalibs/bytestr.h
@@ -46,7 +46,7 @@ extern void case_uppers (char *) ;
extern void case_upperb (char *, size_t) ;
#define case_diffb(a, n, b) case_diffn(a, (b), n)
#define case_equals(a, b) (!strcasecmp(a, b))
-#define case_equalb(a, n, b) (!strcasecmp(a, (b), n))
+#define case_equalb(a, n, b) (!strncasecmp(a, (b), n))
#define case_starts(s, t) case_startb(s, strlen(s), t)
extern int case_startb (char const *, size_t, char const *) gccattr_pure ;
extern size_t case_str (char const *, char const *) gccattr_pure ;