From 4dbdb7d8d52702fe404f0bdf2909e1f48404c737 Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 21 Jun 2018 22:47:02 +0200 Subject: [PATCH] Rethink the libc layout. --- lang/cem/libcc.ansi/build.lua | 2 +- lang/cem/libcc.ansi/pure/README.md | 3 +++ lang/cem/libcc.ansi/{src/core => pure/string}/memchr.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/memcmp.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/memcpy.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/memmove.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/memset.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strcat.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strchr.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strcmp.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strcoll.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strcpy.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strcspn.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strdup.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strlen.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strncat.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strncmp.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strncpy.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strpbrk.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strrchr.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strspn.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strstr.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strtok.c | 0 lang/cem/libcc.ansi/{src/core => pure/string}/strxfrm.c | 0 24 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 lang/cem/libcc.ansi/pure/README.md rename lang/cem/libcc.ansi/{src/core => pure/string}/memchr.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/memcmp.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/memcpy.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/memmove.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/memset.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strcat.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strchr.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strcmp.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strcoll.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strcpy.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strcspn.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strdup.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strlen.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strncat.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strncmp.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strncpy.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strpbrk.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strrchr.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strspn.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strstr.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strtok.c (100%) rename lang/cem/libcc.ansi/{src/core => pure/string}/strxfrm.c (100%) diff --git a/lang/cem/libcc.ansi/build.lua b/lang/cem/libcc.ansi/build.lua index 25011e729..fce3470af 100644 --- a/lang/cem/libcc.ansi/build.lua +++ b/lang/cem/libcc.ansi/build.lua @@ -33,7 +33,7 @@ for _, plat in ipairs(vars.plats) do srcs = { "+ctype_files", "+ctype_tab", - "./src/core/*.c", + "./pure/string/*.c", "./ctype/*.c", "./errno/*.c", "./locale/*.c", diff --git a/lang/cem/libcc.ansi/pure/README.md b/lang/cem/libcc.ansi/pure/README.md new file mode 100644 index 000000000..484205837 --- /dev/null +++ b/lang/cem/libcc.ansi/pure/README.md @@ -0,0 +1,3 @@ +This directory contains _only_ pure-code libc functions with no dependencies +on anything other than other pure functions (for example: strcmp, div). There +should be no reason why any platform won't want these in its libc. diff --git a/lang/cem/libcc.ansi/src/core/memchr.c b/lang/cem/libcc.ansi/pure/string/memchr.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/memchr.c rename to lang/cem/libcc.ansi/pure/string/memchr.c diff --git a/lang/cem/libcc.ansi/src/core/memcmp.c b/lang/cem/libcc.ansi/pure/string/memcmp.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/memcmp.c rename to lang/cem/libcc.ansi/pure/string/memcmp.c diff --git a/lang/cem/libcc.ansi/src/core/memcpy.c b/lang/cem/libcc.ansi/pure/string/memcpy.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/memcpy.c rename to lang/cem/libcc.ansi/pure/string/memcpy.c diff --git a/lang/cem/libcc.ansi/src/core/memmove.c b/lang/cem/libcc.ansi/pure/string/memmove.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/memmove.c rename to lang/cem/libcc.ansi/pure/string/memmove.c diff --git a/lang/cem/libcc.ansi/src/core/memset.c b/lang/cem/libcc.ansi/pure/string/memset.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/memset.c rename to lang/cem/libcc.ansi/pure/string/memset.c diff --git a/lang/cem/libcc.ansi/src/core/strcat.c b/lang/cem/libcc.ansi/pure/string/strcat.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strcat.c rename to lang/cem/libcc.ansi/pure/string/strcat.c diff --git a/lang/cem/libcc.ansi/src/core/strchr.c b/lang/cem/libcc.ansi/pure/string/strchr.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strchr.c rename to lang/cem/libcc.ansi/pure/string/strchr.c diff --git a/lang/cem/libcc.ansi/src/core/strcmp.c b/lang/cem/libcc.ansi/pure/string/strcmp.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strcmp.c rename to lang/cem/libcc.ansi/pure/string/strcmp.c diff --git a/lang/cem/libcc.ansi/src/core/strcoll.c b/lang/cem/libcc.ansi/pure/string/strcoll.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strcoll.c rename to lang/cem/libcc.ansi/pure/string/strcoll.c diff --git a/lang/cem/libcc.ansi/src/core/strcpy.c b/lang/cem/libcc.ansi/pure/string/strcpy.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strcpy.c rename to lang/cem/libcc.ansi/pure/string/strcpy.c diff --git a/lang/cem/libcc.ansi/src/core/strcspn.c b/lang/cem/libcc.ansi/pure/string/strcspn.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strcspn.c rename to lang/cem/libcc.ansi/pure/string/strcspn.c diff --git a/lang/cem/libcc.ansi/src/core/strdup.c b/lang/cem/libcc.ansi/pure/string/strdup.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strdup.c rename to lang/cem/libcc.ansi/pure/string/strdup.c diff --git a/lang/cem/libcc.ansi/src/core/strlen.c b/lang/cem/libcc.ansi/pure/string/strlen.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strlen.c rename to lang/cem/libcc.ansi/pure/string/strlen.c diff --git a/lang/cem/libcc.ansi/src/core/strncat.c b/lang/cem/libcc.ansi/pure/string/strncat.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strncat.c rename to lang/cem/libcc.ansi/pure/string/strncat.c diff --git a/lang/cem/libcc.ansi/src/core/strncmp.c b/lang/cem/libcc.ansi/pure/string/strncmp.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strncmp.c rename to lang/cem/libcc.ansi/pure/string/strncmp.c diff --git a/lang/cem/libcc.ansi/src/core/strncpy.c b/lang/cem/libcc.ansi/pure/string/strncpy.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strncpy.c rename to lang/cem/libcc.ansi/pure/string/strncpy.c diff --git a/lang/cem/libcc.ansi/src/core/strpbrk.c b/lang/cem/libcc.ansi/pure/string/strpbrk.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strpbrk.c rename to lang/cem/libcc.ansi/pure/string/strpbrk.c diff --git a/lang/cem/libcc.ansi/src/core/strrchr.c b/lang/cem/libcc.ansi/pure/string/strrchr.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strrchr.c rename to lang/cem/libcc.ansi/pure/string/strrchr.c diff --git a/lang/cem/libcc.ansi/src/core/strspn.c b/lang/cem/libcc.ansi/pure/string/strspn.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strspn.c rename to lang/cem/libcc.ansi/pure/string/strspn.c diff --git a/lang/cem/libcc.ansi/src/core/strstr.c b/lang/cem/libcc.ansi/pure/string/strstr.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strstr.c rename to lang/cem/libcc.ansi/pure/string/strstr.c diff --git a/lang/cem/libcc.ansi/src/core/strtok.c b/lang/cem/libcc.ansi/pure/string/strtok.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strtok.c rename to lang/cem/libcc.ansi/pure/string/strtok.c diff --git a/lang/cem/libcc.ansi/src/core/strxfrm.c b/lang/cem/libcc.ansi/pure/string/strxfrm.c similarity index 100% rename from lang/cem/libcc.ansi/src/core/strxfrm.c rename to lang/cem/libcc.ansi/pure/string/strxfrm.c