1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef _UTF8_H_
- #define _UTF8_H_
- #include <stdlib.h>
- #include <stdio.h>
- #include <stdint.h>
- #include <string.h>
- #include <stdbool.h>
- #include <unistd.h>
- struct uchar {
- uint8_t bytes;
- union {
- char chars[4];
- uint32_t ichars;
- };
- };
- bool uchar_valid (char* source);
-
- size_t uchar_bytes (char* source);
-
- size_t ustring_length (char* source);
-
-
- size_t ustring_bytes (char* source);
-
- size_t cstring_bytes (struct uchar* source);
-
-
-
- struct uchar next_uchar (char* source);
-
-
- void c_to_ustring (char* source, struct uchar* destination);
-
-
- void u_to_cstring (struct uchar* source, char* destination);
-
- size_t uchar_puts (int fileno, struct uchar* uc);
-
- size_t ustring_puts (int fileno, struct uchar* ustring);
- #endif
|