Name n3671, alx-0048r0 - Subdivide string API sections Principles - Keep the language small and simple Category Refactor (editorial). Author Alejandro Colomar History r0 (2025-07-02; n3671): - Initial draft. Supersedes alx-0042 and alx-0039. Rationale The standard mixes functions for handling strings, functions for handling bytes, and other hybrids, all in a single section. This has historically caused confusion, as for example leading to believe that strncpy(3) is appropriate to handle strings. Let's separate the standard clearly into three subsections that differentiate these APIs. I've also added a new section "Writing functions" for memset(3) et al.. 7.33.4.2 ("Wide string numeric conversion functions") is also out of place under 7.33.4, which otherwise is the wide-string equivalent of 7.28. Let's move it out into 7.33.3+1. Future directions I would add a new section "Tokenization functions", where I'd move strtok(3), and also put strsep(3) et al. They really do more than just searching, and it'd be good to have a separate section for them; especially since I want to grow those two sections importantly. strlen(3) and strnlen(3) are really searching functions, and I'd like to move them into "Searching functions". They're a size_t variant of strnul(), which searches the null terminator and returns its address. Proposed wording Based on N3550. A '=' means that the contents are moved verbatim. 7.28 String handling @@ New subsection after 7.28.1 ("String function conventions") +7.28.1+1 Writing functions +7.28.0+1.1 Writing bytes =7.28.0+1.1.1 The memset function (moved from 7.28.6.1) =7.28.0+1.1.2 The memset_explicit function (.. 7.28.6.2) 7.28.2 :: Copying functions @@ New subsections after title. +7.28.2.0+1 Copying strings =7.28.2.0+1.1 The strcpy function (moved from 7.28.2.4) =7.28.2.0+1.2 The strdup function (moved from 7.28.2.6) +7.28.2.0+2 Copying bytes =7.28.2.0+2.1 The memcpy function (moved from 7.28.2.1) =7.28.2.0+2.2 The memmove function (moved from 7.28.2.3) +7.28.2.0+3 Miscellaneous =7.28.2.0+3.1 The memccpy function (moved from 7.28.2.2) =7.28.2.0+3.2 The strncpy function (moved from 7.28.2.5) =7.28.2.0+3.3 The strndup function (moved from 7.28.2.7) 7.28.3 :: Concatenation functions @@ New subsections after title. +7.28.3.0+1 Concatenating strings =7.28.3.0+1.1 The strcat function (moved from 7.28.3.1) +7.28.3.0+2 Miscellaneous =7.28.3.0+1.2 The strncat function (moved from 7.28.3.2) 7.28.4 :: Comparison functions @@ New subsections after 7.28.4.1 ("General") 7.28.4.1 General +7.28.4.1+1 Comparing strings =7.28.4.1+1.1 The strcmp function (moved from 7.28.4.3) =7.28.4.1+1.2 The strcoll function (moved from 7.28.4.4) =7.28.4.1+1.3 The strxfrm function (moved from 7.28.4.6) +7.28.4.1+2 Comparing bytes =7.28.4.1+2.1 The memcmp function (moved from 7.28.4.2) +7.28.4.1+3 Miscellaneous =7.28.4.1+3.2 The strncmp function (moved from 7.28.4.5) 7.28.5 :: Search functions @@ New subsections after 7.28.5.1 ("Introduction") 7.28.5.1 Introduction +7.28.5.1+1 Searching strings =7.28.5.1+1.1 The strchr function (moved from 7.28.5.3) =7.28.5.1+1.2 The strrchr function (moved from 7.28.5.6) =7.28.5.1+1.3 The strpbrk function (moved from 7.28.5.5) =7.28.5.1+1.4 The strspn function (moved from 7.28.5.7) =7.28.5.1+1.5 The strcspn function (moved from 7.28.5.4) =7.28.5.1+1.6 The strstr function (moved from 7.28.5.8) =7.28.5.1+1.7 The strtok function (moved from 7.28.5.9) +7.28.5.1+2 Searching bytes =7.28.5.1+2.1 The memchr function (moved from 7.28.5.2) 7.33 Extended multibyte and wide character utilities @@ 7.33.3 Wide character input/output functions =7.33.3+1 Wide string numeric conversion functions (moved from 7.33.4.2) 7.33.4 General wide string utilities 7.33.4 General wide string utilities @@ New subsections after 7.33.4.1 ("General") 7.33.4.1 General +7.33.4.1+1 Writing functions +7.33.4.1+1.1 Writing wide characters =7.33.4.1+1.1.1 The wmemset function (moved from 7.33.4.7.3) ~7.33.4.2 Wide string numeric conversion functions 7.33.4.3 :: Wide string copying functions @@ Title -Wide string copying functions +Copying functions @@ New subsections after title +7.33.4.3.0+1 Copying wide strings =7.33.4.3.0+1.1 The wcscpy function (move from 7.33.4.3.1) +7.33.4.3.0+2 Copying wide characters =7.33.4.3.0+2.1 The wmemcpy function (move from 7.33.4.3.3) =7.33.4.3.0+2.2 The wmemmove function (move from 7.33.4.3.4) +7.33.4.3.0+2 Miscellaneous =7.33.4.3.0+2.1 The wcsncpy function (move from 7.33.4.3.2) 7.33.4.4 :: Wide string concatenation functions @@ Title -Wide string concatenation functions +Concatenation functions @@ New subsections after title +7.33.4.4.0+1 Concatenating wide strings =7.33.4.4.0+1.1 The wcscat function (move from 7.33.4.4.1) +7.33.4.4.0+2 Miscellaneous =7.33.4.4.0+2.1 The wcsncat function (move from 7.33.4.4.2) 7.33.4.5 :: Wide string comparison functions @@ Title -Wide string comparison functions +Comparison functions @@ New subsections after 7.33.4.5.1 ("General") 7.33.4.5.1 General +7.33.4.5.1+1 Comparing wide strings =7.33.4.5.1+1.1 The wcscmp function (move from 7.33.4.5.2) =7.33.4.5.1+1.2 The wcscoll function (move from 7.33.4.5.3) =7.33.4.5.1+1.3 The wcsxfrm function (move from 7.33.4.5.5) +7.33.4.5.1+2 Comparing wide characters =7.33.4.5.1+2.1 The wmemcmp function (move from 7.33.4.5.6) +7.33.4.5.1+3 Miscellaneous =7.33.4.5.1+3.1 The wcsncmp function (move from 7.33.4.5.4) 7.33.4.6 :: Wide string search functions @@ Title -Wide string search functions +Search functions @@ New subsections after 7.33.4.6.1 ("Introduction") 7.33.4.6.1 Introduction +7.33.4.6.1+1 Searching wide strings =7.33.4.6.1+1.1 The wcschr function (move from 7.33.4.6.2) =7.33.4.6.1+1.2 The wcsrchr function (move from 7.33.4.6.5) =7.33.4.6.1+1.3 The wcspbrk function (move from 7.33.4.6.4) =7.33.4.6.1+1.4 The wcsspn function (move from 7.33.4.6.6) =7.33.4.6.1+1.5 The wcscspn function (move from 7.33.4.6.3) =7.33.4.6.1+1.6 The wcsstr function (move from 7.33.4.6.7) =7.33.4.6.1+1.7 The wcstok function (move from 7.33.4.6.8) +7.33.4.6.1+2 Searching wide characters =7.33.4.6.1+2.1 The wmemchr function (move from 7.33.4.6.9)