From 7a0beab011fa5f3a228890ff2e4acd0a21589430 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 12 Jun 2013 13:35:22 +0200 Subject: [PATCH] Move string.h functions into their own directory. --- libc/Makefile | 66 +++++++++++++++---------------- libc/sortix/string/.gitignore | 1 + libc/{ => string}/memccpy.cpp | 2 +- libc/{ => string}/memchr.cpp | 2 +- libc/{ => string}/memcmp.cpp | 2 +- libc/{ => string}/memcpy.cpp | 2 +- libc/{ => string}/memmove.cpp | 2 +- libc/{ => string}/memset.cpp | 2 +- libc/{ => string}/stpcpy.cpp | 2 +- libc/{ => string}/stpncpy.cpp | 2 +- libc/{ => string}/strcasecmp.cpp | 2 +- libc/{ => string}/strcat.cpp | 2 +- libc/{ => string}/strchr.cpp | 2 +- libc/{ => string}/strchrnul.cpp | 2 +- libc/{ => string}/strcmp.cpp | 2 +- libc/{ => string}/strcoll.cpp | 2 +- libc/{ => string}/strcpy.cpp | 2 +- libc/{ => string}/strcspn.cpp | 2 +- libc/{ => string}/strdup.cpp | 2 +- libc/{ => string}/strerror.cpp | 2 +- libc/{ => string}/strlen.cpp | 2 +- libc/{ => string}/strncasecmp.cpp | 2 +- libc/{ => string}/strncat.cpp | 2 +- libc/{ => string}/strncmp.cpp | 2 +- libc/{ => string}/strncpy.cpp | 2 +- libc/{ => string}/strndup.cpp | 2 +- libc/{ => string}/strnlen.cpp | 2 +- libc/{ => string}/strpbrk.cpp | 2 +- libc/{ => string}/strrchr.cpp | 2 +- libc/{ => string}/strsignal.cpp | 2 +- libc/{ => string}/strspn.cpp | 2 +- libc/{ => string}/strstr.cpp | 2 +- libc/{ => string}/strtok.cpp | 2 +- libc/{ => string}/strtok_r.cpp | 2 +- libc/{ => string}/strxfrm.cpp | 2 +- 35 files changed, 67 insertions(+), 66 deletions(-) create mode 100644 libc/sortix/string/.gitignore rename libc/{ => string}/memccpy.cpp (98%) rename libc/{ => string}/memchr.cpp (98%) rename libc/{ => string}/memcmp.cpp (98%) rename libc/{ => string}/memcpy.cpp (99%) rename libc/{ => string}/memmove.cpp (98%) rename libc/{ => string}/memset.cpp (98%) rename libc/{ => string}/stpcpy.cpp (98%) rename libc/{ => string}/stpncpy.cpp (98%) rename libc/{ => string}/strcasecmp.cpp (98%) rename libc/{ => string}/strcat.cpp (98%) rename libc/{ => string}/strchr.cpp (98%) rename libc/{ => string}/strchrnul.cpp (98%) rename libc/{ => string}/strcmp.cpp (98%) rename libc/{ => string}/strcoll.cpp (98%) rename libc/{ => string}/strcpy.cpp (98%) rename libc/{ => string}/strcspn.cpp (98%) rename libc/{ => string}/strdup.cpp (98%) rename libc/{ => string}/strerror.cpp (99%) rename libc/{ => string}/strlen.cpp (98%) rename libc/{ => string}/strncasecmp.cpp (98%) rename libc/{ => string}/strncat.cpp (98%) rename libc/{ => string}/strncmp.cpp (98%) rename libc/{ => string}/strncpy.cpp (98%) rename libc/{ => string}/strndup.cpp (98%) rename libc/{ => string}/strnlen.cpp (98%) rename libc/{ => string}/strpbrk.cpp (98%) rename libc/{ => string}/strrchr.cpp (98%) rename libc/{ => string}/strsignal.cpp (98%) rename libc/{ => string}/strspn.cpp (98%) rename libc/{ => string}/strstr.cpp (98%) rename libc/{ => string}/strtok.cpp (98%) rename libc/{ => string}/strtok_r.cpp (98%) rename libc/{ => string}/strxfrm.cpp (98%) diff --git a/libc/Makefile b/libc/Makefile index aeadc4a6..5d26e596 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -80,12 +80,6 @@ mbrtowc.o \ mbsrtowcs.o \ mbstowcs.o \ mbtowc.o \ -memccpy.o \ -memchr.o \ -memcmp.o \ -memcpy.o \ -memmove.o \ -memset.o \ op-new.o \ rewind.o \ setbuf.o \ @@ -98,36 +92,42 @@ sigismember.o \ sort.o \ sprint.o \ sscanf.o \ -stpcpy.o \ -stpncpy.o \ -strcasecmp.o \ -strcat.o \ -strchrnul.o \ -strchr.o \ -strcmp.o \ -strcoll.o \ -strcpy.o \ -strcspn.o \ -strdup.o \ -strerror.o \ -strlen.o \ -strncasecmp.o \ -strncat.o \ -strncmp.o \ -strncpy.o \ -strndup.o \ -strnlen.o \ -strpbrk.o \ -strrchr.o \ -strsignal.o \ -strspn.o \ -strstr.o \ +string/memccpy.o \ +string/memchr.o \ +string/memcmp.o \ +string/memcpy.o \ +string/memmove.o \ +string/memset.o \ +string/stpcpy.o \ +string/stpncpy.o \ +string/strcasecmp.o \ +string/strcat.o \ +string/strchrnul.o \ +string/strchr.o \ +string/strcmp.o \ +string/strcoll.o \ +string/strcpy.o \ +string/strcspn.o \ +string/strdup.o \ +string/strerror.o \ +string/strlen.o \ +string/strncasecmp.o \ +string/strncat.o \ +string/strncmp.o \ +string/strncpy.o \ +string/strndup.o \ +string/strnlen.o \ +string/strpbrk.o \ +string/strrchr.o \ +string/strsignal.o \ +string/strspn.o \ +string/strstr.o \ +string/strtok.o \ +string/strtok_r.o \ +string/strxfrm.o \ strtod.o \ strtof.o \ -strtok.o \ -strtok_r.o \ strtold.o \ -strxfrm.o \ time/asctime.o \ time/asctime_r.o \ time/gmtime.o \ diff --git a/libc/sortix/string/.gitignore b/libc/sortix/string/.gitignore new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/libc/sortix/string/.gitignore @@ -0,0 +1 @@ + diff --git a/libc/memccpy.cpp b/libc/string/memccpy.cpp similarity index 98% rename from libc/memccpy.cpp rename to libc/string/memccpy.cpp index d223b6db..a3fe57f3 100644 --- a/libc/memccpy.cpp +++ b/libc/string/memccpy.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - memccpy.cpp + string/memccpy.cpp Copy memory until length is met or character is encountered. *******************************************************************************/ diff --git a/libc/memchr.cpp b/libc/string/memchr.cpp similarity index 98% rename from libc/memchr.cpp rename to libc/string/memchr.cpp index c14ac6c3..e0b9d925 100644 --- a/libc/memchr.cpp +++ b/libc/string/memchr.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - memchr.cpp + string/memchr.cpp Scans memory for a character. *******************************************************************************/ diff --git a/libc/memcmp.cpp b/libc/string/memcmp.cpp similarity index 98% rename from libc/memcmp.cpp rename to libc/string/memcmp.cpp index 9476a0a3..5769ae89 100644 --- a/libc/memcmp.cpp +++ b/libc/string/memcmp.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - memcmp.cpp + string/memcmp.cpp Compares two memory regions. *******************************************************************************/ diff --git a/libc/memcpy.cpp b/libc/string/memcpy.cpp similarity index 99% rename from libc/memcpy.cpp rename to libc/string/memcpy.cpp index 3303bacf..ffeeac8b 100644 --- a/libc/memcpy.cpp +++ b/libc/string/memcpy.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - memcpy.cpp + string/memcpy.cpp Copy memory between non-overlapping regions. *******************************************************************************/ diff --git a/libc/memmove.cpp b/libc/string/memmove.cpp similarity index 98% rename from libc/memmove.cpp rename to libc/string/memmove.cpp index bf3a2ea4..dfc8d1c8 100644 --- a/libc/memmove.cpp +++ b/libc/string/memmove.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - memmove.cpp + string/memmove.cpp Copy memory between potentionally overlapping regions. *******************************************************************************/ diff --git a/libc/memset.cpp b/libc/string/memset.cpp similarity index 98% rename from libc/memset.cpp rename to libc/string/memset.cpp index 65add0e0..186181ed 100644 --- a/libc/memset.cpp +++ b/libc/string/memset.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - memset.cpp + string/memset.cpp Initializes a region of memory to a byte value. *******************************************************************************/ diff --git a/libc/stpcpy.cpp b/libc/string/stpcpy.cpp similarity index 98% rename from libc/stpcpy.cpp rename to libc/string/stpcpy.cpp index 3e5b6873..27010e9c 100644 --- a/libc/stpcpy.cpp +++ b/libc/string/stpcpy.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - stpcpy.cpp + string/stpcpy.cpp Copy a string returning a pointer to its end. *******************************************************************************/ diff --git a/libc/stpncpy.cpp b/libc/string/stpncpy.cpp similarity index 98% rename from libc/stpncpy.cpp rename to libc/string/stpncpy.cpp index 8063d4bf..afeb60a7 100644 --- a/libc/stpncpy.cpp +++ b/libc/string/stpncpy.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - stpncpy.cpp + string/stpncpy.cpp Copies a string into a fixed size buffer and returns last byte. *******************************************************************************/ diff --git a/libc/strcasecmp.cpp b/libc/string/strcasecmp.cpp similarity index 98% rename from libc/strcasecmp.cpp rename to libc/string/strcasecmp.cpp index 25249f64..bfc3bda5 100644 --- a/libc/strcasecmp.cpp +++ b/libc/string/strcasecmp.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strcasecmp.cpp + string/strcasecmp.cpp Compares two strings ignoring case. *******************************************************************************/ diff --git a/libc/strcat.cpp b/libc/string/strcat.cpp similarity index 98% rename from libc/strcat.cpp rename to libc/string/strcat.cpp index b2795fe1..d7c9cd04 100644 --- a/libc/strcat.cpp +++ b/libc/string/strcat.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strcat.cpp + string/strcat.cpp Appends a string onto another string. *******************************************************************************/ diff --git a/libc/strchr.cpp b/libc/string/strchr.cpp similarity index 98% rename from libc/strchr.cpp rename to libc/string/strchr.cpp index f6f3b751..63ea3e24 100644 --- a/libc/strchr.cpp +++ b/libc/string/strchr.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strchr.cpp + string/strchr.cpp Searches a string for a specific character. *******************************************************************************/ diff --git a/libc/strchrnul.cpp b/libc/string/strchrnul.cpp similarity index 98% rename from libc/strchrnul.cpp rename to libc/string/strchrnul.cpp index ce685d2d..b7d07e8c 100644 --- a/libc/strchrnul.cpp +++ b/libc/string/strchrnul.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strchrnul.cpp + string/strchrnul.cpp Searches a string for a specific character. *******************************************************************************/ diff --git a/libc/strcmp.cpp b/libc/string/strcmp.cpp similarity index 98% rename from libc/strcmp.cpp rename to libc/string/strcmp.cpp index e5d430c1..6809a6a9 100644 --- a/libc/strcmp.cpp +++ b/libc/string/strcmp.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strcmp.cpp + string/strcmp.cpp Compares two strings. *******************************************************************************/ diff --git a/libc/strcoll.cpp b/libc/string/strcoll.cpp similarity index 98% rename from libc/strcoll.cpp rename to libc/string/strcoll.cpp index b6496551..cfaea683 100644 --- a/libc/strcoll.cpp +++ b/libc/string/strcoll.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strcoll.cpp + string/strcoll.cpp Compare two strings using the current locale. *******************************************************************************/ diff --git a/libc/strcpy.cpp b/libc/string/strcpy.cpp similarity index 98% rename from libc/strcpy.cpp rename to libc/string/strcpy.cpp index af16958c..1b367024 100644 --- a/libc/strcpy.cpp +++ b/libc/string/strcpy.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strcpy.cpp + string/strcpy.cpp Copies a string and returns dest. *******************************************************************************/ diff --git a/libc/strcspn.cpp b/libc/string/strcspn.cpp similarity index 98% rename from libc/strcspn.cpp rename to libc/string/strcspn.cpp index 1b75ca4a..f58b928a 100644 --- a/libc/strcspn.cpp +++ b/libc/string/strcspn.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strcspn.cpp + string/strcspn.cpp Search a string for a set of characters. *******************************************************************************/ diff --git a/libc/strdup.cpp b/libc/string/strdup.cpp similarity index 98% rename from libc/strdup.cpp rename to libc/string/strdup.cpp index 6b1db402..aa135c31 100644 --- a/libc/strdup.cpp +++ b/libc/string/strdup.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strdup.cpp + string/strdup.cpp Creates a copy of a string. *******************************************************************************/ diff --git a/libc/strerror.cpp b/libc/string/strerror.cpp similarity index 99% rename from libc/strerror.cpp rename to libc/string/strerror.cpp index bbbfae05..f700a6a4 100644 --- a/libc/strerror.cpp +++ b/libc/string/strerror.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strerror.cpp + string/strerror.cpp Convert error code to a string. *******************************************************************************/ diff --git a/libc/strlen.cpp b/libc/string/strlen.cpp similarity index 98% rename from libc/strlen.cpp rename to libc/string/strlen.cpp index c8d7724a..14514723 100644 --- a/libc/strlen.cpp +++ b/libc/string/strlen.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strlen.cpp + string/strlen.cpp Returns the length of a string. *******************************************************************************/ diff --git a/libc/strncasecmp.cpp b/libc/string/strncasecmp.cpp similarity index 98% rename from libc/strncasecmp.cpp rename to libc/string/strncasecmp.cpp index 425dbec8..265881b5 100644 --- a/libc/strncasecmp.cpp +++ b/libc/string/strncasecmp.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strncasecmp.cpp + string/strncasecmp.cpp Compares a prefix of two strings ignoring case. *******************************************************************************/ diff --git a/libc/strncat.cpp b/libc/string/strncat.cpp similarity index 98% rename from libc/strncat.cpp rename to libc/string/strncat.cpp index bedb5a05..4d0e57b9 100644 --- a/libc/strncat.cpp +++ b/libc/string/strncat.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strncat.cpp + string/strncat.cpp Appends parts of a string onto another string. *******************************************************************************/ diff --git a/libc/strncmp.cpp b/libc/string/strncmp.cpp similarity index 98% rename from libc/strncmp.cpp rename to libc/string/strncmp.cpp index ef6766a2..5e1020ff 100644 --- a/libc/strncmp.cpp +++ b/libc/string/strncmp.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strncmp.cpp + string/strncmp.cpp Compares a prefix of two strings. *******************************************************************************/ diff --git a/libc/strncpy.cpp b/libc/string/strncpy.cpp similarity index 98% rename from libc/strncpy.cpp rename to libc/string/strncpy.cpp index 7aafa057..fa698657 100644 --- a/libc/strncpy.cpp +++ b/libc/string/strncpy.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strncpy.cpp + string/strncpy.cpp Copies a string into a fixed size buffer and returns dest. *******************************************************************************/ diff --git a/libc/strndup.cpp b/libc/string/strndup.cpp similarity index 98% rename from libc/strndup.cpp rename to libc/string/strndup.cpp index c6b7a8f3..ecb4b503 100644 --- a/libc/strndup.cpp +++ b/libc/string/strndup.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strndup.cpp + string/strndup.cpp Creates a copy of a string. *******************************************************************************/ diff --git a/libc/strnlen.cpp b/libc/string/strnlen.cpp similarity index 98% rename from libc/strnlen.cpp rename to libc/string/strnlen.cpp index 49ef6b90..4a1f130c 100644 --- a/libc/strnlen.cpp +++ b/libc/string/strnlen.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strnlen.cpp + string/strnlen.cpp Returns the length of a fixed length string. *******************************************************************************/ diff --git a/libc/strpbrk.cpp b/libc/string/strpbrk.cpp similarity index 98% rename from libc/strpbrk.cpp rename to libc/string/strpbrk.cpp index c21ce9c5..0cf47a6b 100644 --- a/libc/strpbrk.cpp +++ b/libc/string/strpbrk.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strpbrk.cpp + string/strpbrk.cpp Search a string for any of a set of characters. *******************************************************************************/ diff --git a/libc/strrchr.cpp b/libc/string/strrchr.cpp similarity index 98% rename from libc/strrchr.cpp rename to libc/string/strrchr.cpp index 6ff50aab..a0874c84 100644 --- a/libc/strrchr.cpp +++ b/libc/string/strrchr.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strrchr.cpp + string/strrchr.cpp Searches a string for a specific character. *******************************************************************************/ diff --git a/libc/strsignal.cpp b/libc/string/strsignal.cpp similarity index 98% rename from libc/strsignal.cpp rename to libc/string/strsignal.cpp index dd7f1de8..dba917f8 100644 --- a/libc/strsignal.cpp +++ b/libc/string/strsignal.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strsignal.cpp + string/strsignal.cpp Convert signal number to a string. *******************************************************************************/ diff --git a/libc/strspn.cpp b/libc/string/strspn.cpp similarity index 98% rename from libc/strspn.cpp rename to libc/string/strspn.cpp index a7c210a1..cebd3b1b 100644 --- a/libc/strspn.cpp +++ b/libc/string/strspn.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strspn.cpp + string/strspn.cpp Search a string for a set of characters. *******************************************************************************/ diff --git a/libc/strstr.cpp b/libc/string/strstr.cpp similarity index 98% rename from libc/strstr.cpp rename to libc/string/strstr.cpp index 36cbc91d..f0cc78cd 100644 --- a/libc/strstr.cpp +++ b/libc/string/strstr.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strstr.cpp + string/strstr.cpp Locate a substring. *******************************************************************************/ diff --git a/libc/strtok.cpp b/libc/string/strtok.cpp similarity index 98% rename from libc/strtok.cpp rename to libc/string/strtok.cpp index 3ef3b938..e2309137 100644 --- a/libc/strtok.cpp +++ b/libc/string/strtok.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strtok.cpp + string/strtok.cpp Extract tokens from strings. *******************************************************************************/ diff --git a/libc/strtok_r.cpp b/libc/string/strtok_r.cpp similarity index 98% rename from libc/strtok_r.cpp rename to libc/string/strtok_r.cpp index e73a22b3..eff6eb3e 100644 --- a/libc/strtok_r.cpp +++ b/libc/string/strtok_r.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strtok_r.cpp + string/strtok_r.cpp Extract tokens from strings. *******************************************************************************/ diff --git a/libc/strxfrm.cpp b/libc/string/strxfrm.cpp similarity index 98% rename from libc/strxfrm.cpp rename to libc/string/strxfrm.cpp index ec4a697c..89ad62d0 100644 --- a/libc/strxfrm.cpp +++ b/libc/string/strxfrm.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - strxfrm.cpp + string/strxfrm.cpp Transform a string such that the result of strcmp is the same as strcoll. *******************************************************************************/