diff options
author | Einar Johan Trøan Sømåen | 2012-08-31 17:29:16 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-08-31 17:29:16 +0200 |
commit | 8a212c3b6cb5100d750fb3025e79af64e4ed86e4 (patch) | |
tree | 521eb405ff0abea29fe2e9a58ea79baa0d5bb374 /engines/wintermute/utils/convert_utf.h | |
parent | b01f09e82fd254823a839a8d4f622dc4d35bde6a (diff) | |
download | scummvm-rg350-8a212c3b6cb5100d750fb3025e79af64e4ed86e4.tar.gz scummvm-rg350-8a212c3b6cb5100d750fb3025e79af64e4ed86e4.tar.bz2 scummvm-rg350-8a212c3b6cb5100d750fb3025e79af64e4ed86e4.zip |
WINTERMUTE: Add namespacing to the UTF-conversion code
Diffstat (limited to 'engines/wintermute/utils/convert_utf.h')
-rw-r--r-- | engines/wintermute/utils/convert_utf.h | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/engines/wintermute/utils/convert_utf.h b/engines/wintermute/utils/convert_utf.h index 03a8bb2bae..171d86343a 100644 --- a/engines/wintermute/utils/convert_utf.h +++ b/engines/wintermute/utils/convert_utf.h @@ -20,6 +20,9 @@ * remains attached. */ +// NOTE: Modifications have been made to the code for inclusion +// into ScummVM. + /* --------------------------------------------------------------------- Conversions between UTF32, UTF-16, and UTF-8. Header file. @@ -86,11 +89,14 @@ All should be unsigned values to avoid sign extension during bit mask & shift operations. ------------------------------------------------------------------------ */ +#include "common/system.h" + +namespace Wintermute { -typedef unsigned long UTF32; /* at least 32 bits */ -typedef unsigned short UTF16; /* at least 16 bits */ -typedef unsigned char UTF8; /* typically 8 bits */ -typedef unsigned char Boolean; /* 0 or 1 */ +typedef uint32 UTF32; /* at least 32 bits */ +typedef uint16 UTF16; /* at least 16 bits */ +typedef uint8 UTF8; /* typically 8 bits */ +typedef uint8 Boolean; /* 0 or 1 */ /* Some fundamental constants */ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD @@ -111,39 +117,32 @@ typedef enum { lenientConversion } ConversionFlags; -/* This is for C++ and does no harm in C */ -#ifdef __cplusplus -extern "C" { -#endif - - ConversionResult ConvertUTF8toUTF16( - const UTF8 **sourceStart, const UTF8 *sourceEnd, - UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags); +ConversionResult ConvertUTF8toUTF16( + const UTF8 **sourceStart, const UTF8 *sourceEnd, + UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags); - ConversionResult ConvertUTF16toUTF8( - const UTF16 **sourceStart, const UTF16 *sourceEnd, - UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags); +ConversionResult ConvertUTF16toUTF8( + const UTF16 **sourceStart, const UTF16 *sourceEnd, + UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags); - ConversionResult ConvertUTF8toUTF32( - const UTF8 **sourceStart, const UTF8 *sourceEnd, - UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags); +ConversionResult ConvertUTF8toUTF32( + const UTF8 **sourceStart, const UTF8 *sourceEnd, + UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags); - ConversionResult ConvertUTF32toUTF8( - const UTF32 **sourceStart, const UTF32 *sourceEnd, - UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags); +ConversionResult ConvertUTF32toUTF8( + const UTF32 **sourceStart, const UTF32 *sourceEnd, + UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags); - ConversionResult ConvertUTF16toUTF32( - const UTF16 **sourceStart, const UTF16 *sourceEnd, - UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags); +ConversionResult ConvertUTF16toUTF32( + const UTF16 **sourceStart, const UTF16 *sourceEnd, + UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags); - ConversionResult ConvertUTF32toUTF16( - const UTF32 **sourceStart, const UTF32 *sourceEnd, - UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags); +ConversionResult ConvertUTF32toUTF16( + const UTF32 **sourceStart, const UTF32 *sourceEnd, + UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags); - Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); +Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); -#ifdef __cplusplus -} -#endif +} // End of namespace Wintermute /* --------------------------------------------------------------------- */ |