Alejandro Colomar <[email protected]> writes: >> As Gnulib already has a streq module with different meaning, I named the new >> module "stringeq"; it implements both streq and memeq in <string.h>. There >> seemed little point to having a separate module per function. > > Maybe it would be good to call the module just 'string' so that we can > add more functions to it? I have a list of other similar functions that > I'm proposing for standardization. A few obvious ones are:
The string module exists as an alias to string-h. We unified the naming conventions for headers a few months ago [1]. > <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3612.txt> > strpfx() - string prefix (returns boolean, for compatibility with streq) > stppfx() - string prefix (returns pointer) > > <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3613.txt> > strsfx() - string suffix (returns boolean, for compatibility with streq) > stpsfx() - string suffix (returns pointer) We have str_startswith() and str_endswith() already for this. I prefer those names personally. But I don't like many of the string.h names we are stuck with (e.g. strspn, strcspn), so maybe it is a me problem. :) Collin [1] https://github.com/coreutils/gnulib/blob/c172e838f939f7c97daed1a80a7ec3479b4c43c6/modules/string
