Hi Alejandro,
> I was wondering if I should propose adding an alias for strpbrk(3).
> <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3670.txt>
>
> Plan9 has a synonym called strchrs(), and that is indeed a better name
> for strpbrk(3), since it's just a plural version of strchr(3).
> ...
> The following calls are equivalent:
>
> strchrnul(s, 'x');
> stpcspn(s, "x");
If the function strpbrk was not already standardized in ISO C,
I agree that the Plan9 naming could help construct a family of
consistently named functions.
However, because
- all three functions are already standardized,
- these functions with a set of characters in the second argument are
not frequently used
[1] strspn -> 1346
[2] strcspn -> 1193
[3] strpbrk -> 1533
compared to
[4] strchr -> 24444
I would say it's not worth the trouble of changing the standard
(via aliases, new functions, or renamings).
streq was good. strnul was good. But that does not mean that every
new function in this area will be as good.
Bruno
[1] https://codesearch.debian.net/search?q=strspn+%28&literal=1
[2] https://codesearch.debian.net/search?q=strcspn+%28&literal=1
[3] https://codesearch.debian.net/search?q=strpbrk+%28&literal=1
[4] https://codesearch.debian.net/search?q=strchr+%28&literal=1