#ifndef __MCPU_CPP_TEXT_H__ #define __MCPU_CPP_TEXT_H__ 1 #include typedef struct mcpu_text mcpu_text; struct mcpu_text { __mpu_char16_t *data; size_t length; size_t capacity; }; void mcpu_text_init( mcpu_text *text ); void mcpu_text_free( mcpu_text *text ); int mcpu_text_reserve( mcpu_text *text, size_t need ); int mcpu_text_append( mcpu_text *text, const __mpu_char16_t *data, size_t length ); int mcpu_text_append_char( mcpu_text *text, __mpu_char16_t ch ); int mcpu_text_append_ascii( mcpu_text *text, const char *s ); int mcpu_text_append_utf8( mcpu_text *text, const char *s ); int mcpu_text_from_utf8( mcpu_text *text, const char *s ); char *mcpu_text_to_utf8( const __mpu_char16_t *data, size_t length ); int mcpu_text_equal_ascii( const __mpu_char16_t *data, size_t length, const char *s ); #endif /* __MCPU_CPP_TEXT_H__ */