mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
Extend str_isspace
to consider \r
as whitespace, add documentation
This allows the function to be reused in more places where `\r` is also considered as whitespace.
This commit is contained in:
parent
38d2131944
commit
e98728f8f0
|
@ -3369,7 +3369,10 @@ void net_stats(NETSTATS *stats_inout)
|
||||||
*stats_inout = network_stats;
|
*stats_inout = network_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
int str_isspace(char c) { return c == ' ' || c == '\n' || c == '\t'; }
|
int str_isspace(char c)
|
||||||
|
{
|
||||||
|
return c == ' ' || c == '\n' || c == '\r' || c == '\t';
|
||||||
|
}
|
||||||
|
|
||||||
char str_uppercase(char c)
|
char str_uppercase(char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2029,7 +2029,20 @@ int str_toint(const char *str);
|
||||||
int str_toint_base(const char *str, int base);
|
int str_toint_base(const char *str, int base);
|
||||||
unsigned long str_toulong_base(const char *str, int base);
|
unsigned long str_toulong_base(const char *str, int base);
|
||||||
float str_tofloat(const char *str);
|
float str_tofloat(const char *str);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether a character is whitespace.
|
||||||
|
*
|
||||||
|
* @ingroup Strings
|
||||||
|
*
|
||||||
|
* @param c the character to check
|
||||||
|
*
|
||||||
|
* @return 1 if the character is whitespace, 0 otherwise.
|
||||||
|
*
|
||||||
|
* @remark The following characters are considered whitespace: ' ', '\n', '\r', '\t'
|
||||||
|
*/
|
||||||
int str_isspace(char c);
|
int str_isspace(char c);
|
||||||
|
|
||||||
char str_uppercase(char c);
|
char str_uppercase(char c);
|
||||||
int str_isallnum(const char *str);
|
int str_isallnum(const char *str);
|
||||||
unsigned str_quickhash(const char *str);
|
unsigned str_quickhash(const char *str);
|
||||||
|
|
Loading…
Reference in a new issue