diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libunicode.h | 23 |
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); |