[ccan] [PATCH 0/3] mem: extend with a few additional helpers similar to existing string-only functions

Cody P Schafer dev at codyps.com
Tue Aug 18 10:33:28 AEST 2015


This is essentially a rebased version of a patch I send out quite some time ago.

At the time, David indicated that it would probably make sense for bytestring
to call the plain mem-versions of these functions, so I've included a helper to
do that as well (and 1 patch to help ccanlint for bytestring pass a bit better).

The selection of mem* functions is entirely based on which ones I need for some
code I was writing, and they are in no way complete (notably, they include mem
variants of strpbrk instead of strspn variants as used in bytestring). I expect
the missing functions can be added as people find a need for them.

Cody P Schafer (3):
  mem: add mem helper functions
  bytestring: use newly added mem helpers
  bytestring: avoid compile_fail failure due to uninitialized warning

 ccan/bytestring/bytestring.h                     |   9 +-
 ccan/bytestring/test/compile_fail-BYTESTRING-2.c |   2 +
 ccan/mem/mem.c                                   |  23 ++++
 ccan/mem/mem.h                                   | 146 +++++++++++++++++++++++
 ccan/mem/test/api.c                              |  37 +++++-
 5 files changed, 210 insertions(+), 7 deletions(-)

-- 
2.5.0



More information about the ccan mailing list