diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-04-20 18:13:48 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-04-20 18:13:48 +0000 |
commit | e5786f530f9555469c01435f86039b06aa53feba (patch) | |
tree | c868e8d32282422d7d445b729db95c3fcdafb6d0 /Build/source/libs/icu/icu-xetex/common/usc_impl.h | |
parent | ebaa1768b43c8606d923d2e861b5286b74207b3e (diff) |
new build system: build icu libs and xetex plus misc updates
git-svn-id: svn://tug.org/texlive/trunk@12759 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu/icu-xetex/common/usc_impl.h')
-rw-r--r-- | Build/source/libs/icu/icu-xetex/common/usc_impl.h | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-xetex/common/usc_impl.h b/Build/source/libs/icu/icu-xetex/common/usc_impl.h new file mode 100644 index 00000000000..790a709145b --- /dev/null +++ b/Build/source/libs/icu/icu-xetex/common/usc_impl.h @@ -0,0 +1,149 @@ +/* +********************************************************************** +* Copyright (C) 1999-2002, International Business Machines +* Corporation and others. All Rights Reserved. +********************************************************************** +* +* File USC_IMPL.H +* +* Modification History: +* +* Date Name Description +* 07/08/2002 Eric Mader Creation. +****************************************************************************** +*/ + +#ifndef USC_IMPL_H +#define USC_IMPL_H +#include "unicode/utypes.h" +#include "unicode/uscript.h" + +/** + * <code>UScriptRun</code> is used to find runs of characters in + * the same script. It implements a simple iterator over an array + * of characters. The iterator will resolve script-neutral characters + * like punctuation into the script of the surrounding characters. + * + * The iterator will try to match paired punctuation. If it sees an + * opening punctuation character, it will remember the script that + * was assigned to that character, and assign the same script to the + * matching closing punctuation. + * + * Scripts are chosen based on the <code>UScriptCode</code> enumeration. + * No attempt is made to combine related scripts into a single run. In + * particular, Hiragana, Katakana, and Han characters will appear in seperate + * runs. + + * Here is an example of how to iterate over script runs: + * <pre> + * \code + * void printScriptRuns(const UChar *text, int32_t length) + * { + * UErrorCode error = U_ZERO_ERROR; + * UScriptRun *scriptRun = uscript_openRun(text, testLength, &error); + * int32_t start = 0, limit = 0; + * UScriptCode code = USCRIPT_INVALID_CODE; + * + * while (uscript_nextRun(&start, &limit, &code)) { + * printf("Script '%s' from %d to %d.\n", uscript_getName(code), start, limit); + * } + * + * uscript_closeRun(scriptRun); + * } + * </pre> + * + * @draft ICU 2.2 + */ +struct UScriptRun; + +typedef struct UScriptRun UScriptRun; + +/** + * Create a <code>UScriptRun</code> object for iterating over the given text. This object must + * be freed using <code>uscript_closeRun()</code>. Note that this object does not copy the source text, + * only the pointer to it. You must make sure that the pointer remains valid until you call + * <code>uscript_closeRun()</code> or <code>uscript_setRunText()</code>. + * + * @param src is the address of the array of characters over which to iterate. + * if <code>src == NULL</code> and <code>length == 0</code>, + * an empty <code>UScriptRun</code> object will be returned. + * + * @param length is the number of characters over which to iterate. + * + * @param pErrorCode is a pointer to a valid <code>UErrorCode</code> value. If this value + * indicates a failure on entry, the function will immediately return. + * On exit the value will indicate the success of the operation. + * + * @return the address of <code>UScriptRun</code> object which will iterate over the text, + * or <code>NULL</code> if the operation failed. + * + * @draft ICU 2.2 + */ +U_CAPI UScriptRun * U_EXPORT2 +uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode); + +/** + * Frees the given <code>UScriptRun</code> object and any storage associated with it. + * On return, scriptRun no longer points to a valid <code>UScriptRun</code> object. + * + * @param scriptRun is the <code>UScriptRun</code> object which will be freed. + * + * @draft ICU 2.2 + */ +U_CAPI void U_EXPORT2 +uscript_closeRun(UScriptRun *scriptRun); + +/** + * Reset the <code>UScriptRun</code> object so that it will start iterating from + * the beginning. + * + * @param scriptRun is the address of the <code>UScriptRun</code> object to be reset. + * + * @draft ICU 2.2 + */ +U_CAPI void U_EXPORT2 +uscript_resetRun(UScriptRun *scriptRun); + +/** + * Change the text over which the given <code>UScriptRun</code> object iterates. + * + * @param scriptRun is the <code>UScriptRun</code> object which will be changed. + * + * @param src is the address of the new array of characters over which to iterate. + * If <code>src == NULL</code> and <code>length == 0</code>, + * the <code>UScriptRun</code> object will become empty. + * + * @param length is the new number of characters over which to iterate + * + * @param pErrorCode is a pointer to a valid <code>UErrorCode</code> value. If this value + * indicates a failure on entry, the function will immediately return. + * On exit the value will indicate the success of the operation. + * + * @draft ICU 2.2 + */ +U_CAPI void U_EXPORT2 +uscript_setRunText(UScriptRun *scriptRun, const UChar *src, int32_t length, UErrorCode *pErrorCode); + +/** + * Advance the <code>UScriptRun</code> object to the next script run, return the start and limit + * offsets, and the script of the run. + * + * @param scriptRun is the address of the <code>UScriptRun</code> object. + * + * @param pRunStart is a pointer to the variable to receive the starting offset of the next run. + * This pointer can be <code>NULL</code> if the value is not needed. + * + * @param pRunLimit is a pointer to the variable to receive the limit offset of the next run. + * This pointer can be <code>NULL</code> if the value is not needed. + * + * @param pRunScript is a pointer to the variable to receive the UScriptCode for the + * script of the current run. This pointer can be <code>NULL</code> if the value is not needed. + * + * @return true if there was another script run. + * + * @draft ICU 2.2 + */ +U_CAPI UBool U_EXPORT2 +uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, UScriptCode *pRunScript); + +#endif |