libcw/cwText.cpp
kpl d6e0f5e675 Many changes and additions.
Added serial port, websocket, midi and initial audio functionality.
2019-12-24 10:05:24 -05:00

26 lines
612 B
C++

#include "cwCommon.h"
#include "cwLog.h"
#include "cwText.h"
#include "cwCommonImpl.h"
#include "cwMem.h"
unsigned cw::textLength( const char* s )
{ return s == nullptr ? 0 : strlen(s); }
int cw::textCompare( const char* s0, const char* s1 )
{
if( s0 == nullptr || s1 == nullptr )
return s0==s1 ? 0 : 1; // if both pointers are nullptr then trigger a match
return strcmp(s0,s1);
}
int cw::textCompare( const char* s0, const char* s1, unsigned n)
{
if( s0 == nullptr || s1 == nullptr )
return s0==s1 ? 0 : 1; // if both pointers are nullptr then trigger a match
return strncmp(s0,s1,n);
}