18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
28e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project**********************************************************************
38e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*   Copyright (C) 1998-2004, International Business Machines
48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*   Corporation and others.  All Rights Reserved.
58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project**********************************************************************
68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project* File ustring.h
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project* Modification History:
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*   Date        Name        Description
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*   12/07/98    bertrand    Creation.
138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project******************************************************************************
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef USTRING_H
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#define USTRING_H
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "unicode/utypes.h"
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "unicode/putil.h"
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "unicode/uiter.h"
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/** Simple declaration for u_strToTitle() to avoid including unicode/ubrk.h. @stable ICU 2.1*/
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define UBRK_TYPEDEF_UBREAK_ITERATOR
268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    typedef void UBreakIterator;
278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \file
318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \brief C API: Unicode string handling functions
328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * These C API functions provide general Unicode string handling.
348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Some functions are equivalent in name, signature, and behavior to the ANSI C <string.h>
368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * functions. (For example, they do not check for bad arguments like NULL string pointers.)
378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * In some cases, only the thread-safe variant of such a function is implemented here
388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (see u_strtok_r()).
398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Other functions provide more Unicode-specific functionality like locale-specific
418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * upper/lower-casing and string comparison in code point order.
428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * ICU uses 16-bit Unicode (UTF-16) in the form of arrays of UChar code units.
448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * UTF-16 encodes each Unicode code point with either one or two UChar code units.
458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (This is the default form of Unicode, and a forward-compatible extension of the original,
468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * fixed-width form that was known as UCS-2. UTF-16 superseded UCS-2 with Unicode 2.0
478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * in 1996.)
488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Some APIs accept a 32-bit UChar32 value for a single code point.
508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * ICU also handles 16-bit Unicode text with unpaired surrogates.
528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Such text is not well-formed UTF-16.
538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Code-point-related functions treat unpaired surrogates as surrogate code points,
548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * i.e., as separate units.
558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Although UTF-16 is a variable-width encoding form (like some legacy multi-byte encodings),
578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * it is much more efficient even for random access because the code unit values
588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * for single-unit characters vs. lead units vs. trail units are completely disjoint.
598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This means that it is easy to determine character (code point) boundaries from
608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * random offsets in the string.
618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Unicode (UTF-16) string processing is optimized for the single-unit case.
638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Although it is important to support supplementary characters
648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (which use pairs of lead/trail code units called "surrogates"),
658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * their occurrence is rare. Almost all characters in modern use require only
668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * a single UChar code unit (i.e., their code point values are <=0xffff).
678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * For more details see the User Guide Strings chapter (http://oss.software.ibm.com/icu/userguide/strings.html).
698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * For a discussion of the handling of unpaired surrogates see also
708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Jitterbug 2145 and its icu mailing list proposal on 2002-sep-18.
718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Determine the length of an array of UChar.
758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The array of UChars, NULL (U+0000) terminated.
778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The number of UChars in <code>chars</code>, minus the terminator.
788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strlen(const UChar *s);
828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Count Unicode code points in the length UChar code units of the string.
858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A code point may occupy either one or two UChar code units.
868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Counting code points involves reading all code units.
878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This functions is basically the inverse of the U16_FWD_N() macro (see utf.h).
898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The input string.
918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length The number of UChar code units to be checked, or -1 to count all
928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *               code points before the first NUL (U+0000).
938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The number of code points in the specified code units.
948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_countChar32(const UChar *s, int32_t length);
988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
1008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Check if the string contains more Unicode code points than a certain number.
1018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is more efficient than counting all code points in the entire string
1028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * and comparing that number with a threshold.
1038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This function may not need to scan the string at all if the length is known
1048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (not -1 for NUL-termination) and falls within a certain range, and
1058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * never needs to count more than 'number+1' code points.
1068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Logically equivalent to (u_countChar32(s, length)>number).
1078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A Unicode code point may occupy either one or two UChar code units.
1088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The input string.
1108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length The length of the string, or -1 if it is NUL-terminated.
1118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param number The number of code points in the string is compared against
1128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *               the 'number' parameter.
1138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return Boolean value for whether the string contains more Unicode code points
1148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         than 'number'. Same as (u_countChar32(s, length)>number).
1158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
1168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
1178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UBool U_EXPORT2
1188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number);
1198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
1218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Concatenate two ustrings.  Appends a copy of <code>src</code>,
1228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * including the null terminator, to <code>dst</code>. The initial copied
1238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * character from <code>src</code> overwrites the null terminator in <code>dst</code>.
1248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
1268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
1278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
1288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
1298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
1308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
1318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strcat(UChar     *dst,
1328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const UChar     *src);
1338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
1358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Concatenate two ustrings.
1368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Appends at most <code>n</code> characters from <code>src</code> to <code>dst</code>.
1378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Adds a terminating NUL.
1388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * If src is too long, then only <code>n-1</code> characters will be copied
1398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * before the terminating NUL.
1408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * If <code>n&lt;=0</code> then dst is not modified.
1418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
1438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
1448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters to compare.
1458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
1468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
1478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
1488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
1498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strncat(UChar     *dst,
1508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     const UChar     *src,
1518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     int32_t     n);
1528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
1548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the first occurrence of a substring in a string.
1558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The substring is found at code point boundaries.
1568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * That means that if the substring begins with
1578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * a trail surrogate or ends with a lead surrogate,
1588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * then it is found only if these surrogates stand alone in the text.
1598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Otherwise, the substring edge units would be matched against
1608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * halves of surrogate pairs.
1618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (NUL-terminated).
1638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param substring The substring to find (NUL-terminated).
1648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the first occurrence of <code>substring</code> in <code>s</code>,
1658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>s</code> itself if the <code>substring</code> is empty,
1668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
1678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
1688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrstr
1708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindFirst
1718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
1728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
1738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
1748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strstr(const UChar *s, const UChar *substring);
1758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
1778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the first occurrence of a substring in a string.
1788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The substring is found at code point boundaries.
1798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * That means that if the substring begins with
1808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * a trail surrogate or ends with a lead surrogate,
1818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * then it is found only if these surrogates stand alone in the text.
1828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Otherwise, the substring edge units would be matched against
1838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * halves of surrogate pairs.
1848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search.
1868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length The length of s (number of UChars), or -1 if it is NUL-terminated.
1878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param substring The substring to find (NUL-terminated).
1888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated.
1898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the first occurrence of <code>substring</code> in <code>s</code>,
1908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>s</code> itself if the <code>substring</code> is empty,
1918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
1928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
1938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
1948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strstr
1958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
1968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
1978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
1988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strFindFirst(const UChar *s, int32_t length, const UChar *substring, int32_t subLength);
1998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
2018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the first occurrence of a BMP code point in a string.
2028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
2038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
2048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
2058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (NUL-terminated).
2078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The BMP code point to find.
2088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
2098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
2108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
2118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strchr32
2138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memchr
2148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strstr
2158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindFirst
2168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
2178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
2188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strchr(const UChar *s, UChar c);
2198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
2218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the first occurrence of a code point in a string.
2228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
2238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
2248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
2258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (NUL-terminated).
2278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The code point to find.
2288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
2298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
2308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
2318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strchr
2338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memchr32
2348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strstr
2358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindFirst
2368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
2378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
2388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strchr32(const UChar *s, UChar32 c);
2398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
2418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the last occurrence of a substring in a string.
2428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The substring is found at code point boundaries.
2438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * That means that if the substring begins with
2448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * a trail surrogate or ends with a lead surrogate,
2458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * then it is found only if these surrogates stand alone in the text.
2468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Otherwise, the substring edge units would be matched against
2478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * halves of surrogate pairs.
2488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (NUL-terminated).
2508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param substring The substring to find (NUL-terminated).
2518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the last occurrence of <code>substring</code> in <code>s</code>,
2528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>s</code> itself if the <code>substring</code> is empty,
2538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
2548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
2558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strstr
2578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindFirst
2588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
2598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
2608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
2618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strrstr(const UChar *s, const UChar *substring);
2628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
2648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the last occurrence of a substring in a string.
2658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The substring is found at code point boundaries.
2668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * That means that if the substring begins with
2678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * a trail surrogate or ends with a lead surrogate,
2688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * then it is found only if these surrogates stand alone in the text.
2698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Otherwise, the substring edge units would be matched against
2708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * halves of surrogate pairs.
2718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search.
2738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length The length of s (number of UChars), or -1 if it is NUL-terminated.
2748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param substring The substring to find (NUL-terminated).
2758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated.
2768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the last occurrence of <code>substring</code> in <code>s</code>,
2778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>s</code> itself if the <code>substring</code> is empty,
2788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
2798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
2808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strstr
2828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
2838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
2848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
2858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strFindLast(const UChar *s, int32_t length, const UChar *substring, int32_t subLength);
2868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
2888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the last occurrence of a BMP code point in a string.
2898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
2908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
2918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
2928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (NUL-terminated).
2948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The BMP code point to find.
2958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
2968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
2978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
2988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
2998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrchr32
3008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memrchr
3018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrstr
3028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
3038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
3048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
3058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strrchr(const UChar *s, UChar c);
3068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
3088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the last occurrence of a code point in a string.
3098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
3108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
3118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
3128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
3138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (NUL-terminated).
3148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The code point to find.
3158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
3168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
3178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
3188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
3198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrchr
3208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memchr32
3218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrstr
3228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
3238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
3248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
3258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strrchr32(const UChar *s, UChar32 c);
3268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
3288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Locates the first occurrence in the string <code>string</code> of any of the characters
3298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * in the string <code>matchSet</code>.
3308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Works just like C's strpbrk but with Unicode.
3318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
3328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param string The string in which to search, NUL-terminated.
3338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param matchSet A NUL-terminated string defining a set of code points
3348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                 for which to search in the text string.
3358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the  character in <code>string</code> that matches one of the
3368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         characters in <code>matchSet</code>, or NULL if no such character is found.
3378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
3388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
3398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
3408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strpbrk(const UChar *string, const UChar *matchSet);
3418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
3438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Returns the number of consecutive characters in <code>string</code>,
3448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * beginning with the first, that do not occur somewhere in <code>matchSet</code>.
3458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Works just like C's strcspn but with Unicode.
3468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
3478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param string The string in which to search, NUL-terminated.
3488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param matchSet A NUL-terminated string defining a set of code points
3498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                 for which to search in the text string.
3508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The number of initial characters in <code>string</code> that do not
3518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         occur in <code>matchSet</code>.
3528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strspn
3538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
3548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
3558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
3568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strcspn(const UChar *string, const UChar *matchSet);
3578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
3598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Returns the number of consecutive characters in <code>string</code>,
3608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * beginning with the first, that occur somewhere in <code>matchSet</code>.
3618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Works just like C's strspn but with Unicode.
3628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
3638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param string The string in which to search, NUL-terminated.
3648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param matchSet A NUL-terminated string defining a set of code points
3658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                 for which to search in the text string.
3668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The number of initial characters in <code>string</code> that do
3678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         occur in <code>matchSet</code>.
3688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strcspn
3698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
3708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
3718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
3728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strspn(const UChar *string, const UChar *matchSet);
3738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
3758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The string tokenizer API allows an application to break a string into
3768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * tokens. Unlike strtok(), the saveState (the current pointer within the
3778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * original string) is maintained in saveState. In the first call, the
3788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * argument src is a pointer to the string. In subsequent calls to
3798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * return successive tokens of that string, src must be specified as
3808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * NULL. The value saveState is set by this function to maintain the
3818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * function's position within the string, and on each subsequent call
3828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * you must give this argument the same variable. This function does
3838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * handle surrogate pairs. This function is similar to the strtok_r()
3848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * the POSIX Threads Extension (1003.1c-1995) version.
3858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
3868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src String containing token(s). This string will be modified.
3878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *            After the first call to u_strtok_r(), this argument must
3888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *            be NULL to get to the next token.
3898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param delim Set of delimiter characters (Unicode code points).
3908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param saveState The current pointer within the original string,
3918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *              which is set by this function. The saveState
3928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *              parameter should the address of a local variable of type
3938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *              UChar *. (i.e. defined "Uhar *myLocalSaveState" and use
3948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *              &myLocalSaveState for this parameter).
3958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the next token found in src, or NULL
3968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         when there are no more tokens.
3978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
3988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
3998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar * U_EXPORT2
4008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strtok_r(UChar    *src,
4018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     const UChar    *delim,
4028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           UChar   **saveState);
4038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
4058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two Unicode strings for bitwise equality (code unit order).
4068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
4088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
4098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return 0 if <code>s1</code> and <code>s2</code> are bitwise equal; a negative
4108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * value if <code>s1</code> is bitwise less than <code>s2,</code>; a positive
4118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * value if <code>s1</code> is bitwise greater than <code>s2</code>.
4128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
4138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t  U_EXPORT2
4158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strcmp(const UChar     *s1,
4168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project         const UChar     *s2);
4178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
4198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two Unicode strings in code point order.
4208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * See u_strCompare for details.
4218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
4238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
4248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return a negative/zero/positive integer corresponding to whether
4258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * the first string is less than/equal to/greater than the second one
4268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * in code point order
4278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
4288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
4308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strcmpCodePointOrder(const UChar *s1, const UChar *s2);
4318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
4338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two Unicode strings (binary order).
4348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The comparison can be done in code unit order or in code point order.
4368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * They differ only in UTF-16 when
4378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * comparing supplementary code points (U+10000..U+10ffff)
4388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * to BMP code points near the end of the BMP (i.e., U+e000..U+ffff).
4398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * In code unit order, high BMP code points sort after supplementary code points
4408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * because they are stored as pairs of surrogates which are at U+d800..U+dfff.
4418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This functions works with strings of different explicitly specified lengths
4438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
4448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * NUL-terminated strings are possible with length arguments of -1.
4458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 First source string.
4478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length1 Length of first source string, or -1 if NUL-terminated.
4488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 Second source string.
4508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length2 Length of second source string, or -1 if NUL-terminated.
4518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param codePointOrder Choose between code unit order (FALSE)
4538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                       and code point order (TRUE).
4548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return <0 or 0 or >0 as usual for string comparisons
4568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.2
4588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
4608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strCompare(const UChar *s1, int32_t length1,
4618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const UChar *s2, int32_t length2,
4628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UBool codePointOrder);
4638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
4658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two Unicode strings (binary order)
4668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * as presented by UCharIterator objects.
4678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Works otherwise just like u_strCompare().
4688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Both iterators are reset to their start positions.
4708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * When the function returns, it is undefined where the iterators
4718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * have stopped.
4728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param iter1 First source string iterator.
4748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param iter2 Second source string iterator.
4758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param codePointOrder Choose between code unit order (FALSE)
4768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                       and code point order (TRUE).
4778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return <0 or 0 or >0 as usual for string comparisons
4798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strCompare
4818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
4828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.6
4838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
4858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strCompareIter(UCharIterator *iter1, UCharIterator *iter2, UBool codePointOrder);
4868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef U_COMPARE_CODE_POINT_ORDER
4888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/* see also unistr.h and unorm.h */
4898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
4908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc:
4918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare strings in code point order instead of code unit order.
4928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.2
4938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#define U_COMPARE_CODE_POINT_ORDER  0x8000
4958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
4968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
4988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two strings case-insensitively using full case folding.
4998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is equivalent to
5008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   u_strCompare(u_strFoldCase(s1, options),
5018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                u_strFoldCase(s2, options),
5028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                (options&U_COMPARE_CODE_POINT_ORDER)!=0).
5038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The comparison can be done in UTF-16 code unit order or in code point order.
5058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * They differ only when comparing supplementary code points (U+10000..U+10ffff)
5068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * to BMP code points near the end of the BMP (i.e., U+e000..U+ffff).
5078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * In code unit order, high BMP code points sort after supplementary code points
5088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * because they are stored as pairs of surrogates which are at U+d800..U+dfff.
5098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This functions works with strings of different explicitly specified lengths
5118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
5128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * NUL-terminated strings are possible with length arguments of -1.
5138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 First source string.
5158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length1 Length of first source string, or -1 if NUL-terminated.
5168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 Second source string.
5188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length2 Length of second source string, or -1 if NUL-terminated.
5198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param options A bit set of options:
5218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
5228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Comparison in code unit order with default case folding.
5238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_COMPARE_CODE_POINT_ORDER
5258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Set to choose code point order instead of code unit order
5268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     (see u_strCompare for details).
5278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
5298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode Must be a valid pointer to an error code value,
5318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  which must not indicate a failure before the function call.
5328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return <0 or 0 or >0 as usual for string comparisons
5348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.2
5368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
5378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
5388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strCaseCompare(const UChar *s1, int32_t length1,
5398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project                 const UChar *s2, int32_t length2,
5408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project                 uint32_t options,
5418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project                 UErrorCode *pErrorCode);
5428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
5448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two ustrings for bitwise equality.
5458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compares at most <code>n</code> characters.
5468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param ucs1 A string to compare.
5488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param ucs2 A string to compare.
5498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters to compare.
5508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return 0 if <code>s1</code> and <code>s2</code> are bitwise equal; a negative
5518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * value if <code>s1</code> is bitwise less than <code>s2</code>; a positive
5528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * value if <code>s1</code> is bitwise greater than <code>s2</code>.
5538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
5548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
5558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
5568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strncmp(const UChar     *ucs1,
5578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     const UChar     *ucs2,
5588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     int32_t     n);
5598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
5618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two Unicode strings in code point order.
5628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is different in UTF-16 from u_strncmp() if supplementary characters are present.
5638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * For details, see u_strCompare().
5648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
5668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
5678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters to compare.
5688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return a negative/zero/positive integer corresponding to whether
5698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * the first string is less than/equal to/greater than the second one
5708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * in code point order
5718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
5728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
5738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
5748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n);
5758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
5778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two strings case-insensitively using full case folding.
5788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is equivalent to u_strcmp(u_strFoldCase(s1, options), u_strFoldCase(s2, options)).
5798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
5818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
5828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param options A bit set of options:
5838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
5848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Comparison in code unit order with default case folding.
5858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_COMPARE_CODE_POINT_ORDER
5878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Set to choose code point order instead of code unit order
5888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     (see u_strCompare for details).
5898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
5918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
5928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A negative, zero, or positive integer indicating the comparison result.
5938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
5948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
5958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
5968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options);
5978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
5998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two strings case-insensitively using full case folding.
6008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is equivalent to u_strcmp(u_strFoldCase(s1, at most n, options),
6018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * u_strFoldCase(s2, at most n, options)).
6028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
6048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
6058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters each string to case-fold and then compare.
6068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param options A bit set of options:
6078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
6088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Comparison in code unit order with default case folding.
6098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_COMPARE_CODE_POINT_ORDER
6118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Set to choose code point order instead of code unit order
6128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     (see u_strCompare for details).
6138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
6158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A negative, zero, or positive integer indicating the comparison result.
6178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
6188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
6198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
6208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options);
6218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
6238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two strings case-insensitively using full case folding.
6248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is equivalent to u_strcmp(u_strFoldCase(s1, n, options),
6258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * u_strFoldCase(s2, n, options)).
6268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
6288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
6298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length The number of characters in each string to case-fold and then compare.
6308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param options A bit set of options:
6318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
6328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Comparison in code unit order with default case folding.
6338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_COMPARE_CODE_POINT_ORDER
6358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     Set to choose code point order instead of code unit order
6368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     (see u_strCompare for details).
6378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
6398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A negative, zero, or positive integer indicating the comparison result.
6418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
6428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
6438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
6448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options);
6458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
6478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copy a ustring. Adds a null terminator.
6488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
6508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
6518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
6528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
6538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
6548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
6558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strcpy(UChar     *dst,
6568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const UChar     *src);
6578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
6598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copy a ustring.
6608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copies at most <code>n</code> characters.  The result will be null terminated
6618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * if the length of <code>src</code> is less than <code>n</code>.
6628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
6648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
6658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters to copy.
6668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
6678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
6688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
6698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
6708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strncpy(UChar     *dst,
6718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     const UChar     *src,
6728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project     int32_t     n);
6738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if !UCONFIG_NO_CONVERSION
6758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
6778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copy a byte string encoded in the default codepage to a ustring.
6788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Adds a null terminator.
6798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Performs a host byte to UChar conversion
6808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
6828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
6838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
6848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
6858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
6868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2 u_uastrcpy(UChar *dst,
6878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project               const char *src );
6888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
6908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copy a byte string encoded in the default codepage to a ustring.
6918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copies at most <code>n</code> characters.  The result will be null terminated
6928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * if the length of <code>src</code> is less than <code>n</code>.
6938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Performs a host byte to UChar conversion
6948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
6958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
6968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
6978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters to copy.
6988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
6998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2 u_uastrncpy(UChar *dst,
7028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            const char *src,
7038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            int32_t n);
7048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copy ustring to a byte string encoded in the default codepage.
7078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Adds a null terminator.
7088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Performs a UChar to host byte conversion
7098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
7108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
7118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
7128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
7138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE char* U_EXPORT2 u_austrcpy(char *dst,
7168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            const UChar *src );
7178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copy ustring to a byte string encoded in the default codepage.
7208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copies at most <code>n</code> characters.  The result will be null terminated
7218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * if the length of <code>src</code> is less than <code>n</code>.
7228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Performs a UChar to host byte conversion
7238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
7248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dst The destination string.
7258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string.
7268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param n The maximum number of characters to copy.
7278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dst</code>.
7288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE char* U_EXPORT2 u_austrncpy(char *dst,
7318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            const UChar *src,
7328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            int32_t n );
7338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
7358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Synonym for memcpy(), but with UChars only.
7388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest The destination string
7398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string
7408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The number of characters to copy
7418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dest</code>
7428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
7458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memcpy(UChar *dest, const UChar *src, int32_t count);
7468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Synonym for memmove(), but with UChars only.
7498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest The destination string
7508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src The source string
7518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The number of characters to move
7528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dest</code>
7538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
7568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memmove(UChar *dest, const UChar *src, int32_t count);
7578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Initialize <code>count</code> characters of <code>dest</code> to <code>c</code>.
7608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
7618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest The destination string.
7628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The character to initialize the string.
7638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The maximum number of characters to set.
7648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to <code>dest</code>.
7658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
7688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memset(UChar *dest, UChar c, int32_t count);
7698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare the first <code>count</code> UChars of each buffer.
7728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
7738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param buf1 The first string to compare.
7748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param buf2 The second string to compare.
7758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The maximum number of UChars to compare.
7768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return When buf1 < buf2, a negative number is returned.
7778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *      When buf1 == buf2, 0 is returned.
7788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *      When buf1 > buf2, a positive number is returned.
7798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
7828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memcmp(const UChar *buf1, const UChar *buf2, int32_t count);
7838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
7848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
7858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Compare two Unicode strings in code point order.
7868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This is different in UTF-16 from u_memcmp() if supplementary characters are present.
7878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * For details, see u_strCompare().
7888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
7898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s1 A string to compare.
7908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s2 A string to compare.
7918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The maximum number of characters to compare.
7928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return a negative/zero/positive integer corresponding to whether
7938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * the first string is less than/equal to/greater than the second one
7948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * in code point order
7958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
7968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
7978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
7988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count);
7998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
8008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
8018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the first occurrence of a BMP code point in a string.
8028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
8038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
8048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
8058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (contains <code>count</code> UChars).
8078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The BMP code point to find.
8088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The length of the string.
8098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
8108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
8118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
8128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strchr
8148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memchr32
8158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindFirst
8168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
8178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
8188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memchr(const UChar *s, UChar c, int32_t count);
8198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
8208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
8218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the first occurrence of a code point in a string.
8228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
8238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
8248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
8258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (contains <code>count</code> UChars).
8278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The code point to find.
8288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The length of the string.
8298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
8308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
8318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
8328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strchr32
8348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memchr
8358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindFirst
8368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
8378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
8388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memchr32(const UChar *s, UChar32 c, int32_t count);
8398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
8408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
8418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the last occurrence of a BMP code point in a string.
8428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
8438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
8448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
8458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (contains <code>count</code> UChars).
8478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The BMP code point to find.
8488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The length of the string.
8498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
8508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
8518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
8528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrchr
8548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memrchr32
8558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
8568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
8578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
8588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memrchr(const UChar *s, UChar c, int32_t count);
8598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
8608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
8618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Find the last occurrence of a code point in a string.
8628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A surrogate code point is found only if its match in the text is not
8638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * part of a surrogate pair.
8648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A NUL character is found at the string terminator.
8658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param s The string to search (contains <code>count</code> UChars).
8678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param c The code point to find.
8688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param count The length of the string.
8698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
8708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
8718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.4
8728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strrchr32
8748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_memrchr
8758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_strFindLast
8768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
8778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
8788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_memrchr32(const UChar *s, UChar32 c, int32_t count);
8798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
8808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
8818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Unicode String literals in C.
8828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * We need one macro to declare a variable for the string
8838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * and to statically preinitialize it if possible,
8848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * and a second macro to dynamically intialize such a string variable if necessary.
8858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The macros are defined for maximum performance.
8878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * They work only for strings that contain "invariant characters", i.e.,
8888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * only latin letters, digits, and some punctuation.
8898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * See utypes.h for details.
8908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * A pair of macros for a single string must be used with the same
8928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * parameters.
8938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The string parameter must be a C string literal.
8948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The length of the string, not including the terminating
8958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * <code>NUL</code>, must be specified as a constant.
8968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The U_STRING_DECL macro should be invoked exactly once for one
8978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * such string variable before it is used.
8988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
8998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Usage:
9008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * <pre>
9018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;   U_STRING_DECL(ustringVar1, "Quick-Fox 2", 11);
9028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;   U_STRING_DECL(ustringVar2, "jumps 5%", 8);
9038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;   static UBool didInit=FALSE;
9048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;
9058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;   int32_t function() {
9068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;       if(!didInit) {
9078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;           U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11);
9088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;           U_STRING_INIT(ustringVar2, "jumps 5%", 8);
9098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;           didInit=TRUE;
9108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;       }
9118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;       return u_strcmp(ustringVar1, ustringVar2);
9128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * &#32;   }
9138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * </pre>
9148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
9158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
9168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && U_CHARSET_FAMILY==U_ASCII_FAMILY
9178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define U_STRING_DECL(var, cs, length) static const wchar_t var[(length)+1]={ L ## cs }
9188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    /**@stable ICU 2.0 */
9198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define U_STRING_INIT(var, cs, length)
9208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
9218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]={ (const UChar *)cs }
9228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    /**@stable ICU 2.0 */
9238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define U_STRING_INIT(var, cs, length)
9248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#else
9258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define U_STRING_DECL(var, cs, length) static UChar var[(length)+1]
9268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    /**@stable ICU 2.0 */
9278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#   define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
9288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
9298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
9308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
9318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Unescape a string of characters and write the resulting
9328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Unicode characters to the destination buffer.  The following escape
9338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * sequences are recognized:
9348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\uhhhh       4 hex digits; h in [0-9A-Fa-f]
9368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\Uhhhhhhhh   8 hex digits
9378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\xhh         1-2 hex digits
9388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\x{h...}     1-8 hex digits
9398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\ooo         1-3 octal digits; o in [0-7]
9408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\cX          control-X; X is masked with 0x1F
9418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * as well as the standard ANSI C escapes:
9438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\a => U+0007, \\b => U+0008, \\t => U+0009, \\n => U+000A,
9458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\v => U+000B, \\f => U+000C, \\r => U+000D, \\e => U+001B,
9468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * \\" => U+0022, \\' => U+0027, \\? => U+003F, \\\\ => U+005C
9478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Anything else following a backslash is generically escaped.  For
9498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * example, "[a\\-z]" returns "[a-z]".
9508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * If an escape sequence is ill-formed, this method returns an empty
9528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * string.  An example of an ill-formed sequence is "\\u" followed by
9538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * fewer than 4 hex digits.
9548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The above characters are recognized in the compiler's codepage,
9568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * that is, they are coded as 'u', '\\', etc.  Characters that are
9578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * not parts of escape sequences are converted using u_charsToUChars().
9588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This function is similar to UnicodeString::unescape() but not
9608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * identical to it.  The latter takes a source UnicodeString, so it
9618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * does escape recognition but no conversion.
9628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src a zero-terminated string of invariant characters
9648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest pointer to buffer to receive converted and unescaped
9658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * text and, if there is room, a zero terminator.  May be NULL for
9668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * preflighting, in which case no UChars will be written, but the
9678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * return value will still be valid.  On error, an empty string is
9688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * stored here (if possible).
9698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity the number of UChars that may be written at
9708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * dest.  Ignored if dest == NULL.
9718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return the length of unescaped string.
9728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_unescapeAt
9738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see UnicodeString#unescape()
9748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see UnicodeString#unescapeAt()
9758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
9768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
9778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
9788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_unescape(const char *src,
9798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           UChar *dest, int32_t destCapacity);
9808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
9818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_CDECL_BEGIN
9828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
9838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Callback function for u_unescapeAt() that returns a character of
9848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * the source text given an offset and a context pointer.  The context
9858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * pointer will be whatever is passed into u_unescapeAt().
9868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
9878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param offset pointer to the offset that will be passed to u_unescapeAt().
9888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param context an opaque pointer passed directly into u_unescapeAt()
9898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return the character represented by the escape sequence at
9908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * offset
9918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_unescapeAt
9928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
9938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
9948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef UChar (U_CALLCONV *UNESCAPE_CHAR_AT)(int32_t offset, void *context);
9958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_CDECL_END
9968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
9978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
9988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Unescape a single sequence. The character at offset-1 is assumed
9998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (without checking) to be a backslash.  This method takes a callback
10008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * pointer to a function that returns the UChar at a given offset.  By
10018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * varying this callback, ICU functions are able to unescape char*
10028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * strings, UnicodeString objects, and UFILE pointers.
10038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
10048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * If offset is out of range, or if the escape sequence is ill-formed,
10058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (UChar32)0xFFFFFFFF is returned.  See documentation of u_unescape()
10068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * for a list of recognized sequences.
10078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
10088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param charAt callback function that returns a UChar of the source
10098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * text given an offset and a context pointer.
10108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param offset pointer to the offset that will be passed to charAt.
10118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The offset value will be updated upon return to point after the
10128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * last parsed character of the escape sequence.  On error the offset
10138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * is unchanged.
10148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param length the number of characters in the source text.  The
10158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * last character of the source text is considered to be at offset
10168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * length-1.
10178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param context an opaque pointer passed directly into charAt.
10188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return the character represented by the escape sequence at
10198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * offset, or (UChar32)0xFFFFFFFF on error.
10208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see u_unescape()
10218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see UnicodeString#unescape()
10228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @see UnicodeString#unescapeAt()
10238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
10248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
10258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar32 U_EXPORT2
10268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_unescapeAt(UNESCAPE_CHAR_AT charAt,
10278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t *offset,
10288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t length,
10298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             void *context);
10308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
10318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
10328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Uppercase the characters in a string.
10338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Casing is locale-dependent and context-sensitive.
10348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The result may be longer or shorter than the original.
10358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The source string and the destination buffer are allowed to overlap.
10368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
10378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest      A buffer for the result string. The result will be zero-terminated if
10388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  the buffer is large enough.
10398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
10408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  dest may be NULL and the function will only return the length of the result
10418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  without writing any of the result string.
10428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src       The original string
10438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
10448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param locale    The locale to consider, or "" for the root locale or NULL for the default locale.
10458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode Must be a valid pointer to an error code value,
10468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  which must not indicate a failure before the function call.
10478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The length of the result string. It may be greater than destCapacity. In that case,
10488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         only some of the result was written to the destination buffer.
10498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
10508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
10518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
10528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strToUpper(UChar *dest, int32_t destCapacity,
10538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const UChar *src, int32_t srcLength,
10548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const char *locale,
10558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UErrorCode *pErrorCode);
10568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
10578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
10588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Lowercase the characters in a string.
10598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Casing is locale-dependent and context-sensitive.
10608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The result may be longer or shorter than the original.
10618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The source string and the destination buffer are allowed to overlap.
10628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
10638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest      A buffer for the result string. The result will be zero-terminated if
10648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  the buffer is large enough.
10658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
10668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  dest may be NULL and the function will only return the length of the result
10678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  without writing any of the result string.
10688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src       The original string
10698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
10708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param locale    The locale to consider, or "" for the root locale or NULL for the default locale.
10718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode Must be a valid pointer to an error code value,
10728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  which must not indicate a failure before the function call.
10738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The length of the result string. It may be greater than destCapacity. In that case,
10748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         only some of the result was written to the destination buffer.
10758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
10768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
10778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
10788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strToLower(UChar *dest, int32_t destCapacity,
10798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const UChar *src, int32_t srcLength,
10808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const char *locale,
10818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UErrorCode *pErrorCode);
10828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
10838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if !UCONFIG_NO_BREAK_ITERATION
10848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
10858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
10868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Titlecase a string.
10878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Casing is locale-dependent and context-sensitive.
10888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Titlecasing uses a break iterator to find the first characters of words
10898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * that are to be titlecased. It titlecases those characters and lowercases
10908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * all others.
10918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
10928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The titlecase break iterator can be provided to customize for arbitrary
10938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * styles, using rules and dictionaries beyond the standard iterators.
10948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * It may be more efficient to always provide an iterator to avoid
10958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * opening and closing one for each string.
10968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The standard titlecase iterator for the root locale implements the
10978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * algorithm of Unicode TR 21.
10988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
10998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * This function uses only the first() and next() methods of the
11008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * provided break iterator.
11018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
11028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The result may be longer or shorter than the original.
11038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The source string and the destination buffer are allowed to overlap.
11048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
11058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest      A buffer for the result string. The result will be zero-terminated if
11068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  the buffer is large enough.
11078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
11088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  dest may be NULL and the function will only return the length of the result
11098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  without writing any of the result string.
11108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src       The original string
11118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
11128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param titleIter A break iterator to find the first characters of words
11138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  that are to be titlecased.
11148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  If none is provided (NULL), then a standard titlecase
11158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  break iterator is opened.
11168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param locale    The locale to consider, or "" for the root locale or NULL for the default locale.
11178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode Must be a valid pointer to an error code value,
11188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  which must not indicate a failure before the function call.
11198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The length of the result string. It may be greater than destCapacity. In that case,
11208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         only some of the result was written to the destination buffer.
11218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.1
11228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
11238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
11248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strToTitle(UChar *dest, int32_t destCapacity,
11258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const UChar *src, int32_t srcLength,
11268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UBreakIterator *titleIter,
11278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const char *locale,
11288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UErrorCode *pErrorCode);
11298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
11308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
11318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
11328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
11338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Case-fold the characters in a string.
11348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Case-folding is locale-independent and not context-sensitive,
11358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * but there is an option for whether to include or exclude mappings for dotted I
11368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * and dotless i that are marked with 'I' in CaseFolding.txt.
11378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The result may be longer or shorter than the original.
11388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * The source string and the destination buffer are allowed to overlap.
11398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
11408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest      A buffer for the result string. The result will be zero-terminated if
11418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  the buffer is large enough.
11428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
11438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  dest may be NULL and the function will only return the length of the result
11448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  without writing any of the result string.
11458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src       The original string
11468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
11478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param options   Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I
11488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode Must be a valid pointer to an error code value,
11498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                  which must not indicate a failure before the function call.
11508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The length of the result string. It may be greater than destCapacity. In that case,
11518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *         only some of the result was written to the destination buffer.
11528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
11538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
11548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE int32_t U_EXPORT2
11558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strFoldCase(UChar *dest, int32_t destCapacity,
11568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              const UChar *src, int32_t srcLength,
11578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              uint32_t options,
11588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              UErrorCode *pErrorCode);
11598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
11608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
11618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Converts a sequence of UChars to wchar_t units.
11628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
11638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest          A buffer for the result string. The result will be zero-terminated if
11648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      the buffer is large enough.
11658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity  The size of the buffer (number of wchar_t's). If it is 0, then
11668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      dest may be NULL and the function will only return the length of the
11678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      result without writing any of the result string (pre-flighting).
11688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pDestLength   A pointer to receive the number of units written to the destination. If
11698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      pDestLength!=NULL then *pDestLength is always set to the
11708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      number of output units corresponding to the transformation of
11718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      all the input units, even in case of a buffer overflow.
11728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src           The original source string
11738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength     The length of the original string. If -1, then src must be zero-terminated.
11748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode    Must be a valid pointer to an error code value,
11758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      which must not indicate a failure before the function call.
11768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The pointer to destination buffer.
11778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
11788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
11798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE wchar_t* U_EXPORT2
11808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strToWCS(wchar_t *dest,
11818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           int32_t destCapacity,
11828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           int32_t *pDestLength,
11838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           const UChar *src,
11848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           int32_t srcLength,
11858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project           UErrorCode *pErrorCode);
11868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
11878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Converts a sequence of wchar_t units to UChars
11888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
11898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest          A buffer for the result string. The result will be zero-terminated if
11908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      the buffer is large enough.
11918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity  The size of the buffer (number of UChars). If it is 0, then
11928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      dest may be NULL and the function will only return the length of the
11938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      result without writing any of the result string (pre-flighting).
11948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pDestLength   A pointer to receive the number of units written to the destination. If
11958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      pDestLength!=NULL then *pDestLength is always set to the
11968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      number of output units corresponding to the transformation of
11978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      all the input units, even in case of a buffer overflow.
11988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src           The original source string
11998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength     The length of the original string. If -1, then src must be zero-terminated.
12008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode    Must be a valid pointer to an error code value,
12018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      which must not indicate a failure before the function call.
12028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The pointer to destination buffer.
12038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
12048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
12058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
12068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strFromWCS(UChar   *dest,
12078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t destCapacity,
12088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t *pDestLength,
12098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const wchar_t *src,
12108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t srcLength,
12118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UErrorCode *pErrorCode);
12128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
12138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Converts a sequence of UChars (UTF-16) to UTF-8 bytes
12148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
12158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest          A buffer for the result string. The result will be zero-terminated if
12168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      the buffer is large enough.
12178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity  The size of the buffer (number of chars). If it is 0, then
12188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      dest may be NULL and the function will only return the length of the
12198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      result without writing any of the result string (pre-flighting).
12208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pDestLength   A pointer to receive the number of units written to the destination. If
12218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      pDestLength!=NULL then *pDestLength is always set to the
12228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      number of output units corresponding to the transformation of
12238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      all the input units, even in case of a buffer overflow.
12248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src           The original source string
12258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength     The length of the original string. If -1, then src must be zero-terminated.
12268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode    Must be a valid pointer to an error code value,
12278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      which must not indicate a failure before the function call.
12288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The pointer to destination buffer.
12298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
12308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
12318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE char* U_EXPORT2
12328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strToUTF8(char *dest,
12338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            int32_t destCapacity,
12348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            int32_t *pDestLength,
12358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            const UChar *src,
12368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            int32_t srcLength,
12378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project            UErrorCode *pErrorCode);
12388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
12398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
12408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Converts a sequence of UTF-8 bytes to UChars (UTF-16).
12418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
12428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest          A buffer for the result string. The result will be zero-terminated if
12438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      the buffer is large enough.
12448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity  The size of the buffer (number of UChars). If it is 0, then
12458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      dest may be NULL and the function will only return the length of the
12468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      result without writing any of the result string (pre-flighting).
12478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pDestLength   A pointer to receive the number of units written to the destination. If
12488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      pDestLength!=NULL then *pDestLength is always set to the
12498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      number of output units corresponding to the transformation of
12508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      all the input units, even in case of a buffer overflow.
12518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src           The original source string
12528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength     The length of the original string. If -1, then src must be zero-terminated.
12538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode    Must be a valid pointer to an error code value,
12548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      which must not indicate a failure before the function call.
12558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The pointer to destination buffer.
12568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
12578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
12588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
12598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strFromUTF8(UChar *dest,
12608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              int32_t destCapacity,
12618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              int32_t *pDestLength,
12628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              const char *src,
12638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              int32_t srcLength,
12648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project              UErrorCode *pErrorCode);
12658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
12668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
12678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Converts a sequence of UChars (UTF-16) to UTF32 units.
12688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
12698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest          A buffer for the result string. The result will be zero-terminated if
12708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      the buffer is large enough.
12718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity  The size of the buffer (number of UChar32s). If it is 0, then
12728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      dest may be NULL and the function will only return the length of the
12738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      result without writing any of the result string (pre-flighting).
12748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pDestLength   A pointer to receive the number of units written to the destination. If
12758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      pDestLength!=NULL then *pDestLength is always set to the
12768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      number of output units corresponding to the transformation of
12778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      all the input units, even in case of a buffer overflow.
12788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src           The original source string
12798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength     The length of the original string. If -1, then src must be zero-terminated.
12808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode    Must be a valid pointer to an error code value,
12818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      which must not indicate a failure before the function call.
12828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The pointer to destination buffer.
12838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
12848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
12858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar32* U_EXPORT2
12868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strToUTF32(UChar32 *dest,
12878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t  destCapacity,
12888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t  *pDestLength,
12898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             const UChar *src,
12908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             int32_t  srcLength,
12918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project             UErrorCode *pErrorCode);
12928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
12938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/**
12948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Converts a sequence of UTF32 units to UChars (UTF-16)
12958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
12968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param dest          A buffer for the result string. The result will be zero-terminated if
12978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      the buffer is large enough.
12988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param destCapacity  The size of the buffer (number of UChars). If it is 0, then
12998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      dest may be NULL and the function will only return the length of the
13008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      result without writing any of the result string (pre-flighting).
13018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pDestLength   A pointer to receive the number of units written to the destination. If
13028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      pDestLength!=NULL then *pDestLength is always set to the
13038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      number of output units corresponding to the transformation of
13048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      all the input units, even in case of a buffer overflow.
13058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param src           The original source string
13068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param srcLength     The length of the original string. If -1, then src must be zero-terminated.
13078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @param pErrorCode    Must be a valid pointer to an error code value,
13088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *                      which must not indicate a failure before the function call.
13098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @return The pointer to destination buffer.
13108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * @stable ICU 2.0
13118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
13128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectU_STABLE UChar* U_EXPORT2
13138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectu_strFromUTF32(UChar   *dest,
13148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project               int32_t destCapacity,
13158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project               int32_t *pDestLength,
13168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project               const UChar32 *src,
13178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project               int32_t srcLength,
13188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project               UErrorCode *pErrorCode);
13198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
13208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
1321