Skip to content

Commit

Permalink
sms: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed Nov 11, 2023
1 parent 6686956 commit a39ed9d
Show file tree
Hide file tree
Showing 11 changed files with 1,265 additions and 1,363 deletions.
42 changes: 16 additions & 26 deletions src/modules/sms/libsms_charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,36 @@ mailto:s.frings@mail.isis.de

#include "libsms_charset.h"

#define noc 183
#define noc 183
// non existent character

// iso 8859-1
unsigned char charset[128] ={
'@' , 163 , '$' , 165 , 232 , 233 , 249 , 236 ,
242 , 199 , 10 , 216 , 248 , 13 , 197 , 229 ,
noc , '_' , noc , noc , noc , noc , noc , noc ,
noc , noc , noc , noc , 198 , 230 , 223 , 201 ,
' ' , '!' , 34 , '#' , '$' , '%' , '&' , 39 ,
'(' , ')' , '*' , '+' , ',' , '-' , '.' , '/' ,
'0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' ,
'8' , '9' , ':' , ';' , '<' , '=' , '>' , '?' ,
161 , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' ,
'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' ,
'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' ,
'X' , 'Y' , 'Z' , 196 , 214 , 209 , 220 , 167 ,
191 , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' ,
'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' ,
'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' ,
'x' , 'y' , 'z' , 228 , 246 , 241 , 252 , 224 };

unsigned char charset[128] = {'@', 163, '$', 165, 232, 233, 249, 236, 242, 199,
10, 216, 248, 13, 197, 229, noc, '_', noc, noc, noc, noc, noc, noc, noc,
noc, noc, noc, 198, 230, 223, 201, ' ', '!', 34, '#', '$', '%', '&', 39,
'(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', ':', ';', '<', '=', '>', '?', 161, 'A', 'B', 'C',
'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 196, 214, 209, 220, 167,
191, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 228,
246, 241, 252, 224};

char ascii2sms(const char c)
{
char found='*'; // replacement for nonexistent characters
char found = '*'; // replacement for nonexistent characters
int i;

for (i=0; i<128 ; i++)
if (c==charset[i])
{
found=i;
for(i = 0; i < 128; i++)
if(c == charset[i]) {
found = i;
break;
}

return found;
}




char sms2ascii(const char c)
{
return charset[(int)c];
Expand Down

0 comments on commit a39ed9d

Please sign in to comment.