aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv.h
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-24 23:09:46 +0100
committerMattias Andrée <m@maandree.se>2026-01-24 23:09:46 +0100
commitac73d14281056314aa8e1b0d3c6ade0a527aad0a (patch)
tree7e2c78b8322c00aa11a01e8ea27a15dd04106454 /libcharconv.h
parentAdd domino tiles (diff)
downloadcharconv-ac73d14281056314aa8e1b0d3c6ade0a527aad0a.tar.gz
charconv-ac73d14281056314aa8e1b0d3c6ade0a527aad0a.tar.bz2
charconv-ac73d14281056314aa8e1b0d3c6ade0a527aad0a.tar.xz
Add clock faces
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcharconv.h')
-rw-r--r--libcharconv.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libcharconv.h b/libcharconv.h
index 9eac800..0a34555 100644
--- a/libcharconv.h
+++ b/libcharconv.h
@@ -1165,4 +1165,39 @@ enum libcharconv_result libcharconv_domino_tiles_horizontal(const char *s, size_
enum libcharconv_result libcharconv_domino_tiles_vertical(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp);
+/**
+ * Convert "0:00", "1:00", ..., '24:00',
+ * "00:00", "01:00", ..., '24:00',
+ * "0:30", "1:30", ..., '23:30', and
+ * "00:30", "01:30", ..., '23:30' to CLOCK FACEs
+ *
+ * @param s Text to convert
+ * @param slen The number of bytes available in `s`
+ * @param n Output parameter for the number of consumed bytes
+ * @param cp Output buffer for the codepoints
+ * @param ncp Input parameter for the number of codepoints that
+ * fit in `cp`, and output parameter for the number
+ * of output codepoints (if it exceeds the original
+ * value of `ncp`, a larger buffer is needed)
+ * @return LIBCHARCONV_NO_CONVERT:
+ * `*n` is the number of bytes from the beginning
+ * of `s` that cannot be converted
+ * LIBCHARCONV_CONVERTED:
+ * `*n` is the number of bytes from the beginning
+ * of `s` that was converted to a codepoint which
+ * is stored in `*cp`
+ * LIBCHARCONV_INDETERMINATE:
+ * If all text has been input, no more can be
+ * converted, otherwise more of the text most
+ * be made available before the function can
+ * determine whether the beginning of `s` can be
+ * converted or what it should be converted to
+ * LIBCHARCONV_CONVERT_IF_END:
+ * As LIBCHARCONV_CONVERTED the entire text has
+ * been input, as LIBCHARCONV_INDETERMINATE
+ * otherwise
+ */
+enum libcharconv_result libcharconv_clock_faces(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp);
+
+
#endif