From 992931f06cf25d24fe74b4c617753aef2de70426 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 22 Oct 2014 13:56:51 +0200 Subject: [PATCH] mem: Rename memmem module to mem Currently the 'memmem' module does nothing but provide an implementation of the memmem() function if it is missing from the standard C library. However there are other functions (e.g. memrchr()) also missing from some C library implementations, so rename the module to mem to allow future inclusion of other functions. This also updates the rfc822 module - the only existing user of the memmem module - to use the new name. Signed-off-by: David Gibson --- Makefile-ccan | 2 +- ccan/{memmem => mem}/LICENSE | 0 ccan/{memmem => mem}/_info | 7 ++++--- ccan/{memmem/memmem.c => mem/mem.c} | 2 +- ccan/{memmem/memmem.h => mem/mem.h} | 6 +++--- ccan/{memmem => mem}/test/run.c | 2 +- ccan/rfc822/_info | 2 +- ccan/rfc822/rfc822.c | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) rename ccan/{memmem => mem}/LICENSE (100%) rename ccan/{memmem => mem}/_info (62%) rename ccan/{memmem/memmem.c => mem/mem.c} (93%) rename ccan/{memmem/memmem.h => mem/mem.h} (76%) rename ccan/{memmem => mem}/test/run.c (94%) diff --git a/Makefile-ccan b/Makefile-ccan index f97ff20d..543a3452 100644 --- a/Makefile-ccan +++ b/Makefile-ccan @@ -72,7 +72,7 @@ MODS_WITH_SRC := antithread \ lqueue \ lstack \ md4 \ - memmem \ + mem \ net \ nfs \ noerr \ diff --git a/ccan/memmem/LICENSE b/ccan/mem/LICENSE similarity index 100% rename from ccan/memmem/LICENSE rename to ccan/mem/LICENSE diff --git a/ccan/memmem/_info b/ccan/mem/_info similarity index 62% rename from ccan/memmem/_info rename to ccan/mem/_info index 3361be97..19b22287 100644 --- a/ccan/memmem/_info +++ b/ccan/mem/_info @@ -3,10 +3,11 @@ #include /** - * memmem - Trivial module providing a memmem() implementation + * mem - Provide mem*() functions if missing from C library * - * This code implements memmem() if it's not alreayd available in the - * C library. + * This code implements some string.h mem*() functions if they're not + * already available in the C library. Functions included are: + * memmem() * * License: CC0 */ diff --git a/ccan/memmem/memmem.c b/ccan/mem/mem.c similarity index 93% rename from ccan/memmem/memmem.c rename to ccan/mem/mem.c index 48a6de2b..ce675ff0 100644 --- a/ccan/memmem/memmem.c +++ b/ccan/mem/mem.c @@ -3,7 +3,7 @@ #include "config.h" #include -#include +#include #if !HAVE_MEMMEM void *memmem(const void *haystack, size_t haystacklen, diff --git a/ccan/memmem/memmem.h b/ccan/mem/mem.h similarity index 76% rename from ccan/memmem/memmem.h rename to ccan/mem/mem.h index 4da53940..771d0527 100644 --- a/ccan/memmem/memmem.h +++ b/ccan/mem/mem.h @@ -1,6 +1,6 @@ /* CC0 (Public domain) - see LICENSE file for details */ -#ifndef CCAN_MEMMEM_H -#define CCAN_MEMMEM_H +#ifndef CCAN_MEM_H +#define CCAN_MEM_H #include "config.h" @@ -11,4 +11,4 @@ void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); #endif -#endif /* CCAN_MEMMEM_H */ +#endif /* CCAN_MEM_H */ diff --git a/ccan/memmem/test/run.c b/ccan/mem/test/run.c similarity index 94% rename from ccan/memmem/test/run.c rename to ccan/mem/test/run.c index af9aac50..3efd1d81 100644 --- a/ccan/memmem/test/run.c +++ b/ccan/mem/test/run.c @@ -1,5 +1,5 @@ #include -#include +#include #include int main(void) diff --git a/ccan/rfc822/_info b/ccan/rfc822/_info index 7c3ca08e..680f4991 100644 --- a/ccan/rfc822/_info +++ b/ccan/rfc822/_info @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) printf("ccan/list\n"); printf("ccan/str\n"); printf("ccan/bytestring\n"); - printf("ccan/memmem\n"); + printf("ccan/mem\n"); return 0; } diff --git a/ccan/rfc822/rfc822.c b/ccan/rfc822/rfc822.c index 636d29a6..2d23b9ca 100644 --- a/ccan/rfc822/rfc822.c +++ b/ccan/rfc822/rfc822.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #ifdef TAL_USE_TALLOC -- 2.39.2