From 620d759f49f4b648d0fa4a84e67f1cecbbdd0f06 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Apr 2006 19:50:13 +0000 Subject: r15298: Fix the build using a few hacks in the build system. Recursive dependencies are now forbidden (the build system will bail out if there are any). I've split up auth_sam.c into auth_sam.c and sam.c. Andrew, please rename sam.c / move its contents to whatever/wherever you think suits best. (This used to be commit 6646384aaf3e7fa2aa798c3e564b94b0617ec4d0) --- source4/lib/charset/util_unistr.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source4/lib/charset/util_unistr.c') diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c index faa1398eac..f55e390856 100644 --- a/source4/lib/charset/util_unistr.c +++ b/source4/lib/charset/util_unistr.c @@ -613,3 +613,22 @@ _PUBLIC_ void strupper_m(char *s) *d = 0; } + +/** + Find the number of 'c' chars in a string +**/ +_PUBLIC_ size_t count_chars_w(const char *s, char c) +{ + size_t count = 0; + + while (*s) { + size_t size; + codepoint_t c2 = next_codepoint(s, &size); + if (c2 == c) count++; + s += size; + } + + return count; +} + + -- cgit