diff --git a/libc/docs/index.rst b/libc/docs/index.rst --- a/libc/docs/index.rst +++ b/libc/docs/index.rst @@ -82,3 +82,4 @@ mechanics_of_public_api redirectors source_layout + strings diff --git a/libc/docs/strings.rst b/libc/docs/strings.rst new file mode 100644 --- /dev/null +++ b/libc/docs/strings.rst @@ -0,0 +1,162 @@ +============================= +String Functions in LLVM-libc +============================= + +------- +Summary +------- + +This site tracks the status of the implementation of string functions in LLVM +Libc. This includes a few extra functions that are not in string.h, such as +functions converting strings to numbers. + +--------------- +Source location +--------------- + +- The main source for string functions is located at: + libc/src/string. + +- The source for string conversion functions is located at: + libc/src/stdlib and + libc/src/__support. + +- The tests are located at: + libc/test/src/string, + libc/test/src/stdlib, and + libc/test/src/__support + respectively. + +--------------------- +Implementation Status +--------------------- + +EXEgesis Raw Memory Functions +============================= + +These functions were developed by the EXEgesis team and have been +open sourced via LLVM libc. + +.. TODO(gchatelet): add details about the exegesis memory functions. + + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +bzero DONE DONE +bcmp DONE DONE +memcpy DONE DONE +memset DONE DONE +memcmp DONE DONE +memmove DONE DONE +============= ======== =========== + + +Other Raw Memory Functions +========================== + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +memchr DONE DONE +memrchr DONE DONE +memccpy DONE DONE +mempcpy DONE DONE +============= ======== =========== + +String Memory Functions +======================= + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +stpcpy DONE DONE +stpncpy DONE DONE +strcpy DONE DONE +strncpy DONE DONE +strcat DONE DONE +strncat DONE DONE +strdup DONE DONE +strndup DONE DONE +============= ======== =========== + +String Examination Functions +============================ + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +strlen DONE DONE +strnlen DONE DONE +strcmp DONE DONE +strncmp DONE DONE +strchr DONE DONE +strrchr DONE DONE +strspn DONE DONE +strcspn DONE DONE +strpbrk DONE DONE +strstr DONE DONE +strtok DONE DONE +strtok_r DONE DONE +============= ======== =========== + +String Conversion Functions +============================ + +These functions are not in strings.h, but are still primarily string +functions, and are therefore tracked along with the rest of the string +functions. + +.. TODO(michaelrj): add details about string to float conversion design and implementation. + + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +atof DONE DONE +atoi DONE DONE +atol DONE DONE +atoll DONE DONE +strtol DONE DONE +strtoll DONE DONE +strtoul DONE DONE +strtoull DONE DONE +strtof DONE DONE +strtod DONE DONE +strtold DONE DONE +strtoimax DONE DONE +strtoumax DONE DONE +============= ======== =========== + +String Error Functions +====================== + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +strerror +strerror_s +strerrorlen_s +============= ======== =========== + +Localized String Functions +========================== + +These functions require locale.h, which is currently deprioritised. + +============= ======== =========== +Function_Name Designed Implemented +============= ======== =========== +strcoll +strxfrm +============= ======== =========== + +--------------------------- +\_s String Functions +--------------------------- + +Many String functions have an equivalent _s version, which is intended to be +more secure and safe than the previous standard. These functions add runtime +error detection and overflow protection. While they can be seen as an +improvement, adoption remains relatively low among users. For this and other +reasons, these functions are currently deprioritised.