Browse Source

public: crtlib: add Q_isspace function

pull/2/head
Alibek Omarov 3 years ago
parent
commit
ccf90beb7d
  1. 1
      common/const.h
  2. 10
      public/crtlib.c
  3. 1
      public/crtlib.h

1
common/const.h

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

10
public/crtlib.c

@ -61,6 +61,16 @@ qboolean Q_isdigit( const char *str )
return false; 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 Q_colorstr( const char *string )
{ {
size_t len; size_t len;

1
public/crtlib.h

@ -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 ); size_t Q_strncpy( char *dst, const char *src, size_t siz );
uint Q_hashkey( const char *string, uint hashSize, qboolean caseinsensitive ); uint Q_hashkey( const char *string, uint hashSize, qboolean caseinsensitive );
qboolean Q_isdigit( const char *str ); qboolean Q_isdigit( const char *str );
qboolean Q_isspace( const char *str );
int Q_atoi( const char *str ); int Q_atoi( const char *str );
float Q_atof( const char *str ); float Q_atof( const char *str );
void Q_atov( float *vec, const char *str, size_t siz ); void Q_atov( float *vec, const char *str, size_t siz );

Loading…
Cancel
Save