]> git.ozlabs.org Git - ccan/blobdiff - ccan/charset/charset.h
check_type: fix incorrect documentation.
[ccan] / ccan / charset / charset.h
index 257d2860d70122efb407ae2d4d49b84015f72dcc..898bfb5ae89deeffdd0414f420dd017015288acc 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-  Copyright (C) 2010 Joseph A. Adams (joeyadams3.14159@gmail.com)
+  Copyright (C) 2011 Joseph A. Adams (joeyadams3.14159@gmail.com)
   All rights reserved.
 
   Permission is hereby granted, free of charge, to any person obtaining a copy
   All rights reserved.
 
   Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -42,6 +42,16 @@ typedef uint32_t uchar_t;
  */
 bool utf8_validate(const char *str, size_t length);
 
  */
 bool utf8_validate(const char *str, size_t length);
 
+/*
+ * Validate a single UTF-8 character.
+ * @s: Beginning of UTF-8 character.
+ * @e: End of string.
+ *
+ * If it's valid, return its length (1 thru 4).
+ * If it's invalid or clipped, return 0.
+ */
+int utf8_validate_char(const char *s, const char *e);
+
 /*
  * Read a single UTF-8 character starting at @s,
  * returning the length, in bytes, of the character read.
 /*
  * Read a single UTF-8 character starting at @s,
  * returning the length, in bytes, of the character read.