Browse Source

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 <david@gibson.dropbear.id.au>
David Gibson 11 years ago
parent
commit
992931f06c
8 changed files with 12 additions and 11 deletions
  1. 1 1
      Makefile-ccan
  2. 0 0
      ccan/mem/LICENSE
  3. 4 3
      ccan/mem/_info
  4. 1 1
      ccan/mem/mem.c
  5. 3 3
      ccan/mem/mem.h
  6. 1 1
      ccan/mem/test/run.c
  7. 1 1
      ccan/rfc822/_info
  8. 1 1
      ccan/rfc822/rfc822.c

+ 1 - 1
Makefile-ccan

@@ -72,7 +72,7 @@ MODS_WITH_SRC := antithread \
 	lqueue \
 	lstack \
 	md4 \
-	memmem \
+	mem \
 	net \
 	nfs \
 	noerr \

+ 0 - 0
ccan/memmem/LICENSE → ccan/mem/LICENSE


+ 4 - 3
ccan/memmem/_info → ccan/mem/_info

@@ -3,10 +3,11 @@
 #include <string.h>
 
 /**
- * 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
  */

+ 1 - 1
ccan/memmem/memmem.c → ccan/mem/mem.c

@@ -3,7 +3,7 @@
 #include "config.h"
 
 #include <string.h>
-#include <ccan/memmem/memmem.h>
+#include <ccan/mem/mem.h>
 
 #if !HAVE_MEMMEM
 void *memmem(const void *haystack, size_t haystacklen,

+ 3 - 3
ccan/memmem/memmem.h → 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 */

+ 1 - 1
ccan/memmem/test/run.c → ccan/mem/test/run.c

@@ -1,5 +1,5 @@
 #include <ccan/array_size/array_size.h>
-#include <ccan/memmem/memmem.h>
+#include <ccan/mem/mem.h>
 #include <ccan/tap/tap.h>
 
 int main(void)

+ 1 - 1
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;
 	}
 

+ 1 - 1
ccan/rfc822/rfc822.c

@@ -8,7 +8,7 @@
 #include <ccan/list/list.h>
 #include <stdio.h>
 
-#include <ccan/memmem/memmem.h>
+#include <ccan/mem/mem.h>
 #include <ccan/rfc822/rfc822.h>
 
 #ifdef TAL_USE_TALLOC