]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/genrb/ustr.h
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / tools / genrb / ustr.h
index 2160969c51dfe09bc78a48d5a1efdf8aa8065ead..05a446ea0e58ad9e51fd3b64e56ee103d8fa3a17 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1998-2003, International Business Machines
+*   Copyright (C) 1998-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
     }                                                           \
     else                                                        \
     {                                                           \
-        target[0] = U16_LEAD(c);                                                               \
-        target[1] = U16_TRAIL(c);                                                          \
+        target[0] = U16_LEAD(c);                                \
+        target[1] = U16_TRAIL(c);                               \
         len=2;                                                  \
-               target +=2;                                                                                             \
+        target +=2;                                             \
+    }                                                           \
+}
+
+#define U_APPEND_CHAR32_ONLY(c,target) {                             \
+    if (c <= 0xffff)                                            \
+    {                                                           \
+        *(target)++ = (UChar) c;                                \
+    }                                                           \
+    else                                                        \
+    {                                                           \
+        target[0] = U16_LEAD(c);                                \
+        target[1] = U16_TRAIL(c);                               \
+        target +=2;                                             \
     }                                                           \
 }
 
@@ -42,24 +55,25 @@ struct UString {
   int32_t fCapacity;
 };
 
-void ustr_init(struct UString *s);
+U_CFUNC void ustr_init(struct UString *s);
 
-void
+U_CFUNC void
 ustr_initChars(struct UString *s, const char* source, int32_t length, UErrorCode *status);
 
-void ustr_deinit(struct UString *s);
+U_CFUNC void ustr_deinit(struct UString *s);
 
-void ustr_setlen(struct UString *s, int32_t len, UErrorCode *status);
+U_CFUNC void ustr_setlen(struct UString *s, int32_t len, UErrorCode *status);
 
-void ustr_cpy(struct UString *dst, const struct UString *src,
-          UErrorCode *status);
+U_CFUNC void ustr_cpy(struct UString *dst, const struct UString *src,
+                      UErrorCode *status);
 
-void ustr_cat(struct UString *dst, const struct UString *src,
-          UErrorCode *status);
+U_CFUNC void ustr_cat(struct UString *dst, const struct UString *src,
+                      UErrorCode *status);
 
-void ustr_ncat(struct UString *dst, const struct UString *src,
-           int32_t n, UErrorCode *status);
+U_CFUNC void ustr_ncat(struct UString *dst, const struct UString *src,
+                       int32_t n, UErrorCode *status);
 
-void ustr_ucat(struct UString *dst, UChar c, UErrorCode *status);
-void ustr_uscat(struct UString *dst, const UChar* src,int len,UErrorCode *status);
+U_CFUNC void ustr_ucat(struct UString *dst, UChar c, UErrorCode *status);
+U_CFUNC void ustr_u32cat(struct UString *dst, UChar32 c, UErrorCode *status);
+U_CFUNC void ustr_uscat(struct UString *dst, const UChar* src,int len,UErrorCode *status);
 #endif