diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-11 20:28:28 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-11 20:28:28 +0200 |
commit | 564cbb378e1480ff736a14c832d39fe6db9f7891 (patch) | |
tree | 4f5e3377f21c173b6a7f72a11071fa8aa0637fd9 /src/util.h | |
parent | Add signal handlers (diff) | |
download | coopgammad-564cbb378e1480ff736a14c832d39fe6db9f7891.tar.gz coopgammad-564cbb378e1480ff736a14c832d39fe6db9f7891.tar.bz2 coopgammad-564cbb378e1480ff736a14c832d39fe6db9f7891.tar.xz |
whitespace + Add message.[ch]
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/util.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -63,3 +63,16 @@ int dup2atleast(int fd, int atleast); */ void msleep(int ms); + +/** + * Check whether a NUL-terminated string is encoded in UTF-8 + * + * @param string The string + * @param allow_modified_nul Whether Modified UTF-8 is allowed, which allows a two-byte encoding for NUL + * @return Zero if good, -1 on encoding error + */ +#if defined(__GNUC__) +__attribute__((pure)) +#endif +int verify_utf8(const char* string, int allow_modified_nul); + |