]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - utf8lib.h
Merge pull request #19 from LegendaryGuard/patch-1: Improving Doxyfile
[xonotic/darkplaces.git] / utf8lib.h
index fc5d1be735e5872ef2230baafbf066a9d0967ec7..4b8221f5f779da6d7ca6d9103c6a69173acb08fa 100644 (file)
--- a/utf8lib.h
+++ b/utf8lib.h
@@ -1,9 +1,30 @@
+/*
+Copyright (C) 2009-2020 DarkPlaces contributors
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+*/
+
 /*
  * UTF-8 utility functions for DarkPlaces
  */
 #ifndef UTF8LIB_H__
 #define UTF8LIB_H__
 
+#include <stddef.h>
 #include "qtypes.h"
 
 // types for unicode strings
@@ -19,7 +40,7 @@ typedef int32_t Uchar;
 // a non-utf8 version to work: u8_strlen() will wrap to strlen()
 // u8_byteofs() and u8_charidx() will simply return whatever is passed as index parameter
 // u8_getchar() will will just return the next byte, u8_fromchar will write one byte, ...
-extern cvar_t    utf8_enable;
+extern struct cvar_s utf8_enable;
 void   u8_Init(void);
 
 size_t u8_strlen(const char*);
@@ -33,13 +54,13 @@ 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*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_colorcodes(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