]> git.ozlabs.org Git - ccan/commit
bytestring: Implement bytestring_spn() and bytestring_cspn()
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Oct 2014 13:37:22 +0000 (15:37 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 30 Oct 2014 14:04:56 +0000 (01:04 +1100)
commitb529270bf1ce198a310046d83c8e5d9356dcfe15
tree187c8489d3421345c09cc32786e4cb979e4ee3d7
parentf1e31c66572ef5997e08a1ecadf2e45b2fb04532
bytestring: Implement bytestring_spn() and bytestring_cspn()

Add bytestring_spn() and bytestring_cspn() functions which, in analogy to
strspn() and strcspn() return the lengths of initial sub-bytestrings which
either contain only a given set of bytes, or anything except a given set
of bytes.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/bytestring/bytestring.c [new file with mode: 0644]
ccan/bytestring/bytestring.h
ccan/bytestring/test/run.c