]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - utf8lib.h
fs: Stub a struct that'll be used later.
[xonotic/darkplaces.git] / utf8lib.h
index 9124c4e7905ea72ed0123aca9c20daf7a02e9f7e..41255a4e621dde26d7e11ccdf9328e92a4bfa7a8 100644 (file)
--- a/utf8lib.h
+++ b/utf8lib.h
@@ -4,21 +4,16 @@
 #ifndef UTF8LIB_H__
 #define UTF8LIB_H__
 
+#include <stddef.h>
 #include "qtypes.h"
+#include "cvar.h"
 
 // types for unicode strings
 // let them be 32 bit for now
 // normally, whcar_t is 16 or 32 bit, 16 on linux I think, 32 on haiku and maybe windows
-#ifdef _MSC_VER
-typedef __int32 U_int32;
-#else
-#include <stdint.h>
-#include <sys/types.h>
-typedef int32_t U_int32;
-#endif
 
 // Uchar, a wide character
-typedef U_int32 Uchar;
+typedef int32_t Uchar;
 
 // Initialize UTF8, this registers cvars which allows for UTF8 to be disabled
 // completely.
@@ -38,13 +33,15 @@ size_t u8_prevbyte(const char*, size_t);
 Uchar  u8_getchar_utf8_enabled(const char*, const char**);
 Uchar  u8_getnchar_utf8_enabled(const char*, const char**, size_t);
 int    u8_fromchar(Uchar, char*, size_t);
+size_t u8_mbstowcs(Uchar *, const char *, size_t);
 size_t u8_wcstombs(char*, const Uchar*, size_t);
-size_t u8_COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid);
+size_t u8_COM_StringLengthNoColors(const char *s, size_t size_s, qbool *valid);
 
 // returns a static buffer, use this for inlining
-char  *u8_encodech(Uchar ch, size_t*);
+char  *u8_encodech(Uchar ch, size_t*, char*buf16);
 
-size_t u8_strpad(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth);
+size_t u8_strpad(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth);
+size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth);
 
 /* Careful: if we disable utf8 but not freetype, we wish to see freetype chars
  * for normal letters. So use E000+x for special chars, but leave the freetype stuff for the