Rename char2idx to char2zchar
This commit is contained in:
@@ -28,7 +28,7 @@ char hex2zchar(uint8_t hex)
|
||||
return (hex >= 10 ? hex-9 : 27+hex);
|
||||
}
|
||||
|
||||
char idx2char(int8_t idx)
|
||||
char zchar2char(int8_t idx)
|
||||
{
|
||||
if (idx == 0) return ' ';
|
||||
if (idx < 0) {
|
||||
@@ -44,7 +44,7 @@ char idx2char(int8_t idx)
|
||||
return ' ';
|
||||
}
|
||||
|
||||
int8_t char2idx(char c)
|
||||
int8_t char2zchar(char c)
|
||||
{
|
||||
if (c == '_') return 37;
|
||||
#if LEN_SPECIAL_CHARS > 0
|
||||
@@ -63,14 +63,14 @@ void str2zchar(char * dest, const char * src, int size)
|
||||
{
|
||||
memset(dest, 0, size);
|
||||
for (int c=0; c<size && src[c]; c++) {
|
||||
dest[c] = char2idx(src[c]);
|
||||
dest[c] = char2zchar(src[c]);
|
||||
}
|
||||
}
|
||||
|
||||
int zchar2str(char * dest, const char * src, int size)
|
||||
{
|
||||
for (int c=0; c<size; c++) {
|
||||
dest[c] = idx2char(src[c]);
|
||||
dest[c] = zchar2char(src[c]);
|
||||
}
|
||||
do {
|
||||
dest[size--] = '\0';
|
||||
@@ -122,7 +122,7 @@ char * strcat_zchar(char * dest, const char * name, uint8_t size, const char * d
|
||||
len = i+1;
|
||||
if (len) {
|
||||
if (dest[i])
|
||||
dest[i] = idx2char(dest[i]);
|
||||
dest[i] = zchar2char(dest[i]);
|
||||
else
|
||||
dest[i] = '_';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user