[svn:parrot] r47091 - branches/gsoc_nfg/src/string
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Fri May 28 15:24:52 UTC 2010
Author: darbelo
Date: Fri May 28 15:24:51 2010
New Revision: 47091
URL: https://trac.parrot.org/parrot/changeset/47091
Log:
Add new struct to represent graphemes.
Modified:
branches/gsoc_nfg/src/string/unicode.h
Modified: branches/gsoc_nfg/src/string/unicode.h
==============================================================================
--- branches/gsoc_nfg/src/string/unicode.h Fri May 28 15:24:34 2010 (r47090)
+++ branches/gsoc_nfg/src/string/unicode.h Fri May 28 15:24:51 2010 (r47091)
@@ -17,6 +17,19 @@
typedef unsigned short utf16_t;
typedef unsigned long utf32_t;
+#if PARROT_HAS_ICU
+# include <unicode/uchar.h>
+
+struct grapheme_t {
+ UINTVAL len; /* Grapheme length in codepoints. */
+ UChar32 *codepoints; /* UCS-4 codepoints that make up the grapheme */
+ UINTVAL hash;
+};
+
+typedef struct grapheme_t grapheme;
+
+#endif /* PARROT_HAS_ICU */
+
#define UNICODE_SURROGATE_FIRST 0xD800u
#define UNICODE_SURROGATE_LAST 0xDFFFu
#define UNICODE_HIGH_SURROGATE_FIRST 0xD800u
More information about the parrot-commits
mailing list