/* * Author: Lubomir Host 'rajo' * $Log: strings.c,v $ * Revision 1.10 2001/11/16 19:30:01 host8 * Patched bug in declaration/definition of global variable debug. * * Revision 1.9 2001/11/12 20:19:10 host8 * http_connect() probably works fine. * Some problems with http_requests for www.mtnsms.com. * * Revision 1.8 2001/11/12 16:08:00 host8 * Big improvements in http. connect() doesn't work correctly yet. * * Revision 1.7 2001/10/30 17:24:02 host8 * New implementation of http request. * * Revision 1.6 2001/10/25 20:05:28 host8 * First implementation of login with password. * */ #include #include #include #include #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "mail2sms.h" #include "strings.h" // Function isnnumber() {{{ int isnnumber(char *str, int len) { int i; for(i=0; 1= 0 && c < 256) { str = (char *) malloc(4*sizeof(char)); sprintf(str, "%.2X", c); // printf("HEXA: '%s'\n", str); return (str); } return (NULL); } // }}} // Function compress_str() {{{ char *compress_str(char *str) { int j; strip(str); j=-1; while (++j,*(str+j)!='\0') { if (isspace(*(str+j))) { strdel(str+j); *(str+j)=toupper(*(str+j)); } } return str; } // }}} // Function add_str_to_sms() {{{ void add_str_to_sms(char *str) { int j; char *pom; compress_str(str); if (strlen(g.text) < SMS_LEN) { j=0; while (strlen(g.text) 2) { strcat(g.text, "%"); pom = hexa(*(str+j)); strcat(g.text, pom); my_free(pom); } else return; } j++; } } return; } // }}} /* Modeline for ViM {{{1 * vim:set ts=4: * vim600:fdm=marker fdl=0 fdc=3: * }}}1 */