Adding basic Tab completion.
This commit is contained in:
parent
4730ba9a57
commit
f55ec0de1a
4 changed files with 73 additions and 8 deletions
|
|
@ -241,12 +241,13 @@ uint16_t lenStr( char* in )
|
|||
}
|
||||
|
||||
|
||||
uint8_t eqStr( char* str1, char* str2 )
|
||||
int16_t eqStr( char* str1, char* str2 )
|
||||
{
|
||||
// Scan each string for NULLs and whether they are the same
|
||||
while( *str1 != '\0' && *str1++ == *str2++ );
|
||||
|
||||
// If the strings are still identical (i.e. both NULL), then return 1, otherwise 0
|
||||
return *--str1 == *--str2 ? 1 : 0;
|
||||
// If the strings are still identical (i.e. both NULL), then return -1, otherwise current *str1
|
||||
// If *str1 is 0, then str1 ended (and str1 is "like" str2), otherwise strings are different
|
||||
return *--str1 == *--str2 ? -1 : *++str1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ void int16ToStr ( uint16_t in, char* out );
|
|||
void hexToStr_op( uint16_t in, char* out, uint8_t op );
|
||||
void revsStr ( char* in );
|
||||
uint16_t lenStr ( char* in );
|
||||
uint8_t eqStr ( char* str1, char* str2 ); // Returns 1 if identical, 0 otherwise
|
||||
int16_t eqStr ( char* str1, char* str2 ); // Returns -1 if identical, last character of str1 comparison (0 if str1 is like str2)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue