shared: add nm_is_ascii()

glib's is{alnum,alpha,ascii,...}() functions perform the check based
on the current locale. Probably using isascii() would be fine anyway,
but add a NM version that just checks that the upper bit is zero.
This commit is contained in:
Beniamino Galvani 2020-08-06 14:20:48 +02:00
parent 94ded0c5b2
commit 8113069062

View File

@ -8,6 +8,12 @@
#include <netinet/in.h>
static inline gboolean
nm_is_ascii (char ch)
{
return ((uint8_t) ch) < 128;
}
/*****************************************************************************/
pid_t nm_utils_gettid (void);