public: crtlib: add Q_isspace function

This commit is contained in:
Alibek Omarov 2022-01-04 02:22:10 +03:00
parent 7fbbe9f015
commit ccf90beb7d
3 changed files with 11 additions and 1 deletions

View File

@ -725,7 +725,6 @@ typedef int string_t;
typedef unsigned short word;
#include "xash3d_types.h"
#define Q_isspace( ch ) (ch < 32 || ch > 255)
typedef struct
{

View File

@ -61,6 +61,16 @@ qboolean Q_isdigit( const char *str )
return false;
}
qboolean Q_isspace( const char *str )
{
if( str && *str )
{
while( isspace( *str ) ) str++;
if( !*str ) return true;
}
return false;
}
size_t Q_colorstr( const char *string )
{
size_t len;

View File

@ -61,6 +61,7 @@ size_t Q_strncat( char *dst, const char *src, size_t siz );
size_t Q_strncpy( char *dst, const char *src, size_t siz );
uint Q_hashkey( const char *string, uint hashSize, qboolean caseinsensitive );
qboolean Q_isdigit( const char *str );
qboolean Q_isspace( const char *str );
int Q_atoi( const char *str );
float Q_atof( const char *str );
void Q_atov( float *vec, const char *str, size_t siz );