mem: Implement memrchr()
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Oct 2014 11:56:53 +0000 (13:56 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 27 Oct 2014 05:43:16 +0000 (16:13 +1030)
commit40b45c4cfbf110a8e790366302ff43fa94dc8daa
treef874b376a3b4825736e5a351edcae14e0344c8e1
parent2ab3ac5b30c1cc58c0846e05c5943c03e7111ad8
mem: Implement memrchr()

The memrchr() function, which works like memchr(), but searches from the
back of the region to the front is implemented in the GNU C library, but
isn't standard.

This patch adds an implementation of the function to the mem module, when
it's not available in the system C library.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/mem/mem.c
ccan/mem/mem.h
ccan/mem/test/api.c
tools/configurator/configurator.c