cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob a9245c1742ec40654e50b7277610989116b5770a 283 bytes (raw)
$ git show ccan-list:ccan/str/str.c	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 
/* CC0 (Public domain) - see LICENSE file for details */
#include <ccan/str/str.h>

size_t strcount(const char *haystack, const char *needle)
{
	size_t i = 0, nlen = strlen(needle);

	while ((haystack = strstr(haystack, needle)) != NULL) {
		i++;
		haystack += nlen;
	}
	return i;
}

git clone https://yhbt.net/cmogstored.git