Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 529579c2 authored by rswindell's avatar rswindell

Added string utility function: str_has_ctrl() to check if a string contains

any control (ASCII 0x01 - 0x1F) characters.
parent 1241828d
...@@ -1166,6 +1166,7 @@ extern "C" { ...@@ -1166,6 +1166,7 @@ extern "C" {
DLLEXPORT char * ultoac(ulong l,char *str); DLLEXPORT char * ultoac(ulong l,char *str);
DLLEXPORT char * rot13(char* str); DLLEXPORT char * rot13(char* str);
DLLEXPORT uint32_t str_to_bits(uint32_t currval, const char *str); DLLEXPORT uint32_t str_to_bits(uint32_t currval, const char *str);
DLLEXPORT BOOL str_has_ctrl(const char*);
DLLEXPORT BOOL str_is_ascii(const char*); DLLEXPORT BOOL str_is_ascii(const char*);
DLLEXPORT char * utf8_to_cp437_str(char* str); DLLEXPORT char * utf8_to_cp437_str(char* str);
......
...@@ -604,6 +604,15 @@ BOOL str_is_ascii(const char* str) ...@@ -604,6 +604,15 @@ BOOL str_is_ascii(const char* str)
return TRUE; return TRUE;
} }
BOOL str_has_ctrl(const char* str)
{
for(const char* p = str; *p != 0; p++) {
if((uchar)*p < ' ')
return TRUE;
}
return FALSE;
}
/****************************************************************************/ /****************************************************************************/
/* Convert string from IBM extended ASCII to just ASCII */ /* Convert string from IBM extended ASCII to just ASCII */
/****************************************************************************/ /****************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment