aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-10-26 21:32:55 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-10-26 21:51:49 -0700
commit189b9e23edfe60b7e82c4c7b6071a3f98799653a (patch)
tree77c1f32726446deb298a0d2e6389358bfe16bd32 /include
parent29b56ef4e4113bcd091b19d6926f18814162ca53 (diff)
fix(unicode): renamed functions to be easier to understand their functions
Diffstat (limited to 'include')
-rw-r--r--include/libunicode.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/libunicode.h b/include/libunicode.h
index e017ac5..5e69fd1 100644
--- a/include/libunicode.h
+++ b/include/libunicode.h
@@ -2,9 +2,8 @@
typedef uint32 rune;
-/*
- * We have to use the preprocessor to ensure
- * we have unsigned constants. Unfortunate...
+/*
+ * we have to use the preprocessor to ensure we have unsigned constants.
*/
#define UTFmax 4
@@ -17,14 +16,16 @@ typedef uint32 rune;
/*
* UTF-8 functions.
*/
-int utf8·len(char *s);
-int utf8·runelen(rune r);
-
-int utf8·fullrune(char *s, int n);
-char *utf8·findrune(char *s, long i);
-char *utf8·findrrune(char* s, long c);
-int utf8·bytetorune(rune *r, char *s);
-int utf8·runetobyte(char *s, rune *r);
+int utf8·len(char *s); // returns number of runes
+int utf8·runelen(rune r); // returns number of bytes for rune
+
+int utf8·decode(char *, rune *); // decode 1 rune from char stream, store into rune, return number of bytes
+int utf8·encode(rune *, char *); // encode 1 rune from rune stream, store into char, return number of bytes
+
+char *utf8·find(char *s, rune); // find rune in char stream
+char *utf8·findlast(char* s, rune); // find last rune in char stream
+
+int utf8·canfit(char *, int); // XXX: odd function...
int utf8·isletter(rune r);
int utf8·isdigit(rune r);