From 273a9933bb99adb85f5c1ae839a8cb5dc9267e2e Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Mon, 30 Nov 2009 20:37:10 +0000 Subject: [PATCH] Split off unicode.h from strlib.h. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3377 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/libs/unicode.h | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sc2/src/libs/unicode.h diff --git a/sc2/src/libs/unicode.h b/sc2/src/libs/unicode.h new file mode 100644 index 000000000..b3d947608 --- /dev/null +++ b/sc2/src/libs/unicode.h @@ -0,0 +1,55 @@ +/* + * 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 + */ + +#ifndef UNICODE_H +#define UNICODE_H + +#include "port.h" +#include + // For size_t + +typedef uint32 UniChar; + +UniChar getCharFromString(const unsigned char **ptr); +UniChar getCharFromStringN(const unsigned char **ptr, + const unsigned char *end); +unsigned char *getLineFromString(const unsigned char *start, + const unsigned char **end, const unsigned char **startNext); +size_t utf8StringCount(const unsigned char *start); +size_t utf8StringCountN(const unsigned char *start, + const unsigned char *end); +int utf8StringPos (const unsigned char *pStr, UniChar ch); +unsigned char *utf8StringCopy (unsigned char *dst, size_t size, + const unsigned char *src); +int utf8StringCompare (const unsigned char *str1, const unsigned char *str2); +unsigned char *skipUTF8Chars(const unsigned char *ptr, size_t num); +size_t getUniCharFromString(UniChar *wstr, size_t maxcount, + const unsigned char *start); +size_t getUniCharFromStringN(UniChar *wstr, size_t maxcount, + const unsigned char *start, const unsigned char *end); +int getStringFromChar(unsigned char *ptr, size_t size, UniChar ch); +size_t getStringFromWideN(unsigned char *ptr, size_t size, + const UniChar *wstr, size_t count); +size_t getStringFromWide(unsigned char *ptr, size_t size, + const UniChar *wstr); +int UniChar_isGraph(UniChar ch); +int UniChar_isPrint(UniChar ch); +UniChar UniChar_toUpper(UniChar ch); +UniChar UniChar_toLower(UniChar ch); + + +#endif /* UNICODE_H */ +