aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-11 20:28:28 +0200
committerMattias Andrée <maandree@kth.se>2016-07-11 20:28:28 +0200
commit564cbb378e1480ff736a14c832d39fe6db9f7891 (patch)
tree4f5e3377f21c173b6a7f72a11071fa8aa0637fd9 /src/util.h
parentAdd signal handlers (diff)
downloadcoopgammad-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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 5941e50..858d972 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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);
+