FAQ
Updated Branches:
   refs/heads/import-rcouch [created] 8ecdb8407


add couch_collate

couch_collate is a nif replacing couch_drv and couch_ejson_compare
binaries to do binary collation using ICU.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/commit/3e0f7443
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/tree/3e0f7443
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/diff/3e0f7443

Branch: refs/heads/import-rcouch
Commit: 3e0f744389409c415a09f0e80e6bc197157af02f
Parents:
Author: benoitc <benoitc@apache.org>
Authored: Sun Jan 5 23:21:36 2014 +0100
Committer: benoitc <benoitc@apache.org>
Committed: Mon Jan 6 18:41:57 2014 +0100

----------------------------------------------------------------------
  c_src/couch_collate.c | 281 +++++++++++++++++++++++++++++++++++++++++
  rebar.config | 9 ++
  rebar.config.script | 46 +++++++
  src/couch_collate.app.src | 13 ++
  src/couch_collate.erl | 62 +++++++++
  5 files changed, 411 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/3e0f7443/c_src/couch_collate.c
----------------------------------------------------------------------
diff --git a/c_src/couch_collate.c b/c_src/couch_collate.c
new file mode 100644
index 0000000..c5453d2
--- /dev/null
+++ b/c_src/couch_collate.c
@@ -0,0 +1,281 @@
+/*
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+*/
+
+#ifdef DARWIN
+#define U_HIDE_DRAFT_API 1
+#define U_DISABLE_RENAMING 1
+#endif
+
+#include "erl_nif.h"
+#include "unicode/ucol.h"
+#include "unicode/ucasemap.h"
+#include <stdio.h>
+#include <assert.h>
+
+static ERL_NIF_TERM ATOM_TRUE;
+static ERL_NIF_TERM ATOM_FALSE;
+static ERL_NIF_TERM ATOM_NULL;
+
+typedef struct {
+ ErlNifEnv* env;
+ int error;
+ UCollator* coll;
+} ctx_t;
+
+typedef struct {
+ UCollator** collators;
+ int collStackTop;
+ int numCollators;
+ ErlNifMutex* collMutex;
+} priv_data_t;
+
+static ERL_NIF_TERM collate_nif(ErlNifEnv*, int, const ERL_NIF_TERM []);
+static int collate_binary(priv_data_t*, ctx_t*, ERL_NIF_TERM, ERL_NIF_TERM, ERL_NIF_TERM);
+static int on_load(ErlNifEnv*, void**, ERL_NIF_TERM);
+static void on_unload(ErlNifEnv*, void*);
+static __inline void reserve_coll(priv_data_t*, ctx_t*);
+static __inline void release_coll(priv_data_t*, ctx_t*);
+int on_reload(ErlNifEnv*, void**, ERL_NIF_TERM);
+int on_upgrade(ErlNifEnv*, void**, void**, ERL_NIF_TERM);
+
+void
+reserve_coll(priv_data_t* pData, ctx_t *ctx)
+{
+ if (ctx->coll == NULL) {
+ enif_mutex_lock(pData->collMutex);
+ assert(pData->collStackTop < pData->numCollators);
+ ctx->coll = pData->collators[pData->collStackTop];
+ pData->collStackTop += 1;
+ enif_mutex_unlock(pData->collMutex);
+ }
+}
+
+
+void
+release_coll(priv_data_t* pData, ctx_t *ctx)
+{
+ if (ctx->coll != NULL) {
+ enif_mutex_lock(pData->collMutex);
+ pData->collStackTop -= 1;
+ assert(pData->collStackTop >= 0);
+ enif_mutex_unlock(pData->collMutex);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+static ERL_NIF_TERM
+collate_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {
+ ERL_NIF_TERM term_a = argv[0];
+ ERL_NIF_TERM term_b = argv[1];
+ ERL_NIF_TERM term_has_nocase = argv[2];
+
+ ctx_t ctx;
+ int result;
+ priv_data_t* pData;
+
+ ctx.env = env;
+ ctx.error = 0;
+ ctx.coll = NULL;
+
+ pData = (priv_data_t*) enif_priv_data(env);
+
+ result = collate_binary(pData, &ctx, term_a, term_b, term_has_nocase);
+ release_coll(pData, &ctx);
+
+ return enif_make_int(env, result);
+}
+
+int
+collate_binary(priv_data_t* pData, ctx_t* ctx, ERL_NIF_TERM term_a, ERL_NIF_TERM term_b, ERL_NIF_TERM term_has_nocase)
+{
+ ErlNifBinary binA, binB;
+ int has_nocase, response;
+
+ if(!enif_get_int(ctx->env, term_has_nocase, &has_nocase)) {
+ ctx->error = 1;
+ return 0;
+ }
+ if(!enif_inspect_binary(ctx->env, term_a, &binA)) {
+ ctx->error = 1;
+ return 0;
+ }
+ if(!enif_inspect_binary(ctx->env, term_b, &binB)) {
+ ctx->error = 1;
+ return 0;
+ }
+
+ switch(has_nocase) {
+ case 0: /* COLLATE */
+ case 1: /* COLLATE_NO_CASE: */
+ {
+ UErrorCode status = U_ZERO_ERROR;
+ UCharIterator iterA;
+ UCharIterator iterB;
+
+ uiter_setUTF8(&iterA, (const char *) binA.data, (uint32_t) binA.size);
+ uiter_setUTF8(&iterB, (const char *) binB.data, (uint32_t) binB.size);
+
+ /* grab a collator */
+ reserve_coll(pData, ctx);
+
+ if (has_nocase == 1) /* switching this collator to case insensitive */
+ ucol_setAttribute(ctx->coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
+
+ /* by default, it will collate case sensitive */
+ response = ucol_strcollIter(ctx->coll, &iterA, &iterB, &status);
+
+ if (has_nocase == 1) /* puting back this collator to case sensitive */
+ ucol_setAttribute(ctx->coll, UCOL_STRENGTH, UCOL_DEFAULT, &status);
+
+ break;
+ }
+
+ default:
+ response = -1;
+ }
+
+ return response;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int
+on_load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ priv_data_t* pData = (priv_data_t*)enif_alloc(sizeof(priv_data_t));
+ int i, j;
+
+ /* Initialize the structure */
+ pData->collators = NULL;
+ pData->collStackTop = 0;
+ pData->numCollators = 0;
+ pData->collMutex = NULL;
+
+ if (!enif_get_int(env, info, &(pData->numCollators) )) {
+ enif_free((char*)pData);
+ return 1;
+ }
+
+ if (pData->numCollators < 1) {
+ enif_free((char*)pData);
+ return 2;
+ }
+
+ pData->collMutex = enif_mutex_create((char *)"coll_mutex");
+
+ if (pData->collMutex == NULL) {
+ enif_free((char*)pData);
+ return 3;
+ }
+
+ pData->collators = enif_alloc(sizeof(UCollator*) * pData->numCollators);
+
+ if (pData->collators == NULL) {
+ enif_mutex_destroy(pData->collMutex);
+ enif_free((char*)pData);
+ return 4;
+ }
+
+ for (i = 0; i < pData->numCollators; i++) {
+ pData->collators[i] = ucol_open("", &status);
+
+ if (U_FAILURE(status)) {
+ for (j = 0; j < i; j++) {
+ ucol_close(pData->collators[j]);
+ }
+
+ enif_free(pData->collators);
+ enif_mutex_destroy(pData->collMutex);
+
+ enif_free((char*)pData);
+
+ return 5;
+ }
+ }
+
+ ATOM_TRUE = enif_make_atom(env, "true");
+ ATOM_FALSE = enif_make_atom(env, "false");
+ ATOM_NULL = enif_make_atom(env, "null");
+
+ *priv_data = pData;
+
+ return 0;
+}
+
+
+void
+on_unload(ErlNifEnv* env, void* priv_data)
+{
+ priv_data_t* pData = (priv_data_t*)priv_data;
+ if (pData->collators != NULL) {
+ int i;
+
+ for (i = 0; i < pData->numCollators; i++) {
+ ucol_close(pData->collators[i]);
+ }
+
+ enif_free(pData->collators);
+ }
+
+ if (pData->collMutex != NULL) {
+ enif_mutex_destroy(pData->collMutex);
+ }
+
+ enif_free((char*)pData);
+}
+
+int
+on_reload(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)
+{
+ return 0;
+}
+
+int
+on_upgrade(ErlNifEnv* env, void** priv_data, void** old_data, ERL_NIF_TERM info)
+{
+ if (*old_data != NULL) {
+ priv_data_t* pData = (priv_data_t*)old_data;
+
+ if (pData->collators != NULL) {
+ int i;
+
+ for (i = 0; i < pData->numCollators; i++) {
+ ucol_close(pData->collators[i]);
+ }
+
+ enif_free(pData->collators);
+ }
+
+ if (pData->collMutex != NULL) {
+ enif_mutex_destroy(pData->collMutex);
+ }
+
+ enif_free((char*)pData);
+ }
+
+ return on_load(env, priv_data, info);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static ErlNifFunc
+nif_funcs[] =
+{
+ {"collate_nif", 3, collate_nif}
+};
+
+ERL_NIF_INIT(couch_collate, nif_funcs, &on_load, &on_reload, &on_upgrade, &on_unload)

http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/3e0f7443/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
new file mode 100644
index 0000000..7bfd49e
--- /dev/null
+++ b/rebar.config
@@ -0,0 +1,9 @@
+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+{erl_opts, [
+ warnings_as_errors,
+ warn_export_all
+]}.
+
+{pre_hooks, [{clean, "rm -fr ebin priv erl_crash.dump"}]}.

http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/3e0f7443/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
new file mode 100644
index 0000000..ff5ef9b
--- /dev/null
+++ b/rebar.config.script
@@ -0,0 +1,46 @@
+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+%% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+%% use this file except in compliance with the License. You may obtain a copy of
+%% the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+%% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+%% License for the specific language governing permissions and limitations under
+%% the License.
+
+Arch = erlang:system_info(system_architecture),
+
+ICUConfig = fun(Args) ->
+ {0, Value} = eunit_lib:command("icu-config " ++ Args),
+ [C||C <- Value, C =/= $\n]
+end,
+
+GetFlag = fun(Name, Args) ->
+ case os:getenv(Name) of
+ false -> ICUConfig(Args);
+ Val -> Val
+ end
+ end,
+
+ICUCFLAGS = GetFlag("ICU_CFLAGS", "--cflags"),
+ICUCXXFLAGS = GetFlag("ICU_CXXFLAGS", "--cxxflags"),
+ICULDFLAGS = GetFlag("ICU_LDFLAGS", "--ldflags"),
+ICUINCPATH = GetFlag("ICU_INCPATH", "--cppflags-searchpath"),
+
+
+PortEnv = [{port_env, [
+ {"CFLAGS", ICUCFLAGS ++ " $CFLAGS " ++ ICUINCPATH},
+ {"CXXFLAGS", ICUCXXFLAGS ++ " $CXXFLAGS " ++ ICUINCPATH},
+ {"LDFLAGS", ICULDFLAGS ++ " $LDFLAGS"}]},
+
+ {port_specs, [
+ {filename:join(["priv", Arch, "couch_collate.so"]),
+ ["c_src/*.c"]}]}
+],
+
+lists:keymerge(1,lists:keysort(1, PortEnv), lists:keysort(1, CONFIG)).

http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/3e0f7443/src/couch_collate.app.src
----------------------------------------------------------------------
diff --git a/src/couch_collate.app.src b/src/couch_collate.app.src
new file mode 100644
index 0000000..4541b67
--- /dev/null
+++ b/src/couch_collate.app.src
@@ -0,0 +1,13 @@
+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+{application, couch_collate,
+ [
+ {description, "couchdb collation module"},
+ {vsn, "0.1.0"},
+ {registered, []},
+ {applications, [kernel,
+ stdlib]},
+ {included_applications, []},
+ {env, []}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/3e0f7443/src/couch_collate.erl
----------------------------------------------------------------------
diff --git a/src/couch_collate.erl b/src/couch_collate.erl
new file mode 100644
index 0000000..341510f
--- /dev/null
+++ b/src/couch_collate.erl
@@ -0,0 +1,62 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_collate).
+
+-export([init/0]).
+-export([collate/2, collate/3]).
+
+-on_load(init/0).
+
+-type collate_options() :: [nocase].
+-export_type([collate_options/0]).
+
+init() ->
+ PrivDir = case code:priv_dir(?MODULE) of
+ {error, _} ->
+ EbinDir = filename:dirname(code:which(?MODULE)),
+ AppPath = filename:dirname(EbinDir),
+ filename:join(AppPath, "priv");
+ Path ->
+ Path
+ end,
+ NumScheds = erlang:system_info(schedulers),
+ Arch = erlang:system_info(system_architecture),
+ (catch erlang:load_nif(filename:join([PrivDir, Arch, ?MODULE]),
+ NumScheds)),
+ case erlang:system_info(otp_release) of
+ "R13B03" -> true;
+ _ -> ok
+ end.
+
+%% @doc compare 2 string, result is -1 for lt, 0 for eq and 1 for gt.
+-spec collate(binary(), binary()) -> 0 | -1 | 1.
+collate(A, B) ->
+ collate(A, B, []).
+
+-spec collate(binary(), binary(), collate_options()) -> 0 | -1 | 1.
+collate(A, B, Options) when is_binary(A), is_binary(B) ->
+ HasNoCase = case lists:member(nocase, Options) of
+ true -> 1; % Case insensitive
+ false -> 0 % Case sensitive
+ end,
+ do_collate(A, B, HasNoCase).
+
+%% @private
+
+do_collate(BinaryA, BinaryB, 0) ->
+ collate_nif(BinaryA, BinaryB, 0);
+do_collate(BinaryA, BinaryB, 1) ->
+ collate_nif(BinaryA, BinaryB, 1).
+
+collate_nif(_BinaryA, _BinaryB, _HasCase) ->
+ exit(couch_collate_not_loaded).

Search Discussions

  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/utrace.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/utrace.h b/platform/osx/icu/unicode/utrace.h
    new file mode 100644
    index 0000000..3c8be9f
    --- /dev/null
    +++ b/platform/osx/icu/unicode/utrace.h
    @@ -0,0 +1,358 @@
    +/*
    +*******************************************************************************
    +*
    +* Copyright (C) 2003-2006, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +*******************************************************************************
    +* file name: utrace.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* created on: 2003aug06
    +* created by: Markus W. Scherer
    +*
    +* Definitions for ICU tracing/logging.
    +*
    +*/
    +
    +#ifndef __UTRACE_H__
    +#define __UTRACE_H__
    +
    +#include <stdarg.h>
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C API: Definitions for ICU tracing/logging.
    + *
    + * This provides API for debugging the internals of ICU without the use of
    + * a traditional debugger.
    + *
    + * By default, tracing is disabled in ICU. If you need to debug ICU with
    + * tracing, please compile ICU with the --enable-tracing configure option.
    + */
    +
    +U_CDECL_BEGIN
    +
    +/**
    + * Trace severity levels. Higher levels increase the verbosity of the trace output.
    + * @see utrace_setLevel
    + * @stable ICU 2.8
    + */
    +typedef enum UTraceLevel {
    + /** Disable all tracing @stable ICU 2.8*/
    + UTRACE_OFF=-1,
    + /** Trace error conditions only @stable ICU 2.8*/
    + UTRACE_ERROR=0,
    + /** Trace errors and warnings @stable ICU 2.8*/
    + UTRACE_WARNING=3,
    + /** Trace opens and closes of ICU services @stable ICU 2.8*/
    + UTRACE_OPEN_CLOSE=5,
    + /** Trace an intermediate number of ICU operations @stable ICU 2.8*/
    + UTRACE_INFO=7,
    + /** Trace the maximum number of ICU operations @stable ICU 2.8*/
    + UTRACE_VERBOSE=9
    +} UTraceLevel;
    +
    +/**
    + * These are the ICU functions that will be traced when tracing is enabled.
    + * @stable ICU 2.8
    + */
    +typedef enum UTraceFunctionNumber {
    + UTRACE_FUNCTION_START=0,
    + UTRACE_U_INIT=UTRACE_FUNCTION_START,
    + UTRACE_U_CLEANUP,
    + UTRACE_FUNCTION_LIMIT,
    +
    + UTRACE_CONVERSION_START=0x1000,
    + UTRACE_UCNV_OPEN=UTRACE_CONVERSION_START,
    + UTRACE_UCNV_OPEN_PACKAGE,
    + UTRACE_UCNV_OPEN_ALGORITHMIC,
    + UTRACE_UCNV_CLONE,
    + UTRACE_UCNV_CLOSE,
    + UTRACE_UCNV_FLUSH_CACHE,
    + UTRACE_UCNV_LOAD,
    + UTRACE_UCNV_UNLOAD,
    + UTRACE_CONVERSION_LIMIT,
    +
    + UTRACE_COLLATION_START=0x2000,
    + UTRACE_UCOL_OPEN=UTRACE_COLLATION_START,
    + UTRACE_UCOL_CLOSE,
    + UTRACE_UCOL_STRCOLL,
    + UTRACE_UCOL_GET_SORTKEY,
    + UTRACE_UCOL_GETLOCALE,
    + UTRACE_UCOL_NEXTSORTKEYPART,
    + UTRACE_UCOL_STRCOLLITER,
    + UTRACE_UCOL_OPEN_FROM_SHORT_STRING,
    + UTRACE_COLLATION_LIMIT
    +} UTraceFunctionNumber;
    +
    +/**
    + * Setter for the trace level.
    + * @param traceLevel A UTraceLevel value.
    + * @stable ICU 2.8
    + */
    +U_STABLE void U_EXPORT2
    +utrace_setLevel(int32_t traceLevel);
    +
    +/**
    + * Getter for the trace level.
    + * @return The UTraceLevel value being used by ICU.
    + * @stable ICU 2.8
    + */
    +U_STABLE int32_t U_EXPORT2
    +utrace_getLevel(void);
    +
    +/* Trace function pointers types ----------------------------- */
    +
    +/**
    + * Type signature for the trace function to be called when entering a function.
    + * @param context value supplied at the time the trace functions are set.
    + * @param fnNumber Enum value indicating the ICU function being entered.
    + * @stable ICU 2.8
    + */
    +typedef void U_CALLCONV
    +UTraceEntry(const void *context, int32_t fnNumber);
    +
    +/**
    + * Type signature for the trace function to be called when exiting from a function.
    + * @param context value supplied at the time the trace functions are set.
    + * @param fnNumber Enum value indicating the ICU function being exited.
    + * @param fmt A formatting string that describes the number and types
    + * of arguments included with the variable args. The fmt
    + * string has the same form as the utrace_vformat format
    + * string.
    + * @param args A variable arguments list. Contents are described by
    + * the fmt parameter.
    + * @see utrace_vformat
    + * @stable ICU 2.8
    + */
    +typedef void U_CALLCONV
    +UTraceExit(const void *context, int32_t fnNumber,
    + const char *fmt, va_list args);
    +
    +/**
    + * Type signature for the trace function to be called from within an ICU function
    + * to display data or messages.
    + * @param context value supplied at the time the trace functions are set.
    + * @param fnNumber Enum value indicating the ICU function being exited.
    + * @param level The current tracing level
    + * @param fmt A format string describing the tracing data that is supplied
    + * as variable args
    + * @param args The data being traced, passed as variable args.
    + * @stable ICU 2.8
    + */
    +typedef void U_CALLCONV
    +UTraceData(const void *context, int32_t fnNumber, int32_t level,
    + const char *fmt, va_list args);
    +
    +/**
    + * Set ICU Tracing functions. Installs application-provided tracing
    + * functions into ICU. After doing this, subsequent ICU operations
    + * will call back to the installed functions, providing a trace
    + * of the use of ICU. Passing a NULL pointer for a tracing function
    + * is allowed, and inhibits tracing action at points where that function
    + * would be called.
    + * <p>
    + * Tracing and Threads: Tracing functions are global to a process, and
    + * will be called in response to ICU operations performed by any
    + * thread. If tracing of an individual thread is desired, the
    + * tracing functions must themselves filter by checking that the
    + * current thread is the desired thread.
    + *
    + * @param context an uninterpretted pointer. Whatever is passed in
    + * here will in turn be passed to each of the tracing
    + * functions UTraceEntry, UTraceExit and UTraceData.
    + * ICU does not use or alter this pointer.
    + * @param e Callback function to be called on entry to a
    + * a traced ICU function.
    + * @param x Callback function to be called on exit from a
    + * traced ICU function.
    + * @param d Callback function to be called from within a
    + * traced ICU function, for the purpose of providing
    + * data to the trace.
    + *
    + * @stable ICU 2.8
    + */
    +U_STABLE void U_EXPORT2
    +utrace_setFunctions(const void *context,
    + UTraceEntry *e, UTraceExit *x, UTraceData *d);
    +
    +/**
    + * Get the currently installed ICU tracing functions. Note that a null function
    + * pointer will be returned if no trace function has been set.
    + *
    + * @param context The currently installed tracing context.
    + * @param e The currently installed UTraceEntry function.
    + * @param x The currently installed UTraceExit function.
    + * @param d The currently installed UTraceData function.
    + * @stable ICU 2.8
    + */
    +U_STABLE void U_EXPORT2
    +utrace_getFunctions(const void **context,
    + UTraceEntry **e, UTraceExit **x, UTraceData **d);
    +
    +
    +
    +/*
    + *
    + * ICU trace format string syntax
    + *
    + * Format Strings are passed to UTraceData functions, and define the
    + * number and types of the trace data being passed on each call.
    + *
    + * The UTraceData function, which is supplied by the application,
    + * not by ICU, can either forward the trace data (passed via
    + * varargs) and the format string back to ICU for formatting into
    + * a displayable string, or it can interpret the format itself,
    + * and do as it wishes with the trace data.
    + *
    + *
    + * Goals for the format string
    + * - basic data output
    + * - easy to use for trace programmer
    + * - sufficient provision for data types for trace output readability
    + * - well-defined types and binary portable APIs
    + *
    + * Non-goals
    + * - printf compatibility
    + * - fancy formatting
    + * - argument reordering and other internationalization features
    + *
    + * ICU trace format strings contain plain text with argument inserts,
    + * much like standard printf format strings.
    + * Each insert begins with a '%', then optionally contains a 'v',
    + * then exactly one type character.
    + * Two '%' in a row represent a '%' instead of an insert.
    + * The trace format strings need not have \n at the end.
    + *
    + *
    + * Types
    + * -----
    + *
    + * Type characters:
    + * - c A char character in the default codepage.
    + * - s A NUL-terminated char * string in the default codepage.
    + * - S A UChar * string. Requires two params, (ptr, length). Length=-1 for nul term.
    + * - b A byte (8-bit integer).
    + * - h A 16-bit integer. Also a 16 bit Unicode code unit.
    + * - d A 32-bit integer. Also a 20 bit Unicode code point value.
    + * - l A 64-bit integer.
    + * - p A data pointer.
    + *
    + * Vectors
    + * -------
    + *
    + * If the 'v' is not specified, then one item of the specified type
    + * is passed in.
    + * If the 'v' (for "vector") is specified, then a vector of items of the
    + * specified type is passed in, via a pointer to the first item
    + * and an int32_t value for the length of the vector.
    + * Length==-1 means zero or NUL termination. Works for vectors of all types.
    + *
    + * Note: %vS is a vector of (UChar *) strings. The strings must
    + * be nul terminated as there is no way to provide a
    + * separate length parameter for each string. The length
    + * parameter (required for all vectors) is the number of
    + * strings, not the length of the strings.
    + *
    + * Examples
    + * --------
    + *
    + * These examples show the parameters that will be passed to an application's
    + * UTraceData() function for various formats.
    + *
    + * - the precise formatting is up to the application!
    + * - the examples use type casts for arguments only to _show_ the types of
    + * arguments without needing variable declarations in the examples;
    + * the type casts will not be necessary in actual code
    + *
    + * UTraceDataFunc(context, fnNumber, level,
    + * "There is a character %c in the string %s.", // Format String
    + * (char)c, (const char *)s); // varargs parameters
    + * -> There is a character 0x42 'B' in the string "Bravo".
    + *
    + * UTraceDataFunc(context, fnNumber, level,
    + * "Vector of bytes %vb vector of chars %vc",
    + * (const uint8_t *)bytes, (int32_t)bytesLength,
    + * (const char *)chars, (int32_t)charsLength);
    + * -> Vector of bytes
    + * 42 63 64 3f [4]
    + * vector of chars
    + * "Bcd?"[4]
    + *
    + * UTraceDataFunc(context, fnNumber, level,
    + * "An int32_t %d and a whole bunch of them %vd",
    + * (int32_t)-5, (const int32_t *)ints, (int32_t)intsLength);
    + * -> An int32_t 0xfffffffb and a whole bunch of them
    + * fffffffb 00000005 0000010a [3]
    + *
    + */
    +
    +
    +
    +/**
    + * Trace output Formatter. An application's UTraceData tracing functions may call
    + * back to this function to format the trace output in a
    + * human readable form. Note that a UTraceData function may choose
    + * to not format the data; it could, for example, save it in
    + * in the raw form it was received (more compact), leaving
    + * formatting for a later trace analyis tool.
    + * @param outBuf pointer to a buffer to receive the formatted output. Output
    + * will be nul terminated if there is space in the buffer -
    + * if the length of the requested output < the output buffer size.
    + * @param capacity Length of the output buffer.
    + * @param indent Number of spaces to indent the output. Intended to allow
    + * data displayed from nested functions to be indented for readability.
    + * @param fmt Format specification for the data to output
    + * @param args Data to be formatted.
    + * @return Length of formatted output, including the terminating NUL.
    + * If buffer capacity is insufficient, the required capacity is returned.
    + * @stable ICU 2.8
    + */
    +U_STABLE int32_t U_EXPORT2
    +utrace_vformat(char *outBuf, int32_t capacity,
    + int32_t indent, const char *fmt, va_list args);
    +
    +/**
    + * Trace output Formatter. An application's UTraceData tracing functions may call
    + * this function to format any additional trace data, beyond that
    + * provided by default, in human readable form with the same
    + * formatting conventions used by utrace_vformat().
    + * @param outBuf pointer to a buffer to receive the formatted output. Output
    + * will be nul terminated if there is space in the buffer -
    + * if the length of the requested output < the output buffer size.
    + * @param capacity Length of the output buffer.
    + * @param indent Number of spaces to indent the output. Intended to allow
    + * data displayed from nested functions to be indented for readability.
    + * @param fmt Format specification for the data to output
    + * @param ... Data to be formatted.
    + * @return Length of formatted output, including the terminating NUL.
    + * If buffer capacity is insufficient, the required capacity is returned.
    + * @stable ICU 2.8
    + */
    +U_STABLE int32_t U_EXPORT2
    +utrace_format(char *outBuf, int32_t capacity,
    + int32_t indent, const char *fmt, ...);
    +
    +
    +
    +/* Trace function numbers --------------------------------------------------- */
    +
    +/**
    + * Get the name of a function from its trace function number.
    + *
    + * @param fnNumber The trace number for an ICU function.
    + * @return The name string for the function.
    + *
    + * @see UTraceFunctionNumber
    + * @stable ICU 2.8
    + */
    +U_STABLE const char * U_EXPORT2
    +utrace_functionName(int32_t fnNumber);
    +
    +U_CDECL_END
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/utrans.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/utrans.h b/platform/osx/icu/unicode/utrans.h
    new file mode 100644
    index 0000000..a460a34
    --- /dev/null
    +++ b/platform/osx/icu/unicode/utrans.h
    @@ -0,0 +1,583 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 1997-2005, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +* Date Name Description
    +* 06/21/00 aliu Creation.
    +*******************************************************************************
    +*/
    +
    +#ifndef UTRANS_H
    +#define UTRANS_H
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_TRANSLITERATION
    +
    +#include "unicode/urep.h"
    +#include "unicode/parseerr.h"
    +#include "unicode/uenum.h"
    +
    +/********************************************************************
    + * General Notes
    + ********************************************************************
    + */
    +/**
    + * \file
    + * \brief C API: Transliterator
    + *
    + * <h2> Transliteration </h2>
    + * The data structures and functions described in this header provide
    + * transliteration services. Transliteration services are implemented
    + * as C++ classes. The comments and documentation in this header
    + * assume the reader is familiar with the C++ headers translit.h and
    + * associated documentation.
    + *
    + * A significant but incomplete subset of the C++ transliteration
    + * services are available to C code through this header. In order to
    + * access more complex transliteration services, refer to the C++
    + * headers and documentation.
    + *
    + * There are two sets of functions for working with transliterator IDs:
    + *
    + * An old, deprecated set uses char * IDs, which works for true and pure
    + * identifiers that these APIs were designed for,
    + * for example "Cyrillic-Latin".
    + * It does not work when the ID contains filters ("[:Script=Cyrl:]")
    + * or even a complete set of rules because then the ID string contains more
    + * than just "invariant" characters (see utypes.h).
    + *
    + * A new set of functions replaces the old ones and uses UChar * IDs,
    + * paralleling the UnicodeString IDs in the C++ API. (New in ICU 2.8.)
    + */
    +
    +/********************************************************************
    + * Data Structures
    + ********************************************************************/
    +
    +/**
    + * An opaque transliterator for use in C. Open with utrans_openxxx()
    + * and close with utrans_close() when done. Equivalent to the C++ class
    + * Transliterator and its subclasses.
    + * @see Transliterator
    + * @stable ICU 2.0
    + */
    +typedef void* UTransliterator;
    +
    +/**
    + * Direction constant indicating the direction in a transliterator,
    + * e.g., the forward or reverse rules of a RuleBasedTransliterator.
    + * Specified when a transliterator is opened. An "A-B" transliterator
    + * transliterates A to B when operating in the forward direction, and
    + * B to A when operating in the reverse direction.
    + * @stable ICU 2.0
    + */
    +typedef enum UTransDirection {
    +
    + /**
    + * UTRANS_FORWARD means from &lt;source&gt; to &lt;target&gt; for a
    + * transliterator with ID &lt;source&gt;-&lt;target&gt;. For a transliterator
    + * opened using a rule, it means forward direction rules, e.g.,
    + * "A > B".
    + */
    + UTRANS_FORWARD,
    +
    + /**
    + * UTRANS_REVERSE means from &lt;target&gt; to &lt;source&gt; for a
    + * transliterator with ID &lt;source&gt;-&lt;target&gt;. For a transliterator
    + * opened using a rule, it means reverse direction rules, e.g.,
    + * "A < B".
    + */
    + UTRANS_REVERSE
    +
    +} UTransDirection;
    +
    +/**
    + * Position structure for utrans_transIncremental() incremental
    + * transliteration. This structure defines two substrings of the text
    + * being transliterated. The first region, [contextStart,
    + * contextLimit), defines what characters the transliterator will read
    + * as context. The second region, [start, limit), defines what
    + * characters will actually be transliterated. The second region
    + * should be a subset of the first.
    + *
    + * <p>After a transliteration operation, some of the indices in this
    + * structure will be modified. See the field descriptions for
    + * details.
    + *
    + * <p>contextStart <= start <= limit <= contextLimit
    + *
    + * <p>Note: All index values in this structure must be at code point
    + * boundaries. That is, none of them may occur between two code units
    + * of a surrogate pair. If any index does split a surrogate pair,
    + * results are unspecified.
    + *
    + * @stable ICU 2.0
    + */
    +typedef struct UTransPosition {
    +
    + /**
    + * Beginning index, inclusive, of the context to be considered for
    + * a transliteration operation. The transliterator will ignore
    + * anything before this index. INPUT/OUTPUT parameter: This parameter
    + * is updated by a transliteration operation to reflect the maximum
    + * amount of antecontext needed by a transliterator.
    + * @stable ICU 2.4
    + */
    + int32_t contextStart;
    +
    + /**
    + * Ending index, exclusive, of the context to be considered for a
    + * transliteration operation. The transliterator will ignore
    + * anything at or after this index. INPUT/OUTPUT parameter: This
    + * parameter is updated to reflect changes in the length of the
    + * text, but points to the same logical position in the text.
    + * @stable ICU 2.4
    + */
    + int32_t contextLimit;
    +
    + /**
    + * Beginning index, inclusive, of the text to be transliteratd.
    + * INPUT/OUTPUT parameter: This parameter is advanced past
    + * characters that have already been transliterated by a
    + * transliteration operation.
    + * @stable ICU 2.4
    + */
    + int32_t start;
    +
    + /**
    + * Ending index, exclusive, of the text to be transliteratd.
    + * INPUT/OUTPUT parameter: This parameter is updated to reflect
    + * changes in the length of the text, but points to the same
    + * logical position in the text.
    + * @stable ICU 2.4
    + */
    + int32_t limit;
    +
    +} UTransPosition;
    +
    +/********************************************************************
    + * General API
    + ********************************************************************/
    +
    +/**
    + * Open a custom transliterator, given a custom rules string
    + * OR
    + * a system transliterator, given its ID.
    + * Any non-NULL result from this function should later be closed with
    + * utrans_close().
    + *
    + * @param id a valid transliterator ID
    + * @param idLength the length of the ID string, or -1 if NUL-terminated
    + * @param dir the desired direction
    + * @param rules the transliterator rules. See the C++ header rbt.h for
    + * rules syntax. If NULL then a system transliterator matching
    + * the ID is returned.
    + * @param rulesLength the length of the rules, or -1 if the rules
    + * are NUL-terminated.
    + * @param parseError a pointer to a UParseError struct to receive the details
    + * of any parsing errors. This parameter may be NULL if no
    + * parsing error details are desired.
    + * @param pErrorCode a pointer to the UErrorCode
    + * @return a transliterator pointer that may be passed to other
    + * utrans_xxx() functions, or NULL if the open call fails.
    + * @stable ICU 2.8
    + */
    +U_STABLE UTransliterator* U_EXPORT2
    +utrans_openU(const UChar *id,
    + int32_t idLength,
    + UTransDirection dir,
    + const UChar *rules,
    + int32_t rulesLength,
    + UParseError *parseError,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Open an inverse of an existing transliterator. For this to work,
    + * the inverse must be registered with the system. For example, if
    + * the Transliterator "A-B" is opened, and then its inverse is opened,
    + * the result is the Transliterator "B-A", if such a transliterator is
    + * registered with the system. Otherwise the result is NULL and a
    + * failing UErrorCode is set. Any non-NULL result from this function
    + * should later be closed with utrans_close().
    + *
    + * @param trans the transliterator to open the inverse of.
    + * @param status a pointer to the UErrorCode
    + * @return a pointer to a newly-opened transliterator that is the
    + * inverse of trans, or NULL if the open call fails.
    + * @stable ICU 2.0
    + */
    +U_STABLE UTransliterator* U_EXPORT2
    +utrans_openInverse(const UTransliterator* trans,
    + UErrorCode* status);
    +
    +/**
    + * Create a copy of a transliterator. Any non-NULL result from this
    + * function should later be closed with utrans_close().
    + *
    + * @param trans the transliterator to be copied.
    + * @param status a pointer to the UErrorCode
    + * @return a transliterator pointer that may be passed to other
    + * utrans_xxx() functions, or NULL if the clone call fails.
    + * @stable ICU 2.0
    + */
    +U_STABLE UTransliterator* U_EXPORT2
    +utrans_clone(const UTransliterator* trans,
    + UErrorCode* status);
    +
    +/**
    + * Close a transliterator. Any non-NULL pointer returned by
    + * utrans_openXxx() or utrans_clone() should eventually be closed.
    + * @param trans the transliterator to be closed.
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_close(UTransliterator* trans);
    +
    +/**
    + * Return the programmatic identifier for this transliterator.
    + * If this identifier is passed to utrans_openU(), it will open
    + * a transliterator equivalent to this one, if the ID has been
    + * registered.
    + *
    + * @param trans the transliterator to return the ID of.
    + * @param resultLength pointer to an output variable receiving the length
    + * of the ID string; can be NULL
    + * @return the NUL-terminated ID string. This pointer remains
    + * valid until utrans_close() is called on this transliterator.
    + *
    + * @stable ICU 2.8
    + */
    +U_STABLE const UChar * U_EXPORT2
    +utrans_getUnicodeID(const UTransliterator *trans,
    + int32_t *resultLength);
    +
    +/**
    + * Register an open transliterator with the system. When
    + * utrans_open() is called with an ID string that is equal to that
    + * returned by utrans_getID(adoptedTrans,...), then
    + * utrans_clone(adoptedTrans,...) is returned.
    + *
    + * <p>NOTE: After this call the system owns the adoptedTrans and will
    + * close it. The user must not call utrans_close() on adoptedTrans.
    + *
    + * @param adoptedTrans a transliterator, typically the result of
    + * utrans_openRules(), to be registered with the system.
    + * @param status a pointer to the UErrorCode
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_register(UTransliterator* adoptedTrans,
    + UErrorCode* status);
    +
    +/**
    + * Unregister a transliterator from the system. After this call the
    + * system will no longer recognize the given ID when passed to
    + * utrans_open(). If the ID is invalid then nothing is done.
    + *
    + * @param id an ID to unregister
    + * @param idLength the length of id, or -1 if id is zero-terminated
    + * @stable ICU 2.8
    + */
    +U_STABLE void U_EXPORT2
    +utrans_unregisterID(const UChar* id, int32_t idLength);
    +
    +/**
    + * Set the filter used by a transliterator. A filter can be used to
    + * make the transliterator pass certain characters through untouched.
    + * The filter is expressed using a UnicodeSet pattern. If the
    + * filterPattern is NULL or the empty string, then the transliterator
    + * will be reset to use no filter.
    + *
    + * @param trans the transliterator
    + * @param filterPattern a pattern string, in the form accepted by
    + * UnicodeSet, specifying which characters to apply the
    + * transliteration to. May be NULL or the empty string to indicate no
    + * filter.
    + * @param filterPatternLen the length of filterPattern, or -1 if
    + * filterPattern is zero-terminated
    + * @param status a pointer to the UErrorCode
    + * @see UnicodeSet
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_setFilter(UTransliterator* trans,
    + const UChar* filterPattern,
    + int32_t filterPatternLen,
    + UErrorCode* status);
    +
    +/**
    + * Return the number of system transliterators.
    + * It is recommended to use utrans_openIDs() instead.
    + *
    + * @return the number of system transliterators.
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +utrans_countAvailableIDs(void);
    +
    +/**
    + * Return a UEnumeration for the available transliterators.
    + *
    + * @param pErrorCode Pointer to the UErrorCode in/out parameter.
    + * @return UEnumeration for the available transliterators.
    + * Close with uenum_close().
    + *
    + * @stable ICU 2.8
    + */
    +U_STABLE UEnumeration * U_EXPORT2
    +utrans_openIDs(UErrorCode *pErrorCode);
    +
    +/********************************************************************
    + * Transliteration API
    + ********************************************************************/
    +
    +/**
    + * Transliterate a segment of a UReplaceable string. The string is
    + * passed in as a UReplaceable pointer rep and a UReplaceableCallbacks
    + * function pointer struct repFunc. Functions in the repFunc struct
    + * will be called in order to modify the rep string.
    + *
    + * @param trans the transliterator
    + * @param rep a pointer to the string. This will be passed to the
    + * repFunc functions.
    + * @param repFunc a set of function pointers that will be used to
    + * modify the string pointed to by rep.
    + * @param start the beginning index, inclusive; <code>0 <= start <=
    + * limit</code>.
    + * @param limit pointer to the ending index, exclusive; <code>start <=
    + * limit <= repFunc->length(rep)</code>. Upon return, *limit will
    + * contain the new limit index. The text previously occupying
    + * <code>[start, limit)</code> has been transliterated, possibly to a
    + * string of a different length, at <code>[start,
    + * </code><em>new-limit</em><code>)</code>, where <em>new-limit</em>
    + * is the return value.
    + * @param status a pointer to the UErrorCode
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_trans(const UTransliterator* trans,
    + UReplaceable* rep,
    + UReplaceableCallbacks* repFunc,
    + int32_t start,
    + int32_t* limit,
    + UErrorCode* status);
    +
    +/**
    + * Transliterate the portion of the UReplaceable text buffer that can
    + * be transliterated unambiguosly. This method is typically called
    + * after new text has been inserted, e.g. as a result of a keyboard
    + * event. The transliterator will try to transliterate characters of
    + * <code>rep</code> between <code>index.cursor</code> and
    + * <code>index.limit</code>. Characters before
    + * <code>index.cursor</code> will not be changed.
    + *
    + * <p>Upon return, values in <code>index</code> will be updated.
    + * <code>index.start</code> will be advanced to the first
    + * character that future calls to this method will read.
    + * <code>index.cursor</code> and <code>index.limit</code> will
    + * be adjusted to delimit the range of text that future calls to
    + * this method may change.
    + *
    + * <p>Typical usage of this method begins with an initial call
    + * with <code>index.start</code> and <code>index.limit</code>
    + * set to indicate the portion of <code>text</code> to be
    + * transliterated, and <code>index.cursor == index.start</code>.
    + * Thereafter, <code>index</code> can be used without
    + * modification in future calls, provided that all changes to
    + * <code>text</code> are made via this method.
    + *
    + * <p>This method assumes that future calls may be made that will
    + * insert new text into the buffer. As a result, it only performs
    + * unambiguous transliterations. After the last call to this method,
    + * there may be untransliterated text that is waiting for more input
    + * to resolve an ambiguity. In order to perform these pending
    + * transliterations, clients should call utrans_trans() with a start
    + * of index.start and a limit of index.end after the last call to this
    + * method has been made.
    + *
    + * @param trans the transliterator
    + * @param rep a pointer to the string. This will be passed to the
    + * repFunc functions.
    + * @param repFunc a set of function pointers that will be used to
    + * modify the string pointed to by rep.
    + * @param pos a struct containing the start and limit indices of the
    + * text to be read and the text to be transliterated
    + * @param status a pointer to the UErrorCode
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_transIncremental(const UTransliterator* trans,
    + UReplaceable* rep,
    + UReplaceableCallbacks* repFunc,
    + UTransPosition* pos,
    + UErrorCode* status);
    +
    +/**
    + * Transliterate a segment of a UChar* string. The string is passed
    + * in in a UChar* buffer. The string is modified in place. If the
    + * result is longer than textCapacity, it is truncated. The actual
    + * length of the result is returned in *textLength, if textLength is
    + * non-NULL. *textLength may be greater than textCapacity, but only
    + * textCapacity UChars will be written to *text, including the zero
    + * terminator.
    + *
    + * @param trans the transliterator
    + * @param text a pointer to a buffer containing the text to be
    + * transliterated on input and the result text on output.
    + * @param textLength a pointer to the length of the string in text.
    + * If the length is -1 then the string is assumed to be
    + * zero-terminated. Upon return, the new length is stored in
    + * *textLength. If textLength is NULL then the string is assumed to
    + * be zero-terminated.
    + * @param textCapacity a pointer to the length of the text buffer.
    + * Upon return,
    + * @param start the beginning index, inclusive; <code>0 <= start <=
    + * limit</code>.
    + * @param limit pointer to the ending index, exclusive; <code>start <=
    + * limit <= repFunc->length(rep)</code>. Upon return, *limit will
    + * contain the new limit index. The text previously occupying
    + * <code>[start, limit)</code> has been transliterated, possibly to a
    + * string of a different length, at <code>[start,
    + * </code><em>new-limit</em><code>)</code>, where <em>new-limit</em>
    + * is the return value.
    + * @param status a pointer to the UErrorCode
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_transUChars(const UTransliterator* trans,
    + UChar* text,
    + int32_t* textLength,
    + int32_t textCapacity,
    + int32_t start,
    + int32_t* limit,
    + UErrorCode* status);
    +
    +/**
    + * Transliterate the portion of the UChar* text buffer that can be
    + * transliterated unambiguosly. See utrans_transIncremental(). The
    + * string is passed in in a UChar* buffer. The string is modified in
    + * place. If the result is longer than textCapacity, it is truncated.
    + * The actual length of the result is returned in *textLength, if
    + * textLength is non-NULL. *textLength may be greater than
    + * textCapacity, but only textCapacity UChars will be written to
    + * *text, including the zero terminator. See utrans_transIncremental()
    + * for usage details.
    + *
    + * @param trans the transliterator
    + * @param text a pointer to a buffer containing the text to be
    + * transliterated on input and the result text on output.
    + * @param textLength a pointer to the length of the string in text.
    + * If the length is -1 then the string is assumed to be
    + * zero-terminated. Upon return, the new length is stored in
    + * *textLength. If textLength is NULL then the string is assumed to
    + * be zero-terminated.
    + * @param textCapacity the length of the text buffer
    + * @param pos a struct containing the start and limit indices of the
    + * text to be read and the text to be transliterated
    + * @param status a pointer to the UErrorCode
    + * @see utrans_transIncremental
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +utrans_transIncrementalUChars(const UTransliterator* trans,
    + UChar* text,
    + int32_t* textLength,
    + int32_t textCapacity,
    + UTransPosition* pos,
    + UErrorCode* status);
    +
    +/* deprecated API ----------------------------------------------------------- */
    +
    +/* see utrans.h documentation for why these functions are deprecated */
    +
    +/**
    + * Deprecated, use utrans_openU() instead.
    + * Open a custom transliterator, given a custom rules string
    + * OR
    + * a system transliterator, given its ID.
    + * Any non-NULL result from this function should later be closed with
    + * utrans_close().
    + *
    + * @param id a valid ID, as returned by utrans_getAvailableID()
    + * @param dir the desired direction
    + * @param rules the transliterator rules. See the C++ header rbt.h
    + * for rules syntax. If NULL then a system transliterator matching
    + * the ID is returned.
    + * @param rulesLength the length of the rules, or -1 if the rules
    + * are zero-terminated.
    + * @param parseError a pointer to a UParseError struct to receive the
    + * details of any parsing errors. This parameter may be NULL if no
    + * parsing error details are desired.
    + * @param status a pointer to the UErrorCode
    + * @return a transliterator pointer that may be passed to other
    + * utrans_xxx() functions, or NULL if the open call fails.
    + * @deprecated ICU 2.8 Use utrans_openU() instead, see utrans.h
    + */
    +U_DEPRECATED UTransliterator* U_EXPORT2
    +utrans_open(const char* id,
    + UTransDirection dir,
    + const UChar* rules, /* may be Null */
    + int32_t rulesLength, /* -1 if null-terminated */
    + UParseError* parseError, /* may be Null */
    + UErrorCode* status);
    +
    +/**
    + * Deprecated, use utrans_getUnicodeID() instead.
    + * Return the programmatic identifier for this transliterator.
    + * If this identifier is passed to utrans_open(), it will open
    + * a transliterator equivalent to this one, if the ID has been
    + * registered.
    + * @param trans the transliterator to return the ID of.
    + * @param buf the buffer in which to receive the ID. This may be
    + * NULL, in which case no characters are copied.
    + * @param bufCapacity the capacity of the buffer. Ignored if buf is
    + * NULL.
    + * @return the actual length of the ID, not including
    + * zero-termination. This may be greater than bufCapacity.
    + * @deprecated ICU 2.8 Use utrans_getUnicodeID() instead, see utrans.h
    + */
    +U_DEPRECATED int32_t U_EXPORT2
    +utrans_getID(const UTransliterator* trans,
    + char* buf,
    + int32_t bufCapacity);
    +
    +/**
    + * Deprecated, use utrans_unregisterID() instead.
    + * Unregister a transliterator from the system. After this call the
    + * system will no longer recognize the given ID when passed to
    + * utrans_open(). If the id is invalid then nothing is done.
    + *
    + * @param id a zero-terminated ID
    + * @deprecated ICU 2.8 Use utrans_unregisterID() instead, see utrans.h
    + */
    +U_DEPRECATED void U_EXPORT2
    +utrans_unregister(const char* id);
    +
    +/**
    + * Deprecated, use utrans_openIDs() instead.
    + * Return the ID of the index-th system transliterator. The result
    + * is placed in the given buffer. If the given buffer is too small,
    + * the initial substring is copied to buf. The result in buf is
    + * always zero-terminated.
    + *
    + * @param index the number of the transliterator to return. Must
    + * satisfy 0 <= index < utrans_countAvailableIDs(). If index is out
    + * of range then it is treated as if it were 0.
    + * @param buf the buffer in which to receive the ID. This may be
    + * NULL, in which case no characters are copied.
    + * @param bufCapacity the capacity of the buffer. Ignored if buf is
    + * NULL.
    + * @return the actual length of the index-th ID, not including
    + * zero-termination. This may be greater than bufCapacity.
    + * @deprecated ICU 2.8 Use utrans_openIDs() instead, see utrans.h
    + */
    +U_DEPRECATED int32_t U_EXPORT2
    +utrans_getAvailableID(int32_t index,
    + char* buf,
    + int32_t bufCapacity);
    +
    +#endif /* #if !UCONFIG_NO_TRANSLITERATION */
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/utypes.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/utypes.h b/platform/osx/icu/unicode/utypes.h
    new file mode 100644
    index 0000000..12977ed
    --- /dev/null
    +++ b/platform/osx/icu/unicode/utypes.h
    @@ -0,0 +1,801 @@
    +/*
    +**********************************************************************
    +* Copyright (C) 1996-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +**********************************************************************
    +*
    +* FILE NAME : UTYPES.H (formerly ptypes.h)
    +*
    +* Date Name Description
    +* 12/11/96 helena Creation.
    +* 02/27/97 aliu Added typedefs for UClassID, int8, int16, int32,
    +* uint8, uint16, and uint32.
    +* 04/01/97 aliu Added XP_CPLUSPLUS and modified to work under C as
    +* well as C++.
    +* Modified to use memcpy() for uprv_arrayCopy() fns.
    +* 04/14/97 aliu Added TPlatformUtilities.
    +* 05/07/97 aliu Added import/export specifiers (replacing the old
    +* broken EXT_CLASS). Added version number for our
    +* code. Cleaned up header.
    +* 6/20/97 helena Java class name change.
    +* 08/11/98 stephen UErrorCode changed from typedef to enum
    +* 08/12/98 erm Changed T_ANALYTIC_PACKAGE_VERSION to 3
    +* 08/14/98 stephen Added uprv_arrayCopy() for int8_t, int16_t, int32_t
    +* 12/09/98 jfitz Added BUFFER_OVERFLOW_ERROR (bug 1100066)
    +* 04/20/99 stephen Cleaned up & reworked for autoconf.
    +* Renamed to utypes.h.
    +* 05/05/99 stephen Changed to use <inttypes.h>
    +* 12/07/99 helena Moved copyright notice string from ucnv_bld.h here.
    +*******************************************************************************
    +*/
    +
    +#ifndef UTYPES_H
    +#define UTYPES_H
    +
    +
    +#include "unicode/umachine.h"
    +#include "unicode/utf.h"
    +#include "unicode/uversion.h"
    +#include "unicode/uconfig.h"
    +
    +#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_DRAFT_API)
    +#define U_HIDE_DRAFT_API 1
    +#endif
    +
    +#ifdef U_HIDE_DRAFT_API
    +#include "unicode/udraft.h"
    +#endif
    +
    +#ifdef U_HIDE_DEPRECATED_API
    +#include "unicode/udeprctd.h"
    +#endif
    +
    +#ifdef U_HIDE_DEPRECATED_API
    +#include "unicode/uobslete.h"
    +#endif
    +
    +#ifdef U_HIDE_INTERNAL_API
    +#include "unicode/uintrnal.h"
    +#endif
    +
    +#ifdef U_HIDE_SYSTEM_API
    +#include "unicode/usystem.h"
    +#endif
    +
    +/*!
    + * \file
    + * \brief Basic definitions for ICU, for both C and C++ APIs
    + *
    + * This file defines basic types, constants, and enumerations directly or
    + * indirectly by including other header files, especially utf.h for the
    + * basic character and string definitions and umachine.h for consistent
    + * integer and other types.
    + */
    +
    +/*===========================================================================*/
    +/* char Character set family */
    +/*===========================================================================*/
    +
    +/**
    + * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform.
    + * @stable ICU 2.0
    + */
    +#define U_ASCII_FAMILY 0
    +
    +/**
    + * U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform.
    + * @stable ICU 2.0
    + */
    +#define U_EBCDIC_FAMILY 1
    +
    +/**
    + * \def U_CHARSET_FAMILY
    + *
    + * <p>These definitions allow to specify the encoding of text
    + * in the char data type as defined by the platform and the compiler.
    + * It is enough to determine the code point values of "invariant characters",
    + * which are the ones shared by all encodings that are in use
    + * on a given platform.</p>
    + *
    + * <p>Those "invariant characters" should be all the uppercase and lowercase
    + * latin letters, the digits, the space, and "basic punctuation".
    + * Also, '\\n', '\\r', '\\t' should be available.</p>
    + *
    + * <p>The list of "invariant characters" is:<br>
    + * \code
    + * A-Z a-z 0-9 SPACE " % &amp; ' ( ) * + , - . / : ; < = > ? _
    + * \endcode
    + * <br>
    + * (52 letters + 10 numbers + 20 punc/sym/space = 82 total)</p>
    + *
    + * <p>This matches the IBM Syntactic Character Set (CS 640).</p>
    + *
    + * <p>In other words, all the graphic characters in 7-bit ASCII should
    + * be safely accessible except the following:</p>
    + *
    + * \code
    + * '\' <backslash>
    + * '[' <left bracket>
    + * ']' <right bracket>
    + * '{' <left brace>
    + * '}' <right brace>
    + * '^' <circumflex>
    + * '~' <tilde>
    + * '!' <exclamation mark>
    + * '#' <number sign>
    + * '|' <vertical line>
    + * '$' <dollar sign>
    + * '@' <commercial at>
    + * '`' <grave accent>
    + * \endcode
    + * @stable ICU 2.0
    + */
    +
    +#ifndef U_CHARSET_FAMILY
    +# define U_CHARSET_FAMILY 0
    +#endif
    +
    +/*===========================================================================*/
    +/* ICUDATA naming scheme */
    +/*===========================================================================*/
    +
    +/**
    + * \def U_ICUDATA_TYPE_LETTER
    + *
    + * This is a platform-dependent string containing one letter:
    + * - b for big-endian, ASCII-family platforms
    + * - l for little-endian, ASCII-family platforms
    + * - e for big-endian, EBCDIC-family platforms
    + * This letter is part of the common data file name.
    + * @stable ICU 2.0
    + */
    +
    +/**
    + * \def U_ICUDATA_TYPE_LITLETTER
    + * The non-string form of U_ICUDATA_TYPE_LETTER
    + * @stable ICU 2.0
    + */
    +#if U_CHARSET_FAMILY
    +# if U_IS_BIG_ENDIAN
    + /* EBCDIC - should always be BE */
    +# define U_ICUDATA_TYPE_LETTER "e"
    +# define U_ICUDATA_TYPE_LITLETTER e
    +# else
    +# error "Don't know what to do with little endian EBCDIC!"
    +# define U_ICUDATA_TYPE_LETTER "x"
    +# define U_ICUDATA_TYPE_LITLETTER x
    +# endif
    +#else
    +# if U_IS_BIG_ENDIAN
    + /* Big-endian ASCII */
    +# define U_ICUDATA_TYPE_LETTER "b"
    +# define U_ICUDATA_TYPE_LITLETTER b
    +# else
    + /* Little-endian ASCII */
    +# define U_ICUDATA_TYPE_LETTER "l"
    +# define U_ICUDATA_TYPE_LITLETTER l
    +# endif
    +#endif
    +
    +/**
    + * A single string literal containing the icudata stub name. i.e. 'icudt18e' for
    + * ICU 1.8.x on EBCDIC, etc..
    + * @stable ICU 2.0
    + */
    +#define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
    +
    +
    +/**
    + * U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data library.
    + * Defined as a literal, not a string.
    + * Tricky Preprocessor use - ## operator replaces macro paramters with the literal string
    + * from the corresponding macro invocation, _before_ other macro substitutions.
    + * Need a nested \#defines to get the actual version numbers rather than
    + * the literal text U_ICU_VERSION_MAJOR_NUM into the name.
    + * The net result will be something of the form
    + * \#define U_ICU_ENTRY_POINT icudt19_dat
    + * @stable ICU 2.4
    + */
    +#define U_ICUDATA_ENTRY_POINT U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM)
    +
    +/**
    + * Do not use.
    + * @internal
    + */
    +#define U_DEF2_ICUDATA_ENTRY_POINT(major, minor) U_DEF_ICUDATA_ENTRY_POINT(major, minor)
    +/**
    + * Do not use.
    + * @internal
    + */
    +#define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt##major##minor##_dat
    +
    +/**
    + * \def U_CALLCONV
    + * Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary
    + * in callback function typedefs to make sure that the calling convention
    + * is compatible.
    + *
    + * This is only used for non-ICU-API functions.
    + * When a function is a public ICU API,
    + * you must use the U_CAPI and U_EXPORT2 qualifiers.
    + * @stable ICU 2.0
    + */
    +#if defined(OS390) && (__COMPILER_VER__ < 0x41020000) && defined(XP_CPLUSPLUS)
    +# define U_CALLCONV __cdecl
    +#else
    +# define U_CALLCONV U_EXPORT2
    +#endif
    +
    +/**
    + * \def NULL
    + * Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
    + * @stable ICU 2.0
    + */
    +#ifndef NULL
    +#ifdef XP_CPLUSPLUS
    +#define NULL 0
    +#else
    +#define NULL ((void *)0)
    +#endif
    +#endif
    +
    +/*===========================================================================*/
    +/* Calendar/TimeZone data types */
    +/*===========================================================================*/
    +
    +/**
    + * Date and Time data type.
    + * This is a primitive data type that holds the date and time
    + * as the number of milliseconds since 1970-jan-01, 00:00 UTC.
    + * UTC leap seconds are ignored.
    + * @stable ICU 2.0
    + */
    +typedef double UDate;
    +
    +/** The number of milliseconds per second @stable ICU 2.0 */
    +#define U_MILLIS_PER_SECOND (1000)
    +/** The number of milliseconds per minute @stable ICU 2.0 */
    +#define U_MILLIS_PER_MINUTE (60000)
    +/** The number of milliseconds per hour @stable ICU 2.0 */
    +#define U_MILLIS_PER_HOUR (3600000)
    +/** The number of milliseconds per day @stable ICU 2.0 */
    +#define U_MILLIS_PER_DAY (86400000)
    +
    +
    +/*===========================================================================*/
    +/* UClassID-based RTTI */
    +/*===========================================================================*/
    +
    +/**
    + * UClassID is used to identify classes without using RTTI, since RTTI
    + * is not yet supported by all C++ compilers. Each class hierarchy which needs
    + * to implement polymorphic clone() or operator==() defines two methods,
    + * described in detail below. UClassID values can be compared using
    + * operator==(). Nothing else should be done with them.
    + *
    + * \par
    + * getDynamicClassID() is declared in the base class of the hierarchy as
    + * a pure virtual. Each concrete subclass implements it in the same way:
    + *
    + * \code
    + * class Base {
    + * public:
    + * virtual UClassID getDynamicClassID() const = 0;
    + * }
    + *
    + * class Derived {
    + * public:
    + * virtual UClassID getDynamicClassID() const
    + * { return Derived::getStaticClassID(); }
    + * }
    + * \endcode
    + *
    + * Each concrete class implements getStaticClassID() as well, which allows
    + * clients to test for a specific type.
    + *
    + * \code
    + * class Derived {
    + * public:
    + * static UClassID U_EXPORT2 getStaticClassID();
    + * private:
    + * static char fgClassID;
    + * }
    + *
    + * // In Derived.cpp:
    + * UClassID Derived::getStaticClassID()
    + * { return (UClassID)&Derived::fgClassID; }
    + * char Derived::fgClassID = 0; // Value is irrelevant
    + * \endcode
    + * @stable ICU 2.0
    + */
    +typedef void* UClassID;
    +
    +/*===========================================================================*/
    +/* Shared library/DLL import-export API control */
    +/*===========================================================================*/
    +
    +/*
    + * Control of symbol import/export.
    + * ICU is separated into three libraries.
    + */
    +
    +/*
    + * \def U_COMBINED_IMPLEMENTATION
    + * Set to export library symbols from inside the ICU library
    + * when all of ICU is in a single library.
    + * This can be set as a compiler option while building ICU, and it
    + * needs to be the first one tested to override U_COMMON_API, U_I18N_API, etc.
    + * @stable ICU 2.0
    + */
    +
    +/**
    + * \def U_DATA_API
    + * Set to export library symbols from inside the stubdata library,
    + * and to import them from outside.
    + * @stable ICU 3.0
    + */
    +
    +/**
    + * \def U_COMMON_API
    + * Set to export library symbols from inside the common library,
    + * and to import them from outside.
    + * @stable ICU 2.0
    + */
    +
    +/**
    + * \def U_I18N_API
    + * Set to export library symbols from inside the i18n library,
    + * and to import them from outside.
    + * @stable ICU 2.0
    + */
    +
    +/**
    + * \def U_LAYOUT_API
    + * Set to export library symbols from inside the layout engine library,
    + * and to import them from outside.
    + * @stable ICU 2.0
    + */
    +
    +/**
    + * \def U_LAYOUTEX_API
    + * Set to export library symbols from inside the layout extensions library,
    + * and to import them from outside.
    + * @stable ICU 2.6
    + */
    +
    +/**
    + * \def U_IO_API
    + * Set to export library symbols from inside the ustdio library,
    + * and to import them from outside.
    + * @stable ICU 2.0
    + */
    +
    +/**
    + * \def U_TOOLUTIL_API
    + * Set to export library symbols from inside the toolutil library,
    + * and to import them from outside.
    + * @stable ICU 3.4
    + */
    +
    +#if defined(U_COMBINED_IMPLEMENTATION)
    +#define U_DATA_API U_EXPORT
    +#define U_COMMON_API U_EXPORT
    +#define U_I18N_API U_EXPORT
    +#define U_LAYOUT_API U_EXPORT
    +#define U_LAYOUTEX_API U_EXPORT
    +#define U_IO_API U_EXPORT
    +#define U_TOOLUTIL_API U_EXPORT
    +#elif defined(U_STATIC_IMPLEMENTATION)
    +#define U_DATA_API
    +#define U_COMMON_API
    +#define U_I18N_API
    +#define U_LAYOUT_API
    +#define U_LAYOUTEX_API
    +#define U_IO_API
    +#define U_TOOLUTIL_API
    +#elif defined(U_COMMON_IMPLEMENTATION)
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_EXPORT
    +#define U_I18N_API U_IMPORT
    +#define U_LAYOUT_API U_IMPORT
    +#define U_LAYOUTEX_API U_IMPORT
    +#define U_IO_API U_IMPORT
    +#define U_TOOLUTIL_API U_IMPORT
    +#elif defined(U_I18N_IMPLEMENTATION)
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_IMPORT
    +#define U_I18N_API U_EXPORT
    +#define U_LAYOUT_API U_IMPORT
    +#define U_LAYOUTEX_API U_IMPORT
    +#define U_IO_API U_IMPORT
    +#define U_TOOLUTIL_API U_IMPORT
    +#elif defined(U_LAYOUT_IMPLEMENTATION)
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_IMPORT
    +#define U_I18N_API U_IMPORT
    +#define U_LAYOUT_API U_EXPORT
    +#define U_LAYOUTEX_API U_IMPORT
    +#define U_IO_API U_IMPORT
    +#define U_TOOLUTIL_API U_IMPORT
    +#elif defined(U_LAYOUTEX_IMPLEMENTATION)
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_IMPORT
    +#define U_I18N_API U_IMPORT
    +#define U_LAYOUT_API U_IMPORT
    +#define U_LAYOUTEX_API U_EXPORT
    +#define U_IO_API U_IMPORT
    +#define U_TOOLUTIL_API U_IMPORT
    +#elif defined(U_IO_IMPLEMENTATION)
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_IMPORT
    +#define U_I18N_API U_IMPORT
    +#define U_LAYOUT_API U_IMPORT
    +#define U_LAYOUTEX_API U_IMPORT
    +#define U_IO_API U_EXPORT
    +#define U_TOOLUTIL_API U_IMPORT
    +#elif defined(U_TOOLUTIL_IMPLEMENTATION)
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_IMPORT
    +#define U_I18N_API U_IMPORT
    +#define U_LAYOUT_API U_IMPORT
    +#define U_LAYOUTEX_API U_IMPORT
    +#define U_IO_API U_IMPORT
    +#define U_TOOLUTIL_API U_EXPORT
    +#else
    +#define U_DATA_API U_IMPORT
    +#define U_COMMON_API U_IMPORT
    +#define U_I18N_API U_IMPORT
    +#define U_LAYOUT_API U_IMPORT
    +#define U_LAYOUTEX_API U_IMPORT
    +#define U_IO_API U_IMPORT
    +#define U_TOOLUTIL_API U_IMPORT
    +#endif
    +
    +/**
    + * \def U_STANDARD_CPP_NAMESPACE
    + * Control of C++ Namespace
    + * @stable ICU 2.0
    + */
    +#ifdef __cplusplus
    +#define U_STANDARD_CPP_NAMESPACE ::
    +#else
    +#define U_STANDARD_CPP_NAMESPACE
    +#endif
    +
    +
    +/*===========================================================================*/
    +/* Global delete operator */
    +/*===========================================================================*/
    +
    +/*
    + * The ICU4C library must not use the global new and delete operators.
    + * These operators here are defined to enable testing for this.
    + * See Jitterbug 2581 for details of why this is necessary.
    + *
    + * Verification that ICU4C's memory usage is correct, i.e.,
    + * that global new/delete are not used:
    + *
    + * a) Check for imports of global new/delete (see uobject.cpp for details)
    + * b) Verify that new is never imported.
    + * c) Verify that delete is only imported from object code for interface/mixin classes.
    + * d) Add global delete and delete[] only for the ICU4C library itself
    + * and define them in a way that crashes or otherwise easily shows a problem.
    + *
    + * The following implements d).
    + * The operator implementations crash; this is intentional and used for library debugging.
    + *
    + * Note: This is currently only done on Windows because
    + * some Linux/Unix compilers have problems with defining global new/delete.
    + * On Windows, U_WINDOWS is defined, and it is _MSC_VER>=1200 for MSVC 6.0 and higher.
    + */
    +#if defined(XP_CPLUSPLUS) && defined(U_WINDOWS) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
    +
    +#ifndef U_HIDE_INTERNAL_API
    +/**
    + * Global operator new, defined only inside ICU4C, must not be used.
    + * Crashes intentionally.
    + * @internal
    + */
    +inline void *
    +operator new(size_t /*size*/) {
    + char *q=NULL;
    + *q=5; /* break it */
    + return q;
    +}
    +
    +#ifdef _Ret_bytecap_
    +/* This is only needed to suppress a Visual C++ 2008 warning for operator new[]. */
    +_Ret_bytecap_(_Size)
    +#endif
    +/**
    + * Global operator new[], defined only inside ICU4C, must not be used.
    + * Crashes intentionally.
    + * @internal
    + */
    +inline void *
    +operator new[](size_t /*size*/) {
    + char *q=NULL;
    + *q=5; /* break it */
    + return q;
    +}
    +
    +/**
    + * Global operator delete, defined only inside ICU4C, must not be used.
    + * Crashes intentionally.
    + * @internal
    + */
    +inline void
    +operator delete(void * /*p*/) {
    + char *q=NULL;
    + *q=5; /* break it */
    +}
    +
    +/**
    + * Global operator delete[], defined only inside ICU4C, must not be used.
    + * Crashes intentionally.
    + * @internal
    + */
    +inline void
    +operator delete[](void * /*p*/) {
    + char *q=NULL;
    + *q=5; /* break it */
    +}
    +
    +#endif /* U_HIDE_INTERNAL_API */
    +#endif
    +
    +/*===========================================================================*/
    +/* UErrorCode */
    +/*===========================================================================*/
    +
    +/**
    + * Error code to replace exception handling, so that the code is compatible with all C++ compilers,
    + * and to use the same mechanism for C and C++.
    + *
    + * \par
    + * ICU functions that take a reference (C++) or a pointer (C) to a UErrorCode
    + * first test if(U_FAILURE(errorCode)) { return immediately; }
    + * so that in a chain of such functions the first one that sets an error code
    + * causes the following ones to not perform any operations.
    + *
    + * \par
    + * Error codes should be tested using U_FAILURE() and U_SUCCESS().
    + * @stable ICU 2.0
    + */
    +typedef enum UErrorCode {
    + /* The ordering of U_ERROR_INFO_START Vs U_USING_FALLBACK_WARNING looks weird
    + * and is that way because VC++ debugger displays first encountered constant,
    + * which is not the what the code is used for
    + */
    +
    + U_USING_FALLBACK_WARNING = -128, /**< A resource bundle lookup returned a fallback result (not an error) */
    +
    + U_ERROR_WARNING_START = -128, /**< Start of information results (semantically successful) */
    +
    + U_USING_DEFAULT_WARNING = -127, /**< A resource bundle lookup returned a result from the root locale (not an error) */
    +
    + U_SAFECLONE_ALLOCATED_WARNING = -126, /**< A SafeClone operation required allocating memory (informational only) */
    +
    + U_STATE_OLD_WARNING = -125, /**< ICU has to use compatibility layer to construct the service. Expect performance/memory usage degradation. Consider upgrading */
    +
    + U_STRING_NOT_TERMINATED_WARNING = -124,/**< An output string could not be NUL-terminated because output length==destCapacity. */
    +
    + U_SORT_KEY_TOO_SHORT_WARNING = -123, /**< Number of levels requested in getBound is higher than the number of levels in the sort key */
    +
    + U_AMBIGUOUS_ALIAS_WARNING = -122, /**< This converter alias can go to different converter implementations */
    +
    + U_DIFFERENT_UCA_VERSION = -121, /**< ucol_open encountered a mismatch between UCA version and collator image version, so the collator was constructed from rules. No impact to further function */
    +
    + U_ERROR_WARNING_LIMIT, /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */
    +
    +
    + U_ZERO_ERROR = 0, /**< No error, no warning. */
    +
    + U_ILLEGAL_ARGUMENT_ERROR = 1, /**< Start of codes indicating failure */
    + U_MISSING_RESOURCE_ERROR = 2, /**< The requested resource cannot be found */
    + U_INVALID_FORMAT_ERROR = 3, /**< Data format is not what is expected */
    + U_FILE_ACCESS_ERROR = 4, /**< The requested file cannot be found */
    + U_INTERNAL_PROGRAM_ERROR = 5, /**< Indicates a bug in the library code */
    + U_MESSAGE_PARSE_ERROR = 6, /**< Unable to parse a message (message format) */
    + U_MEMORY_ALLOCATION_ERROR = 7, /**< Memory allocation error */
    + U_INDEX_OUTOFBOUNDS_ERROR = 8, /**< Trying to access the index that is out of bounds */
    + U_PARSE_ERROR = 9, /**< Equivalent to Java ParseException */
    + U_INVALID_CHAR_FOUND = 10, /**< Character conversion: Unmappable input sequence. In other APIs: Invalid character. */
    + U_TRUNCATED_CHAR_FOUND = 11, /**< Character conversion: Incomplete input sequence. */
    + U_ILLEGAL_CHAR_FOUND = 12, /**< Character conversion: Illegal input sequence/combination of input units. */
    + U_INVALID_TABLE_FORMAT = 13, /**< Conversion table file found, but corrupted */
    + U_INVALID_TABLE_FILE = 14, /**< Conversion table file not found */
    + U_BUFFER_OVERFLOW_ERROR = 15, /**< A result would not fit in the supplied buffer */
    + U_UNSUPPORTED_ERROR = 16, /**< Requested operation not supported in current context */
    + U_RESOURCE_TYPE_MISMATCH = 17, /**< an operation is requested over a resource that does not support it */
    + U_ILLEGAL_ESCAPE_SEQUENCE = 18, /**< ISO-2022 illlegal escape sequence */
    + U_UNSUPPORTED_ESCAPE_SEQUENCE = 19, /**< ISO-2022 unsupported escape sequence */
    + U_NO_SPACE_AVAILABLE = 20, /**< No space available for in-buffer expansion for Arabic shaping */
    + U_CE_NOT_FOUND_ERROR = 21, /**< Currently used only while setting variable top, but can be used generally */
    + U_PRIMARY_TOO_LONG_ERROR = 22, /**< User tried to set variable top to a primary that is longer than two bytes */
    + U_STATE_TOO_OLD_ERROR = 23, /**< ICU cannot construct a service from this state, as it is no longer supported */
    + U_TOO_MANY_ALIASES_ERROR = 24, /**< There are too many aliases in the path to the requested resource.
    + It is very possible that a circular alias definition has occured */
    + U_ENUM_OUT_OF_SYNC_ERROR = 25, /**< UEnumeration out of sync with underlying collection */
    + U_INVARIANT_CONVERSION_ERROR = 26, /**< Unable to convert a UChar* string to char* with the invariant converter. */
    + U_INVALID_STATE_ERROR = 27, /**< Requested operation can not be completed with ICU in its current state */
    + U_COLLATOR_VERSION_MISMATCH = 28, /**< Collator version is not compatible with the base version */
    + U_USELESS_COLLATOR_ERROR = 29, /**< Collator is options only and no base is specified */
    + U_NO_WRITE_PERMISSION = 30, /**< Attempt to modify read-only or constant data. */
    +
    + U_STANDARD_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for standard errors */
    + /*
    + * the error code range 0x10000 0x10100 are reserved for Transliterator
    + */
    + U_BAD_VARIABLE_DEFINITION=0x10000,/**< Missing '$' or duplicate variable name */
    + U_PARSE_ERROR_START = 0x10000, /**< Start of Transliterator errors */
    + U_MALFORMED_RULE, /**< Elements of a rule are misplaced */
    + U_MALFORMED_SET, /**< A UnicodeSet pattern is invalid*/
    + U_MALFORMED_SYMBOL_REFERENCE, /**< UNUSED as of ICU 2.4 */
    + U_MALFORMED_UNICODE_ESCAPE, /**< A Unicode escape pattern is invalid*/
    + U_MALFORMED_VARIABLE_DEFINITION, /**< A variable definition is invalid */
    + U_MALFORMED_VARIABLE_REFERENCE, /**< A variable reference is invalid */
    + U_MISMATCHED_SEGMENT_DELIMITERS, /**< UNUSED as of ICU 2.4 */
    + U_MISPLACED_ANCHOR_START, /**< A start anchor appears at an illegal position */
    + U_MISPLACED_CURSOR_OFFSET, /**< A cursor offset occurs at an illegal position */
    + U_MISPLACED_QUANTIFIER, /**< A quantifier appears after a segment close delimiter */
    + U_MISSING_OPERATOR, /**< A rule contains no operator */
    + U_MISSING_SEGMENT_CLOSE, /**< UNUSED as of ICU 2.4 */
    + U_MULTIPLE_ANTE_CONTEXTS, /**< More than one ante context */
    + U_MULTIPLE_CURSORS, /**< More than one cursor */
    + U_MULTIPLE_POST_CONTEXTS, /**< More than one post context */
    + U_TRAILING_BACKSLASH, /**< A dangling backslash */
    + U_UNDEFINED_SEGMENT_REFERENCE, /**< A segment reference does not correspond to a defined segment */
    + U_UNDEFINED_VARIABLE, /**< A variable reference does not correspond to a defined variable */
    + U_UNQUOTED_SPECIAL, /**< A special character was not quoted or escaped */
    + U_UNTERMINATED_QUOTE, /**< A closing single quote is missing */
    + U_RULE_MASK_ERROR, /**< A rule is hidden by an earlier more general rule */
    + U_MISPLACED_COMPOUND_FILTER, /**< A compound filter is in an invalid location */
    + U_MULTIPLE_COMPOUND_FILTERS, /**< More than one compound filter */
    + U_INVALID_RBT_SYNTAX, /**< A "::id" rule was passed to the RuleBasedTransliterator parser */
    + U_INVALID_PROPERTY_PATTERN, /**< UNUSED as of ICU 2.4 */
    + U_MALFORMED_PRAGMA, /**< A 'use' pragma is invlalid */
    + U_UNCLOSED_SEGMENT, /**< A closing ')' is missing */
    + U_ILLEGAL_CHAR_IN_SEGMENT, /**< UNUSED as of ICU 2.4 */
    + U_VARIABLE_RANGE_EXHAUSTED, /**< Too many stand-ins generated for the given variable range */
    + U_VARIABLE_RANGE_OVERLAP, /**< The variable range overlaps characters used in rules */
    + U_ILLEGAL_CHARACTER, /**< A special character is outside its allowed context */
    + U_INTERNAL_TRANSLITERATOR_ERROR, /**< Internal transliterator system error */
    + U_INVALID_ID, /**< A "::id" rule specifies an unknown transliterator */
    + U_INVALID_FUNCTION, /**< A "&fn()" rule specifies an unknown transliterator */
    + U_PARSE_ERROR_LIMIT, /**< The limit for Transliterator errors */
    +
    + /*
    + * the error code range 0x10100 0x10200 are reserved for formatting API parsing error
    + */
    + U_UNEXPECTED_TOKEN=0x10100, /**< Syntax error in format pattern */
    + U_FMT_PARSE_ERROR_START=0x10100, /**< Start of format library errors */
    + U_MULTIPLE_DECIMAL_SEPARATORS, /**< More than one decimal separator in number pattern */
    + U_MULTIPLE_DECIMAL_SEPERATORS = U_MULTIPLE_DECIMAL_SEPARATORS, /**< Typo: kept for backward compatibility. Use U_MULTIPLE_DECIMAL_SEPARATORS */
    + U_MULTIPLE_EXPONENTIAL_SYMBOLS, /**< More than one exponent symbol in number pattern */
    + U_MALFORMED_EXPONENTIAL_PATTERN, /**< Grouping symbol in exponent pattern */
    + U_MULTIPLE_PERCENT_SYMBOLS, /**< More than one percent symbol in number pattern */
    + U_MULTIPLE_PERMILL_SYMBOLS, /**< More than one permill symbol in number pattern */
    + U_MULTIPLE_PAD_SPECIFIERS, /**< More than one pad symbol in number pattern */
    + U_PATTERN_SYNTAX_ERROR, /**< Syntax error in format pattern */
    + U_ILLEGAL_PAD_POSITION, /**< Pad symbol misplaced in number pattern */
    + U_UNMATCHED_BRACES, /**< Braces do not match in message pattern */
    + U_UNSUPPORTED_PROPERTY, /**< UNUSED as of ICU 2.4 */
    + U_UNSUPPORTED_ATTRIBUTE, /**< UNUSED as of ICU 2.4 */
    + U_ARGUMENT_TYPE_MISMATCH, /**< Argument name and argument index mismatch in MessageFormat functions */
    + U_DUPLICATE_KEYWORD, /**< Duplicate keyword in PluralFormat */
    + U_UNDEFINED_KEYWORD, /**< Undefined Pluarl keyword */
    + U_DEFAULT_KEYWORD_MISSING, /**< Missing DEFAULT rule in plural rules */
    + U_FMT_PARSE_ERROR_LIMIT, /**< The limit for format library errors */
    +
    + /*
    + * the error code range 0x10200 0x102ff are reserved for Break Iterator related error
    + */
    + U_BRK_INTERNAL_ERROR=0x10200, /**< An internal error (bug) was detected. */
    + U_BRK_ERROR_START=0x10200, /**< Start of codes indicating Break Iterator failures */
    + U_BRK_HEX_DIGITS_EXPECTED, /**< Hex digits expected as part of a escaped char in a rule. */
    + U_BRK_SEMICOLON_EXPECTED, /**< Missing ';' at the end of a RBBI rule. */
    + U_BRK_RULE_SYNTAX, /**< Syntax error in RBBI rule. */
    + U_BRK_UNCLOSED_SET, /**< UnicodeSet witing an RBBI rule missing a closing ']'. */
    + U_BRK_ASSIGN_ERROR, /**< Syntax error in RBBI rule assignment statement. */
    + U_BRK_VARIABLE_REDFINITION, /**< RBBI rule $Variable redefined. */
    + U_BRK_MISMATCHED_PAREN, /**< Mis-matched parentheses in an RBBI rule. */
    + U_BRK_NEW_LINE_IN_QUOTED_STRING, /**< Missing closing quote in an RBBI rule. */
    + U_BRK_UNDEFINED_VARIABLE, /**< Use of an undefined $Variable in an RBBI rule. */
    + U_BRK_INIT_ERROR, /**< Initialization failure. Probable missing ICU Data. */
    + U_BRK_RULE_EMPTY_SET, /**< Rule contains an empty Unicode Set. */
    + U_BRK_UNRECOGNIZED_OPTION, /**< !!option in RBBI rules not recognized. */
    + U_BRK_MALFORMED_RULE_TAG, /**< The {nnn} tag on a rule is mal formed */
    + U_BRK_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for Break Iterator failures */
    +
    + /*
    + * The error codes in the range 0x10300-0x103ff are reserved for regular expression related errrs
    + */
    + U_REGEX_INTERNAL_ERROR=0x10300, /**< An internal error (bug) was detected. */
    + U_REGEX_ERROR_START=0x10300, /**< Start of codes indicating Regexp failures */
    + U_REGEX_RULE_SYNTAX, /**< Syntax error in regexp pattern. */
    + U_REGEX_INVALID_STATE, /**< RegexMatcher in invalid state for requested operation */
    + U_REGEX_BAD_ESCAPE_SEQUENCE, /**< Unrecognized backslash escape sequence in pattern */
    + U_REGEX_PROPERTY_SYNTAX, /**< Incorrect Unicode property */
    + U_REGEX_UNIMPLEMENTED, /**< Use of regexp feature that is not yet implemented. */
    + U_REGEX_MISMATCHED_PAREN, /**< Incorrectly nested parentheses in regexp pattern. */
    + U_REGEX_NUMBER_TOO_BIG, /**< Decimal number is too large. */
    + U_REGEX_BAD_INTERVAL, /**< Error in {min,max} interval */
    + U_REGEX_MAX_LT_MIN, /**< In {min,max}, max is less than min. */
    + U_REGEX_INVALID_BACK_REF, /**< Back-reference to a non-existent capture group. */
    + U_REGEX_INVALID_FLAG, /**< Invalid value for match mode flags. */
    + U_REGEX_LOOK_BEHIND_LIMIT, /**< Look-Behind pattern matches must have a bounded maximum length. */
    + U_REGEX_SET_CONTAINS_STRING, /**< Regexps cannot have UnicodeSets containing strings.*/
    + U_REGEX_OCTAL_TOO_BIG, /**< Octal character constants must be <= 0377. */
    + U_REGEX_MISSING_CLOSE_BRACKET, /**< Missing closing bracket on a bracket expression. */
    + U_REGEX_INVALID_RANGE, /**< In a character range [x-y], x is greater than y. */
    + U_REGEX_STACK_OVERFLOW, /**< Regular expression backtrack stack overflow. */
    + U_REGEX_TIME_OUT, /**< Maximum allowed match time exceeded */
    + U_REGEX_STOPPED_BY_CALLER, /**< Matching operation aborted by user callback fn. */
    + U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */
    +
    + /*
    + * The error code in the range 0x10400-0x104ff are reserved for IDNA related error codes
    + */
    + U_IDNA_PROHIBITED_ERROR=0x10400,
    + U_IDNA_ERROR_START=0x10400,
    + U_IDNA_UNASSIGNED_ERROR,
    + U_IDNA_CHECK_BIDI_ERROR,
    + U_IDNA_STD3_ASCII_RULES_ERROR,
    + U_IDNA_ACE_PREFIX_ERROR,
    + U_IDNA_VERIFICATION_ERROR,
    + U_IDNA_LABEL_TOO_LONG_ERROR,
    + U_IDNA_ZERO_LENGTH_LABEL_ERROR,
    + U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR,
    + U_IDNA_ERROR_LIMIT,
    + /*
    + * Aliases for StringPrep
    + */
    + U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR,
    + U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR,
    + U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR,
    +
    +
    + U_ERROR_LIMIT=U_IDNA_ERROR_LIMIT /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */
    +} UErrorCode;
    +
    +/* Use the following to determine if an UErrorCode represents */
    +/* operational success or failure. */
    +
    +#ifdef XP_CPLUSPLUS
    + /**
    + * Does the error code indicate success?
    + * @stable ICU 2.0
    + */
    + static
    + inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
    + /**
    + * Does the error code indicate a failure?
    + * @stable ICU 2.0
    + */
    + static
    + inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
    +#else
    + /**
    + * Does the error code indicate success?
    + * @stable ICU 2.0
    + */
    +# define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
    + /**
    + * Does the error code indicate a failure?
    + * @stable ICU 2.0
    + */
    +# define U_FAILURE(x) ((x)>U_ZERO_ERROR)
    +#endif
    +
    +/**
    + * Return a string for a UErrorCode value.
    + * The string will be the same as the name of the error code constant
    + * in the UErrorCode enum above.
    + * @stable ICU 2.0
    + */
    +U_STABLE const char * U_EXPORT2
    +u_errorName(UErrorCode code);
    +
    +
    +#endif /* _UTYPES */

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/uversion.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/uversion.h b/platform/osx/icu/unicode/uversion.h
    new file mode 100644
    index 0000000..5bf7fda
    --- /dev/null
    +++ b/platform/osx/icu/unicode/uversion.h
    @@ -0,0 +1,275 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2000-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* file name: uversion.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* Created by: Vladimir Weinstein
    +*
    +* Contains all the important version numbers for ICU.
    +* Gets included by utypes.h and Windows .rc files
    +*/
    +
    +/**
    + * \file
    + * \brief C API: Contains all the important version numbers for ICU.
    + */
    +/*===========================================================================*/
    +/* Main ICU version information */
    +/*===========================================================================*/
    +
    +#ifndef UVERSION_H
    +#define UVERSION_H
    +
    +/**
    + * IMPORTANT: When updating version, the following things need to be done:
    + * source/common/unicode/uversion.h - this file: update major, minor,
    + * patchlevel, suffix, version, short version constants, namespace,
    + * and copyright
    + * source/common/common.vcproj - update 'Output file name' on the link tab so
    + * that it contains the new major/minor combination
    + * source/i18n/i18n.vcproj - same as for the common.vcproj
    + * source/layout/layout.vcproj - same as for the common.vcproj
    + * source/layoutex/layoutex.vcproj - same
    + * source/stubdata/stubdata.vcproj - same as for the common.vcproj
    + * source/io/io.vcproj - same as for the common.vcproj
    + * source/data/makedata.mak - change U_ICUDATA_NAME so that it contains
    + * the new major/minor combination
    + * source/tools/genren/genren.pl - use this script according to the README
    + * in that folder
    + */
    +
    +#include "unicode/umachine.h"
    +
    +/** The standard copyright notice that gets compiled into each library.
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define U_COPYRIGHT_STRING \
    + " Copyright (C) 2008, International Business Machines Corporation and others. All Rights Reserved. "
    +
    +/** Maximum length of the copyright string.
    + * @stable ICU 2.4
    + */
    +#define U_COPYRIGHT_STRING_LENGTH 128
    +
    +/** The current ICU major version as an integer.
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define U_ICU_VERSION_MAJOR_NUM 4
    +
    +/** The current ICU minor version as an integer.
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.6
    + */
    +#define U_ICU_VERSION_MINOR_NUM 0
    +
    +/** The current ICU patchlevel version as an integer.
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define U_ICU_VERSION_PATCHLEVEL_NUM 0
    +
    +/** The current ICU build level version as an integer.
    + * This value is for use by ICU clients. It defaults to 0.
    + * @draft ICU 4.0
    + */
    +#ifndef U_ICU_VERSION_BUILDLEVEL_NUM
    +#define U_ICU_VERSION_BUILDLEVEL_NUM 0
    +#endif
    +
    +/** Glued version suffix for renamers
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.6
    + */
    +#define U_ICU_VERSION_SUFFIX _4_0
    +
    +/** The current ICU library version as a dotted-decimal string. The patchlevel
    + * only appears in this string if it non-zero.
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define U_ICU_VERSION "4.0"
    +
    +/** The current ICU library major/minor version as a string without dots, for library name suffixes.
    + * This value will change in the subsequent releases of ICU
    + * @stable ICU 2.6
    + */
    +#define U_ICU_VERSION_SHORT "40"
    +
    +/** An ICU version consists of up to 4 numbers from 0..255.
    + * @stable ICU 2.4
    + */
    +#define U_MAX_VERSION_LENGTH 4
    +
    +/** In a string, ICU version fields are delimited by dots.
    + * @stable ICU 2.4
    + */
    +#define U_VERSION_DELIMITER '.'
    +
    +/** The maximum length of an ICU version string.
    + * @stable ICU 2.4
    + */
    +#define U_MAX_VERSION_STRING_LENGTH 20
    +
    +/** The binary form of a version on ICU APIs is an array of 4 uint8_t.
    + * @stable ICU 2.4
    + */
    +typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
    +
    +/*===========================================================================*/
    +/* C++ namespace if supported. Versioned unless versioning is disabled. */
    +/*===========================================================================*/
    +
    +/**
    + * \def U_NAMESPACE_BEGIN
    + * This is used to begin a declaration of a public ICU C++ API.
    + * If the compiler doesn't support namespaces, this does nothing.
    + * @stable ICU 2.4
    + */
    +
    +/**
    + * \def U_NAMESPACE_END
    + * This is used to end a declaration of a public ICU C++ API
    + * If the compiler doesn't support namespaces, this does nothing.
    + * @stable ICU 2.4
    + */
    +
    +/**
    + * \def U_NAMESPACE_USE
    + * This is used to specify that the rest of the code uses the
    + * public ICU C++ API namespace.
    + * If the compiler doesn't support namespaces, this does nothing.
    + * @stable ICU 2.4
    + */
    +
    +/**
    + * \def U_NAMESPACE_QUALIFIER
    + * This is used to qualify that a function or class is part of
    + * the public ICU C++ API namespace.
    + * If the compiler doesn't support namespaces, this does nothing.
    + * @stable ICU 2.4
    + */
    +
    +/* Define namespace symbols if the compiler supports it. */
    +#if U_HAVE_NAMESPACE && defined(XP_CPLUSPLUS)
    +# if U_DISABLE_RENAMING
    +# define U_ICU_NAMESPACE icu
    + namespace U_ICU_NAMESPACE { }
    +# else
    +# define U_ICU_NAMESPACE icu_4_0
    + namespace U_ICU_NAMESPACE { }
    + namespace icu = U_ICU_NAMESPACE;
    +# endif
    +
    +# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
    +# define U_NAMESPACE_END }
    +# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
    +# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
    +
    +# ifndef U_USING_ICU_NAMESPACE
    +# define U_USING_ICU_NAMESPACE 1
    +# endif
    +# if U_USING_ICU_NAMESPACE
    + U_NAMESPACE_USE
    +# endif
    +#else
    +# define U_NAMESPACE_BEGIN
    +# define U_NAMESPACE_END
    +# define U_NAMESPACE_USE
    +# define U_NAMESPACE_QUALIFIER
    +#endif
    +
    +
    +/*===========================================================================*/
    +/* General version helper functions. Definitions in putil.c */
    +/*===========================================================================*/
    +
    +/**
    + * Parse a string with dotted-decimal version information and
    + * fill in a UVersionInfo structure with the result.
    + * Definition of this function lives in putil.c
    + *
    + * @param versionArray The destination structure for the version information.
    + * @param versionString A string with dotted-decimal version information,
    + * with up to four non-negative number fields with
    + * values of up to 255 each.
    + * @stable ICU 2.4
    + */
    +U_STABLE void U_EXPORT2
    +u_versionFromString(UVersionInfo versionArray, const char *versionString);
    +
    +/**
    + * Write a string with dotted-decimal version information according
    + * to the input UVersionInfo.
    + * Definition of this function lives in putil.c
    + *
    + * @param versionArray The version information to be written as a string.
    + * @param versionString A string buffer that will be filled in with
    + * a string corresponding to the numeric version
    + * information in versionArray.
    + * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH.
    + * @stable ICU 2.4
    + */
    +U_STABLE void U_EXPORT2
    +u_versionToString(UVersionInfo versionArray, char *versionString);
    +
    +/**
    + * Gets the ICU release version. The version array stores the version information
    + * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02.
    + * Definition of this function lives in putil.c
    + *
    + * @param versionArray the version # information, the result will be filled in
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +u_getVersion(UVersionInfo versionArray);
    +
    +
    +/*===========================================================================
    + * ICU collation framework version information
    + * Version info that can be obtained from a collator is affected by these
    + * numbers in a secret and magic way. Please use collator version as whole
    + *===========================================================================
    + */
    +
    +/** Collation runtime version (sort key generator, strcoll).
    + * If the version is different, sortkeys for the same string could be different
    + * version 2 was in ICU 1.8.1. changed is: compression intervals, French secondary
    + * compression, generating quad level always when strength is quad or more
    + * version 4 - ICU 2.2 - tracking UCA changes, ignore completely ignorables
    + * in contractions, ignore primary ignorables after shifted
    + * version 5 - ICU 2.8 - changed implicit generation code
    + * version 6 - ICU 3.4 - with the UCA 4.1, Thai tag is no longer generated or used
    + * This value may change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define UCOL_RUNTIME_VERSION 6
    +
    +/** Builder code version. When this is different, same tailoring might result
    + * in assigning different collation elements to code points
    + * version 2 was in ICU 1.8.1. added support for prefixes, tweaked canonical
    + * closure. However, the tailorings should probably get same CEs assigned
    + * version 5 - ICU 2.2 - fixed some bugs, renamed some indirect values.
    + * version 6 - ICU 2.8 - fixed bug in builder that allowed 0xFF in primary values
    + * version 7 - ICU 3.4 - with the UCA 4.1 Thai tag is no longer processed, complete ignorables
    + * now break contractions
    + * Backward compatible with the old rules.
    + * This value may change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define UCOL_BUILDER_VERSION 7
    +
    +/** This is the version of the tailorings
    + * This value may change in the subsequent releases of ICU
    + * @stable ICU 2.4
    + */
    +#define UCOL_TAILORINGS_VERSION 1
    +
    +#endif
  • Davisp at Feb 6, 2014 at 5:30 pm
    working release


    Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/repo
    Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/commit/9ea12020
    Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/tree/9ea12020
    Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/diff/9ea12020

    Branch: refs/heads/import-rcouch
    Commit: 9ea120206802f449ea848070a9c645b6f4687ea9
    Parents: 3e0f744
    Author: benoitc <benoitc@apache.org>
    Authored: Tue Jan 7 16:14:56 2014 +0100
    Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
    Committed: Thu Feb 6 11:25:48 2014 -0600

    ----------------------------------------------------------------------
      src/couch_collate.app.src | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/9ea12020/src/couch_collate.app.src
    ----------------------------------------------------------------------
    diff --git a/src/couch_collate.app.src b/src/couch_collate.app.src
    index 4541b67..c41495c 100644
    --- a/src/couch_collate.app.src
    +++ b/src/couch_collate.app.src
    @@ -4,7 +4,7 @@
      {application, couch_collate,
          [
              {description, "couchdb collation module"},
    - {vsn, "0.1.0"},
    + {vsn, "1.0.0"},
              {registered, []},
              {applications, [kernel,
                              stdlib]},
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/vtzone.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/vtzone.h b/platform/osx/icu/unicode/vtzone.h
    new file mode 100644
    index 0000000..9463f35
    --- /dev/null
    +++ b/platform/osx/icu/unicode/vtzone.h
    @@ -0,0 +1,443 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2007-2008, International Business Machines Corporation and *
    +* others. All Rights Reserved. *
    +*******************************************************************************
    +*/
    +#ifndef VTZONE_H
    +#define VTZONE_H
    +
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C++ API: RFC2445 VTIMEZONE support
    + */
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/basictz.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +class VTZWriter;
    +class VTZReader;
    +class UVector;
    +
    +/**
    + * <code>VTimeZone</code> is a class implementing RFC2445 VTIMEZONE. You can create a
    + * <code>VTimeZone</code> instance from a time zone ID supported by <code>TimeZone</code>.
    + * With the <code>VTimeZone</code> instance created from the ID, you can write out the rule
    + * in RFC2445 VTIMEZONE format. Also, you can create a <code>VTimeZone</code> instance
    + * from RFC2445 VTIMEZONE data stream, which allows you to calculate time
    + * zone offset by the rules defined by the data.<br><br>
    + * Note: The consumer of this class reading or writing VTIMEZONE data is responsible to
    + * decode or encode Non-ASCII text. Methods reading/writing VTIMEZONE data in this class
    + * do nothing with MIME encoding.
    + * @stable ICU 4.0
    + */
    +class U_I18N_API VTimeZone : public BasicTimeZone {
    +public:
    + /**
    + * Copy constructor.
    + * @param source The <code>VTimeZone</code> object to be copied.
    + * @stable ICU 4.0
    + */
    + VTimeZone(const VTimeZone& source);
    +
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + virtual ~VTimeZone();
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + VTimeZone& operator=(const VTimeZone& right);
    +
    + /**
    + * Return true if the given <code>TimeZone</code> objects are
    + * semantically equal. Objects of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZone</code> objects are
    + *semantically equal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator==(const TimeZone& that) const;
    +
    + /**
    + * Return true if the given <code>TimeZone</code> objects are
    + * semantically unequal. Objects of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZone</code> objects are
    + * semantically unequal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator!=(const TimeZone& that) const;
    +
    + /**
    + * Create a <code>VTimeZone</code> instance by the time zone ID.
    + * @param ID The time zone ID, such as America/New_York
    + * @return A <code>VTimeZone</code> object initialized by the time zone ID,
    + * or NULL when the ID is unknown.
    + * @stable ICU 4.0
    + */
    + static VTimeZone* createVTimeZoneByID(const UnicodeString& ID);
    +
    + /**
    + * Create a <code>VTimeZone</code> instance by RFC2445 VTIMEZONE data
    + *
    + * @param vtzdata The string including VTIMEZONE data block
    + * @param status Output param to filled in with a success or an error.
    + * @return A <code>VTimeZone</code> initialized by the VTIMEZONE data or
    + * NULL if failed to load the rule from the VTIMEZONE data.
    + * @stable ICU 4.0
    + */
    + static VTimeZone* createVTimeZone(const UnicodeString& vtzdata, UErrorCode& status);
    +
    + /**
    + * Gets the RFC2445 TZURL property value. When a <code>VTimeZone</code> instance was
    + * created from VTIMEZONE data, the initial value is set by the TZURL property value
    + * in the data. Otherwise, the initial value is not set.
    + * @param url Receives the RFC2445 TZURL property value.
    + * @return TRUE if TZURL attribute is available and value is set.
    + * @stable ICU 4.0
    + */
    + UBool getTZURL(UnicodeString& url) const;
    +
    + /**
    + * Sets the RFC2445 TZURL property value.
    + * @param url The TZURL property value.
    + * @stable ICU 4.0
    + */
    + void setTZURL(const UnicodeString& url);
    +
    + /**
    + * Gets the RFC2445 LAST-MODIFIED property value. When a <code>VTimeZone</code> instance
    + * was created from VTIMEZONE data, the initial value is set by the LAST-MODIFIED property
    + * value in the data. Otherwise, the initial value is not set.
    + * @param lastModified Receives the last modified date.
    + * @return TRUE if lastModified attribute is available and value is set.
    + * @stable ICU 4.0
    + */
    + UBool getLastModified(UDate& lastModified) const;
    +
    + /**
    + * Sets the RFC2445 LAST-MODIFIED property value.
    + * @param lastModified The LAST-MODIFIED date.
    + * @stable ICU 4.0
    + */
    + void setLastModified(UDate lastModified);
    +
    + /**
    + * Writes RFC2445 VTIMEZONE data for this time zone
    + * @param result Output param to filled in with the VTIMEZONE data.
    + * @param status Output param to filled in with a success or an error.
    + * @stable ICU 4.0
    + */
    + void write(UnicodeString& result, UErrorCode& status) const;
    +
    + /**
    + * Writes RFC2445 VTIMEZONE data for this time zone applicalbe
    + * for dates after the specified start time.
    + * @param start The start date.
    + * @param result Output param to filled in with the VTIMEZONE data.
    + * @param status Output param to filled in with a success or an error.
    + * @stable ICU 4.0
    + */
    + void write(UDate start, UnicodeString& result, UErrorCode& status) /*const*/;
    +
    + /**
    + * Writes RFC2445 VTIMEZONE data applicalbe for the specified date.
    + * Some common iCalendar implementations can only handle a single time
    + * zone property or a pair of standard and daylight time properties using
    + * BYDAY rule with day of week (such as BYDAY=1SUN). This method produce
    + * the VTIMEZONE data which can be handled these implementations. The rules
    + * produced by this method can be used only for calculating time zone offset
    + * around the specified date.
    + * @param time The date used for rule extraction.
    + * @param result Output param to filled in with the VTIMEZONE data.
    + * @param status Output param to filled in with a success or an error.
    + * @stable ICU 4.0
    + */
    + void writeSimple(UDate time, UnicodeString& result, UErrorCode& status) /*const*/;
    +
    + /**
    + * Clones TimeZone objects polymorphically. Clients are responsible for deleting
    + * the TimeZone object cloned.
    + * @return A new copy of this TimeZone object.
    + * @stable ICU 4.0
    + */
    + virtual TimeZone* clone(void) const;
    +
    + /**
    + * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add
    + * to GMT to get local time in this time zone, taking daylight savings time into
    + * account) as of a particular reference date. The reference date is used to determine
    + * whether daylight savings time is in effect and needs to be figured into the offset
    + * that is returned (in other words, what is the adjusted GMT offset in this time zone
    + * at this particular date and time?). For the time zones produced by createTimeZone(),
    + * the reference data is specified according to the Gregorian calendar, and the date
    + * and time fields are local standard time.
    + *
    + * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload,
    + * which returns both the raw and the DST offset for a given time. This method
    + * is retained only for backward compatibility.
    + *
    + * @param era The reference date's era
    + * @param year The reference date's year
    + * @param month The reference date's month (0-based; 0 is January)
    + * @param day The reference date's day-in-month (1-based)
    + * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday)
    + * @param millis The reference date's milliseconds in day, local standard time
    + * @param status Output param to filled in with a success or an error.
    + * @return The offset in milliseconds to add to GMT to get local time.
    + * @stable ICU 4.0
    + */
    + virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
    + uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const;
    +
    + /**
    + * Gets the time zone offset, for current date, modified in case of
    + * daylight savings. This is the offset to add *to* UTC to get local time.
    + *
    + * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload,
    + * which returns both the raw and the DST offset for a given time. This method
    + * is retained only for backward compatibility.
    + *
    + * @param era The reference date's era
    + * @param year The reference date's year
    + * @param month The reference date's month (0-based; 0 is January)
    + * @param day The reference date's day-in-month (1-based)
    + * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday)
    + * @param millis The reference date's milliseconds in day, local standard time
    + * @param monthLength The length of the given month in days.
    + * @param status Output param to filled in with a success or an error.
    + * @return The offset in milliseconds to add to GMT to get local time.
    + * @stable ICU 4.0
    + */
    + virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
    + uint8_t dayOfWeek, int32_t millis,
    + int32_t monthLength, UErrorCode& status) const;
    +
    + /**
    + * Returns the time zone raw and GMT offset for the given moment
    + * in time. Upon return, local-millis = GMT-millis + rawOffset +
    + * dstOffset. All computations are performed in the proleptic
    + * Gregorian calendar. The default implementation in the TimeZone
    + * class delegates to the 8-argument getOffset().
    + *
    + * @param date moment in time for which to return offsets, in
    + * units of milliseconds from January 1, 1970 0:00 GMT, either GMT
    + * time or local wall time, depending on `local'.
    + * @param local if true, `date' is local wall time; otherwise it
    + * is in GMT time.
    + * @param rawOffset output parameter to receive the raw offset, that
    + * is, the offset not including DST adjustments
    + * @param dstOffset output parameter to receive the DST offset,
    + * that is, the offset to be added to `rawOffset' to obtain the
    + * total offset between local and GMT time. If DST is not in
    + * effect, this value is zero; otherwise it is a positive value,
    + * typically one hour.
    + * @param ec input-output error code
    + * @stable ICU 4.0
    + */
    + virtual void getOffset(UDate date, UBool local, int32_t& rawOffset,
    + int32_t& dstOffset, UErrorCode& ec) const;
    +
    + /**
    + * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
    + * to GMT to get local time, before taking daylight savings time into account).
    + *
    + * @param offsetMillis The new raw GMT offset for this time zone.
    + * @stable ICU 4.0
    + */
    + virtual void setRawOffset(int32_t offsetMillis);
    +
    + /**
    + * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
    + * to GMT to get local time, before taking daylight savings time into account).
    + *
    + * @return The TimeZone's raw GMT offset.
    + * @stable ICU 4.0
    + */
    + virtual int32_t getRawOffset(void) const;
    +
    + /**
    + * Queries if this time zone uses daylight savings time.
    + * @return true if this time zone uses daylight savings time,
    + * false, otherwise.
    + * @stable ICU 4.0
    + */
    + virtual UBool useDaylightTime(void) const;
    +
    + /**
    + * Queries if the given date is in daylight savings time in
    + * this time zone.
    + * This method is wasteful since it creates a new GregorianCalendar and
    + * deletes it each time it is called. This is a deprecated method
    + * and provided only for Java compatibility.
    + *
    + * @param date the given UDate.
    + * @param status Output param filled in with success/error code.
    + * @return true if the given date is in daylight savings time,
    + * false, otherwise.
    + * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead.
    + */
    + virtual UBool inDaylightTime(UDate date, UErrorCode& status) const;
    +
    + /**
    + * Returns true if this zone has the same rule and offset as another zone.
    + * That is, if this zone differs only in ID, if at all.
    + * @param other the <code>TimeZone</code> object to be compared with
    + * @return true if the given zone is the same as this one,
    + * with the possible exception of the ID
    + * @stable ICU 4.0
    + */
    + virtual UBool hasSameRules(const TimeZone& other) const;
    +
    + /**
    + * Gets the first time zone transition after the base time.
    + * @param base The base time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives the first transition after the base time.
    + * @return TRUE if the transition is found.
    + * @stable ICU 4.0
    + */
    + virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/;
    +
    + /**
    + * Gets the most recent time zone transition before the base time.
    + * @param base The base time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives the most recent transition before the base time.
    + * @return TRUE if the transition is found.
    + * @stable ICU 4.0
    + */
    + virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/;
    +
    + /**
    + * Returns the number of <code>TimeZoneRule</code>s which represents time transitions,
    + * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except
    + * <code>InitialTimeZoneRule</code>. The return value range is 0 or any positive value.
    + * @param status Receives error status code.
    + * @return The number of <code>TimeZoneRule</code>s representing time transitions.
    + * @stable ICU 4.0
    + */
    + virtual int32_t countTransitionRules(UErrorCode& status) /*const*/;
    +
    + /**
    + * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZoneRule</code>
    + * which represent time transitions for this time zone. On successful return,
    + * the argument initial points to non-NULL <code>InitialTimeZoneRule</code> and
    + * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</code>
    + * instances up to the size specified by trscount. The results are referencing the
    + * rule instance held by this time zone instance. Therefore, after this time zone
    + * is destructed, they are no longer available.
    + * @param initial Receives the initial timezone rule
    + * @param trsrules Receives the timezone transition rules
    + * @param trscount On input, specify the size of the array 'transitions' receiving
    + * the timezone transition rules. On output, actual number of
    + * rules filled in the array will be set.
    + * @param status Receives error status code.
    + * @stable ICU 4.0
    + */
    + virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
    + const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) /*const*/;
    +
    +private:
    + enum { DEFAULT_VTIMEZONE_LINES = 100 };
    +
    + /**
    + * Default constructor.
    + */
    + VTimeZone();
    + static VTimeZone* createVTimeZone(VTZReader* reader);
    + void write(VTZWriter& writer, UErrorCode& status) const;
    + void write(UDate start, VTZWriter& writer, UErrorCode& status) /*const*/;
    + void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) /*const*/;
    + void load(VTZReader& reader, UErrorCode& status);
    + void parse(UErrorCode& status);
    +
    + void writeZone(VTZWriter& w, BasicTimeZone& basictz, UVector* customProps,
    + UErrorCode& status) const;
    +
    + void writeHeaders(VTZWriter& w, UErrorCode& status) const;
    + void writeFooter(VTZWriter& writer, UErrorCode& status) const;
    +
    + void writeZonePropsByTime(VTZWriter& writer, UBool isDst, const UnicodeString& tzname,
    + int32_t fromOffset, int32_t toOffset, UDate time, UBool withRDATE,
    + UErrorCode& status) const;
    + void writeZonePropsByDOM(VTZWriter& writer, UBool isDst, const UnicodeString& tzname,
    + int32_t fromOffset, int32_t toOffset,
    + int32_t month, int32_t dayOfMonth, UDate startTime, UDate untilTime,
    + UErrorCode& status) const;
    + void writeZonePropsByDOW(VTZWriter& writer, UBool isDst, const UnicodeString& tzname,
    + int32_t fromOffset, int32_t toOffset,
    + int32_t month, int32_t weekInMonth, int32_t dayOfWeek,
    + UDate startTime, UDate untilTime, UErrorCode& status) const;
    + void writeZonePropsByDOW_GEQ_DOM(VTZWriter& writer, UBool isDst, const UnicodeString& tzname,
    + int32_t fromOffset, int32_t toOffset,
    + int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
    + UDate startTime, UDate untilTime, UErrorCode& status) const;
    + void writeZonePropsByDOW_GEQ_DOM_sub(VTZWriter& writer, int32_t month, int32_t dayOfMonth,
    + int32_t dayOfWeek, int32_t numDays,
    + UDate untilTime, int32_t fromOffset, UErrorCode& status) const;
    + void writeZonePropsByDOW_LEQ_DOM(VTZWriter& writer, UBool isDst, const UnicodeString& tzname,
    + int32_t fromOffset, int32_t toOffset,
    + int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
    + UDate startTime, UDate untilTime, UErrorCode& status) const;
    + void writeFinalRule(VTZWriter& writer, UBool isDst, const AnnualTimeZoneRule* rule,
    + int32_t fromRawOffset, int32_t fromDSTSavings,
    + UDate startTime, UErrorCode& status) const;
    +
    + void beginZoneProps(VTZWriter& writer, UBool isDst, const UnicodeString& tzname,
    + int32_t fromOffset, int32_t toOffset, UDate startTime, UErrorCode& status) const;
    + void endZoneProps(VTZWriter& writer, UBool isDst, UErrorCode& status) const;
    + void beginRRULE(VTZWriter& writer, int32_t month, UErrorCode& status) const;
    + void appendUNTIL(VTZWriter& writer, const UnicodeString& until, UErrorCode& status) const;
    +
    + BasicTimeZone *tz;
    + UVector *vtzlines;
    + UnicodeString tzurl;
    + UDate lastmod;
    + UnicodeString olsonzid;
    + UnicodeString icutzver;
    +
    +public:
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +};
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // VTZONE_H
    +//eof

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/rebar.config.script
    ----------------------------------------------------------------------
    diff --git a/rebar.config.script b/rebar.config.script
    index ff5ef9b..fb72cdd 100644
    --- a/rebar.config.script
    +++ b/rebar.config.script
    @@ -27,20 +27,64 @@ GetFlag = fun(Name, Args) ->
              end
          end,

    -ICUCFLAGS = GetFlag("ICU_CFLAGS", "--cflags"),
    -ICUCXXFLAGS = GetFlag("ICU_CXXFLAGS", "--cxxflags"),
    -ICULDFLAGS = GetFlag("ICU_LDFLAGS", "--ldflags"),
    -ICUINCPATH = GetFlag("ICU_INCPATH", "--cppflags-searchpath"),
    +GetFlag1 = fun(Name, Default) ->
    + case os:getenv(Name) of
    + false -> Default;
    + Val -> Val
    + end
    + end,
    +
    +BuildStatic = os:getenv("COUCHDB_STATIC") =:= "1" andalso
    + os:getenv("USE_STATIC_ICU") =:= "1",


    -PortEnv = [{port_env, [
    +IsDarwin = case os:type() of
    + {unix, darwin} -> true;
    + _ -> false
    +end,
    +
    +UseSystemIcu = IsDarwin andalso os:getenv("USE_STATIC_ICU") /= "1",
    +
    +PortEnv = case {UseSystemIcu, BuildStatic} of
    + {true, _} ->
    + CFLAGS = GetFlag1("ICU_CFLAGS",
    + "-Iplatform/osx/icu -I/usr/include -fPIC"),
    + LDFLAGS = GetFlag1("ICU_LDFLAGS",
    + "-lpthread -lm -licucore -lstdc++ -L/usr/lib " ++
    + "$DRV_LDFLAGS -fPIC"),
    + [
    + {"CFLAGS", "$DRV_CFLAGS " ++ CFLAGS},
    + {"LDFLAGS", LDFLAGS}
    + ];
    +
    + {_, true} ->
    + CFLAGS = GetFlag("ICU_CFLAGS", "-I.libs/icu/include"),
    + LDFLAGS = GetFlag("ICU_LDFLAGS", "-lstdc++ -fPIC " ++
    + ".libs/icu/lib/libicui18n.a " ++
    + ".libs/icu/lib/libicuuc.a " ++
    + ".libs/icu/lib/libicudata.a"),
    + [
    + {"DRV_CFLAGS", "$DRV_CFLAGS " ++ CFLAGS ++ " -D BSD_SOURCE"},
    + {"DRV_LDFLAGS", "$DRV_LDFLAGS " ++ LDFLAGS}
    + ];
    + {_, false} ->
    + ICUCFLAGS = GetFlag("ICU_CFLAGS", "--cflags"),
    + ICUCXXFLAGS = GetFlag("ICU_CXXFLAGS", "--cxxflags"),
    + ICULDFLAGS = GetFlag("ICU_LDFLAGS", "--ldflags"),
    + ICUINCPATH = GetFlag("ICU_INCPATH", "--cppflags-searchpath"),
    +
    + [
                  {"CFLAGS", ICUCFLAGS ++ " $CFLAGS " ++ ICUINCPATH},
                  {"CXXFLAGS", ICUCXXFLAGS ++ " $CXXFLAGS " ++ ICUINCPATH},
    - {"LDFLAGS", ICULDFLAGS ++ " $LDFLAGS"}]},
    + {"LDFLAGS", ICULDFLAGS ++ " $LDFLAGS"}
    + ]
    +end,

    - {port_specs, [
    - {filename:join(["priv", Arch, "couch_collate.so"]),
    - ["c_src/*.c"]}]}
    -],
    +PortInfo = [{port_env, PortEnv},
    + {port_specs, [
    + {filename:join(["priv", Arch, "couch_collate.so"]),
    + ["c_src/*.c"]}]},
    + {pre_hooks, [{compile, "./build_icu.sh"}]},
    + {post_hooks, [{clean, "./build_icu.sh clean"}]}],

    -lists:keymerge(1,lists:keysort(1, PortEnv), lists:keysort(1, CONFIG)).
    +lists:keymerge(1,lists:keysort(1, PortInfo), lists:keysort(1, CONFIG)).
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/urename.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/urename.h b/platform/osx/icu/unicode/urename.h
    new file mode 100644
    index 0000000..5282958
    --- /dev/null
    +++ b/platform/osx/icu/unicode/urename.h
    @@ -0,0 +1,1775 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2002-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* file name: urename.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* Created by: Perl script written by Vladimir Weinstein
    +*
    +* Contains data for renaming ICU exports.
    +* Gets included by umachine.h
    +*
    +* THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHAT
    +* YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN!
    +*/
    +
    +#ifndef URENAME_H
    +#define URENAME_H
    +
    +/* Uncomment the following line to disable renaming on platforms
    + that do not use Autoconf. */
    +/* #define U_DISABLE_RENAMING 1 */
    +
    +#if !U_DISABLE_RENAMING
    +
    +/* C exports renaming data */
    +
    +#define T_CString_int64ToString T_CString_int64ToString_4_0
    +#define T_CString_integerToString T_CString_integerToString_4_0
    +#define T_CString_stricmp T_CString_stricmp_4_0
    +#define T_CString_stringToInteger T_CString_stringToInteger_4_0
    +#define T_CString_strnicmp T_CString_strnicmp_4_0
    +#define T_CString_toLowerCase T_CString_toLowerCase_4_0
    +#define T_CString_toUpperCase T_CString_toUpperCase_4_0
    +#define UCNV_FROM_U_CALLBACK_ESCAPE UCNV_FROM_U_CALLBACK_ESCAPE_4_0
    +#define UCNV_FROM_U_CALLBACK_SKIP UCNV_FROM_U_CALLBACK_SKIP_4_0
    +#define UCNV_FROM_U_CALLBACK_STOP UCNV_FROM_U_CALLBACK_STOP_4_0
    +#define UCNV_FROM_U_CALLBACK_SUBSTITUTE UCNV_FROM_U_CALLBACK_SUBSTITUTE_4_0
    +#define UCNV_TO_U_CALLBACK_ESCAPE UCNV_TO_U_CALLBACK_ESCAPE_4_0
    +#define UCNV_TO_U_CALLBACK_SKIP UCNV_TO_U_CALLBACK_SKIP_4_0
    +#define UCNV_TO_U_CALLBACK_STOP UCNV_TO_U_CALLBACK_STOP_4_0
    +#define UCNV_TO_U_CALLBACK_SUBSTITUTE UCNV_TO_U_CALLBACK_SUBSTITUTE_4_0
    +#define UDataMemory_createNewInstance UDataMemory_createNewInstance_4_0
    +#define UDataMemory_init UDataMemory_init_4_0
    +#define UDataMemory_isLoaded UDataMemory_isLoaded_4_0
    +#define UDataMemory_normalizeDataPointer UDataMemory_normalizeDataPointer_4_0
    +#define UDataMemory_setData UDataMemory_setData_4_0
    +#define UDatamemory_assign UDatamemory_assign_4_0
    +#define _ASCIIData _ASCIIData_4_0
    +#define _Bocu1Data _Bocu1Data_4_0
    +#define _CESU8Data _CESU8Data_4_0
    +#define _HZData _HZData_4_0
    +#define _IMAPData _IMAPData_4_0
    +#define _ISCIIData _ISCIIData_4_0
    +#define _ISO2022Data _ISO2022Data_4_0
    +#define _LMBCSData1 _LMBCSData1_4_0
    +#define _LMBCSData11 _LMBCSData11_4_0
    +#define _LMBCSData16 _LMBCSData16_4_0
    +#define _LMBCSData17 _LMBCSData17_4_0
    +#define _LMBCSData18 _LMBCSData18_4_0
    +#define _LMBCSData19 _LMBCSData19_4_0
    +#define _LMBCSData2 _LMBCSData2_4_0
    +#define _LMBCSData3 _LMBCSData3_4_0
    +#define _LMBCSData4 _LMBCSData4_4_0
    +#define _LMBCSData5 _LMBCSData5_4_0
    +#define _LMBCSData6 _LMBCSData6_4_0
    +#define _LMBCSData8 _LMBCSData8_4_0
    +#define _Latin1Data _Latin1Data_4_0
    +#define _MBCSData _MBCSData_4_0
    +#define _SCSUData _SCSUData_4_0
    +#define _UTF16BEData _UTF16BEData_4_0
    +#define _UTF16Data _UTF16Data_4_0
    +#define _UTF16LEData _UTF16LEData_4_0
    +#define _UTF32BEData _UTF32BEData_4_0
    +#define _UTF32Data _UTF32Data_4_0
    +#define _UTF32LEData _UTF32LEData_4_0
    +#define _UTF7Data _UTF7Data_4_0
    +#define _UTF8Data _UTF8Data_4_0
    +#define cmemory_cleanup cmemory_cleanup_4_0
    +#define cmemory_inUse cmemory_inUse_4_0
    +#define le_close le_close_4_0
    +#define le_create le_create_4_0
    +#define le_getCharIndices le_getCharIndices_4_0
    +#define le_getCharIndicesWithBase le_getCharIndicesWithBase_4_0
    +#define le_getGlyphCount le_getGlyphCount_4_0
    +#define le_getGlyphPosition le_getGlyphPosition_4_0
    +#define le_getGlyphPositions le_getGlyphPositions_4_0
    +#define le_getGlyphs le_getGlyphs_4_0
    +#define le_layoutChars le_layoutChars_4_0
    +#define le_reset le_reset_4_0
    +#define locale_getKeywords locale_getKeywords_4_0
    +#define locale_get_default locale_get_default_4_0
    +#define locale_set_default locale_set_default_4_0
    +#define pl_addFontRun pl_addFontRun_4_0
    +#define pl_addLocaleRun pl_addLocaleRun_4_0
    +#define pl_addValueRun pl_addValueRun_4_0
    +#define pl_close pl_close_4_0
    +#define pl_closeFontRuns pl_closeFontRuns_4_0
    +#define pl_closeLine pl_closeLine_4_0
    +#define pl_closeLocaleRuns pl_closeLocaleRuns_4_0
    +#define pl_closeValueRuns pl_closeValueRuns_4_0
    +#define pl_countLineRuns pl_countLineRuns_4_0
    +#define pl_create pl_create_4_0
    +#define pl_getAscent pl_getAscent_4_0
    +#define pl_getDescent pl_getDescent_4_0
    +#define pl_getFontRunCount pl_getFontRunCount_4_0
    +#define pl_getFontRunFont pl_getFontRunFont_4_0
    +#define pl_getFontRunLastLimit pl_getFontRunLastLimit_4_0
    +#define pl_getFontRunLimit pl_getFontRunLimit_4_0
    +#define pl_getLeading pl_getLeading_4_0
    +#define pl_getLineAscent pl_getLineAscent_4_0
    +#define pl_getLineDescent pl_getLineDescent_4_0
    +#define pl_getLineLeading pl_getLineLeading_4_0
    +#define pl_getLineVisualRun pl_getLineVisualRun_4_0
    +#define pl_getLineWidth pl_getLineWidth_4_0
    +#define pl_getLocaleRunCount pl_getLocaleRunCount_4_0
    +#define pl_getLocaleRunLastLimit pl_getLocaleRunLastLimit_4_0
    +#define pl_getLocaleRunLimit pl_getLocaleRunLimit_4_0
    +#define pl_getLocaleRunLocale pl_getLocaleRunLocale_4_0
    +#define pl_getParagraphLevel pl_getParagraphLevel_4_0
    +#define pl_getTextDirection pl_getTextDirection_4_0
    +#define pl_getValueRunCount pl_getValueRunCount_4_0
    +#define pl_getValueRunLastLimit pl_getValueRunLastLimit_4_0
    +#define pl_getValueRunLimit pl_getValueRunLimit_4_0
    +#define pl_getValueRunValue pl_getValueRunValue_4_0
    +#define pl_getVisualRunAscent pl_getVisualRunAscent_4_0
    +#define pl_getVisualRunDescent pl_getVisualRunDescent_4_0
    +#define pl_getVisualRunDirection pl_getVisualRunDirection_4_0
    +#define pl_getVisualRunFont pl_getVisualRunFont_4_0
    +#define pl_getVisualRunGlyphCount pl_getVisualRunGlyphCount_4_0
    +#define pl_getVisualRunGlyphToCharMap pl_getVisualRunGlyphToCharMap_4_0
    +#define pl_getVisualRunGlyphs pl_getVisualRunGlyphs_4_0
    +#define pl_getVisualRunLeading pl_getVisualRunLeading_4_0
    +#define pl_getVisualRunPositions pl_getVisualRunPositions_4_0
    +#define pl_isComplex pl_isComplex_4_0
    +#define pl_nextLine pl_nextLine_4_0
    +#define pl_openEmptyFontRuns pl_openEmptyFontRuns_4_0
    +#define pl_openEmptyLocaleRuns pl_openEmptyLocaleRuns_4_0
    +#define pl_openEmptyValueRuns pl_openEmptyValueRuns_4_0
    +#define pl_openFontRuns pl_openFontRuns_4_0
    +#define pl_openLocaleRuns pl_openLocaleRuns_4_0
    +#define pl_openValueRuns pl_openValueRuns_4_0
    +#define pl_reflow pl_reflow_4_0
    +#define pl_resetFontRuns pl_resetFontRuns_4_0
    +#define pl_resetLocaleRuns pl_resetLocaleRuns_4_0
    +#define pl_resetValueRuns pl_resetValueRuns_4_0
    +#define res_countArrayItems res_countArrayItems_4_0
    +#define res_findResource res_findResource_4_0
    +#define res_getAlias res_getAlias_4_0
    +#define res_getArrayItem res_getArrayItem_4_0
    +#define res_getBinary res_getBinary_4_0
    +#define res_getIntVector res_getIntVector_4_0
    +#define res_getResource res_getResource_4_0
    +#define res_getString res_getString_4_0
    +#define res_getTableItemByIndex res_getTableItemByIndex_4_0
    +#define res_getTableItemByKey res_getTableItemByKey_4_0
    +#define res_load res_load_4_0
    +#define res_unload res_unload_4_0
    +#define transliterator_cleanup transliterator_cleanup_4_0
    +#define triedict_swap triedict_swap_4_0
    +#define u_UCharsToChars u_UCharsToChars_4_0
    +#define u_austrcpy u_austrcpy_4_0
    +#define u_austrncpy u_austrncpy_4_0
    +#define u_catclose u_catclose_4_0
    +#define u_catgets u_catgets_4_0
    +#define u_catopen u_catopen_4_0
    +#define u_charAge u_charAge_4_0
    +#define u_charDigitValue u_charDigitValue_4_0
    +#define u_charDirection u_charDirection_4_0
    +#define u_charFromName u_charFromName_4_0
    +#define u_charMirror u_charMirror_4_0
    +#define u_charName u_charName_4_0
    +#define u_charType u_charType_4_0
    +#define u_charsToUChars u_charsToUChars_4_0
    +#define u_cleanup u_cleanup_4_0
    +#define u_countChar32 u_countChar32_4_0
    +#define u_digit u_digit_4_0
    +#define u_enumCharNames u_enumCharNames_4_0
    +#define u_enumCharTypes u_enumCharTypes_4_0
    +#define u_errorName u_errorName_4_0
    +#define u_fclose u_fclose_4_0
    +#define u_feof u_feof_4_0
    +#define u_fflush u_fflush_4_0
    +#define u_fgetConverter u_fgetConverter_4_0
    +#define u_fgetc u_fgetc_4_0
    +#define u_fgetcodepage u_fgetcodepage_4_0
    +#define u_fgetcx u_fgetcx_4_0
    +#define u_fgetfile u_fgetfile_4_0
    +#define u_fgetlocale u_fgetlocale_4_0
    +#define u_fgets u_fgets_4_0
    +#define u_file_read u_file_read_4_0
    +#define u_file_write u_file_write_4_0
    +#define u_file_write_flush u_file_write_flush_4_0
    +#define u_finit u_finit_4_0
    +#define u_foldCase u_foldCase_4_0
    +#define u_fopen u_fopen_4_0
    +#define u_forDigit u_forDigit_4_0
    +#define u_formatMessage u_formatMessage_4_0
    +#define u_formatMessageWithError u_formatMessageWithError_4_0
    +#define u_fprintf u_fprintf_4_0
    +#define u_fprintf_u u_fprintf_u_4_0
    +#define u_fputc u_fputc_4_0
    +#define u_fputs u_fputs_4_0
    +#define u_frewind u_frewind_4_0
    +#define u_fscanf u_fscanf_4_0
    +#define u_fscanf_u u_fscanf_u_4_0
    +#define u_fsetcodepage u_fsetcodepage_4_0
    +#define u_fsetlocale u_fsetlocale_4_0
    +#define u_fsettransliterator u_fsettransliterator_4_0
    +#define u_fstropen u_fstropen_4_0
    +#define u_fungetc u_fungetc_4_0
    +#define u_getCombiningClass u_getCombiningClass_4_0
    +#define u_getDataDirectory u_getDataDirectory_4_0
    +#define u_getDefaultConverter u_getDefaultConverter_4_0
    +#define u_getFC_NFKC_Closure u_getFC_NFKC_Closure_4_0
    +#define u_getISOComment u_getISOComment_4_0
    +#define u_getIntPropertyMaxValue u_getIntPropertyMaxValue_4_0
    +#define u_getIntPropertyMinValue u_getIntPropertyMinValue_4_0
    +#define u_getIntPropertyValue u_getIntPropertyValue_4_0
    +#define u_getNumericValue u_getNumericValue_4_0
    +#define u_getPropertyEnum u_getPropertyEnum_4_0
    +#define u_getPropertyName u_getPropertyName_4_0
    +#define u_getPropertyValueEnum u_getPropertyValueEnum_4_0
    +#define u_getPropertyValueName u_getPropertyValueName_4_0
    +#define u_getUnicodeProperties u_getUnicodeProperties_4_0
    +#define u_getUnicodeVersion u_getUnicodeVersion_4_0
    +#define u_getVersion u_getVersion_4_0
    +#define u_growBufferFromStatic u_growBufferFromStatic_4_0
    +#define u_hasBinaryProperty u_hasBinaryProperty_4_0
    +#define u_init u_init_4_0
    +#define u_isIDIgnorable u_isIDIgnorable_4_0
    +#define u_isIDPart u_isIDPart_4_0
    +#define u_isIDStart u_isIDStart_4_0
    +#define u_isISOControl u_isISOControl_4_0
    +#define u_isJavaIDPart u_isJavaIDPart_4_0
    +#define u_isJavaIDStart u_isJavaIDStart_4_0
    +#define u_isJavaSpaceChar u_isJavaSpaceChar_4_0
    +#define u_isMirrored u_isMirrored_4_0
    +#define u_isUAlphabetic u_isUAlphabetic_4_0
    +#define u_isULowercase u_isULowercase_4_0
    +#define u_isUUppercase u_isUUppercase_4_0
    +#define u_isUWhiteSpace u_isUWhiteSpace_4_0
    +#define u_isWhitespace u_isWhitespace_4_0
    +#define u_isalnum u_isalnum_4_0
    +#define u_isalnumPOSIX u_isalnumPOSIX_4_0
    +#define u_isalpha u_isalpha_4_0
    +#define u_isbase u_isbase_4_0
    +#define u_isblank u_isblank_4_0
    +#define u_iscntrl u_iscntrl_4_0
    +#define u_isdefined u_isdefined_4_0
    +#define u_isdigit u_isdigit_4_0
    +#define u_isgraph u_isgraph_4_0
    +#define u_isgraphPOSIX u_isgraphPOSIX_4_0
    +#define u_islower u_islower_4_0
    +#define u_isprint u_isprint_4_0
    +#define u_isprintPOSIX u_isprintPOSIX_4_0
    +#define u_ispunct u_ispunct_4_0
    +#define u_isspace u_isspace_4_0
    +#define u_istitle u_istitle_4_0
    +#define u_isupper u_isupper_4_0
    +#define u_isxdigit u_isxdigit_4_0
    +#define u_lengthOfIdenticalLevelRun u_lengthOfIdenticalLevelRun_4_0
    +#define u_locbund_close u_locbund_close_4_0
    +#define u_locbund_getNumberFormat u_locbund_getNumberFormat_4_0
    +#define u_locbund_init u_locbund_init_4_0
    +#define u_memcasecmp u_memcasecmp_4_0
    +#define u_memchr u_memchr_4_0
    +#define u_memchr32 u_memchr32_4_0
    +#define u_memcmp u_memcmp_4_0
    +#define u_memcmpCodePointOrder u_memcmpCodePointOrder_4_0
    +#define u_memcpy u_memcpy_4_0
    +#define u_memmove u_memmove_4_0
    +#define u_memrchr u_memrchr_4_0
    +#define u_memrchr32 u_memrchr32_4_0
    +#define u_memset u_memset_4_0
    +#define u_parseMessage u_parseMessage_4_0
    +#define u_parseMessageWithError u_parseMessageWithError_4_0
    +#define u_printf_parse u_printf_parse_4_0
    +#define u_releaseDefaultConverter u_releaseDefaultConverter_4_0
    +#define u_scanf_parse u_scanf_parse_4_0
    +#define u_setAtomicIncDecFunctions u_setAtomicIncDecFunctions_4_0
    +#define u_setDataDirectory u_setDataDirectory_4_0
    +#define u_setMemoryFunctions u_setMemoryFunctions_4_0
    +#define u_setMutexFunctions u_setMutexFunctions_4_0
    +#define u_shapeArabic u_shapeArabic_4_0
    +#define u_snprintf u_snprintf_4_0
    +#define u_snprintf_u u_snprintf_u_4_0
    +#define u_sprintf u_sprintf_4_0
    +#define u_sprintf_u u_sprintf_u_4_0
    +#define u_sscanf u_sscanf_4_0
    +#define u_sscanf_u u_sscanf_u_4_0
    +#define u_strCaseCompare u_strCaseCompare_4_0
    +#define u_strCompare u_strCompare_4_0
    +#define u_strCompareIter u_strCompareIter_4_0
    +#define u_strFindFirst u_strFindFirst_4_0
    +#define u_strFindLast u_strFindLast_4_0
    +#define u_strFoldCase u_strFoldCase_4_0
    +#define u_strFromPunycode u_strFromPunycode_4_0
    +#define u_strFromUTF32 u_strFromUTF32_4_0
    +#define u_strFromUTF8 u_strFromUTF8_4_0
    +#define u_strFromUTF8Lenient u_strFromUTF8Lenient_4_0
    +#define u_strFromUTF8WithSub u_strFromUTF8WithSub_4_0
    +#define u_strFromWCS u_strFromWCS_4_0
    +#define u_strHasMoreChar32Than u_strHasMoreChar32Than_4_0
    +#define u_strToLower u_strToLower_4_0
    +#define u_strToPunycode u_strToPunycode_4_0
    +#define u_strToTitle u_strToTitle_4_0
    +#define u_strToUTF32 u_strToUTF32_4_0
    +#define u_strToUTF8 u_strToUTF8_4_0
    +#define u_strToUTF8WithSub u_strToUTF8WithSub_4_0
    +#define u_strToUpper u_strToUpper_4_0
    +#define u_strToWCS u_strToWCS_4_0
    +#define u_strcasecmp u_strcasecmp_4_0
    +#define u_strcat u_strcat_4_0
    +#define u_strchr u_strchr_4_0
    +#define u_strchr32 u_strchr32_4_0
    +#define u_strcmp u_strcmp_4_0
    +#define u_strcmpCodePointOrder u_strcmpCodePointOrder_4_0
    +#define u_strcmpFold u_strcmpFold_4_0
    +#define u_strcpy u_strcpy_4_0
    +#define u_strcspn u_strcspn_4_0
    +#define u_strlen u_strlen_4_0
    +#define u_strncasecmp u_strncasecmp_4_0
    +#define u_strncat u_strncat_4_0
    +#define u_strncmp u_strncmp_4_0
    +#define u_strncmpCodePointOrder u_strncmpCodePointOrder_4_0
    +#define u_strncpy u_strncpy_4_0
    +#define u_strpbrk u_strpbrk_4_0
    +#define u_strrchr u_strrchr_4_0
    +#define u_strrchr32 u_strrchr32_4_0
    +#define u_strrstr u_strrstr_4_0
    +#define u_strspn u_strspn_4_0
    +#define u_strstr u_strstr_4_0
    +#define u_strtok_r u_strtok_r_4_0
    +#define u_terminateChars u_terminateChars_4_0
    +#define u_terminateUChar32s u_terminateUChar32s_4_0
    +#define u_terminateUChars u_terminateUChars_4_0
    +#define u_terminateWChars u_terminateWChars_4_0
    +#define u_tolower u_tolower_4_0
    +#define u_totitle u_totitle_4_0
    +#define u_toupper u_toupper_4_0
    +#define u_uastrcpy u_uastrcpy_4_0
    +#define u_uastrncpy u_uastrncpy_4_0
    +#define u_unescape u_unescape_4_0
    +#define u_unescapeAt u_unescapeAt_4_0
    +#define u_versionFromString u_versionFromString_4_0
    +#define u_versionToString u_versionToString_4_0
    +#define u_vformatMessage u_vformatMessage_4_0
    +#define u_vformatMessageWithError u_vformatMessageWithError_4_0
    +#define u_vfprintf u_vfprintf_4_0
    +#define u_vfprintf_u u_vfprintf_u_4_0
    +#define u_vfscanf u_vfscanf_4_0
    +#define u_vfscanf_u u_vfscanf_u_4_0
    +#define u_vparseMessage u_vparseMessage_4_0
    +#define u_vparseMessageWithError u_vparseMessageWithError_4_0
    +#define u_vsnprintf u_vsnprintf_4_0
    +#define u_vsnprintf_u u_vsnprintf_u_4_0
    +#define u_vsprintf u_vsprintf_4_0
    +#define u_vsprintf_u u_vsprintf_u_4_0
    +#define u_vsscanf u_vsscanf_4_0
    +#define u_vsscanf_u u_vsscanf_u_4_0
    +#define u_writeDiff u_writeDiff_4_0
    +#define u_writeIdenticalLevelRun u_writeIdenticalLevelRun_4_0
    +#define u_writeIdenticalLevelRunTwoChars u_writeIdenticalLevelRunTwoChars_4_0
    +#define ubidi_addPropertyStarts ubidi_addPropertyStarts_4_0
    +#define ubidi_close ubidi_close_4_0
    +#define ubidi_closeProps ubidi_closeProps_4_0
    +#define ubidi_countParagraphs ubidi_countParagraphs_4_0
    +#define ubidi_countRuns ubidi_countRuns_4_0
    +#define ubidi_getClass ubidi_getClass_4_0
    +#define ubidi_getClassCallback ubidi_getClassCallback_4_0
    +#define ubidi_getCustomizedClass ubidi_getCustomizedClass_4_0
    +#define ubidi_getDirection ubidi_getDirection_4_0
    +#define ubidi_getJoiningGroup ubidi_getJoiningGroup_4_0
    +#define ubidi_getJoiningType ubidi_getJoiningType_4_0
    +#define ubidi_getLength ubidi_getLength_4_0
    +#define ubidi_getLevelAt ubidi_getLevelAt_4_0
    +#define ubidi_getLevels ubidi_getLevels_4_0
    +#define ubidi_getLogicalIndex ubidi_getLogicalIndex_4_0
    +#define ubidi_getLogicalMap ubidi_getLogicalMap_4_0
    +#define ubidi_getLogicalRun ubidi_getLogicalRun_4_0
    +#define ubidi_getMaxValue ubidi_getMaxValue_4_0
    +#define ubidi_getMemory ubidi_getMemory_4_0
    +#define ubidi_getMirror ubidi_getMirror_4_0
    +#define ubidi_getParaLevel ubidi_getParaLevel_4_0
    +#define ubidi_getParagraph ubidi_getParagraph_4_0
    +#define ubidi_getParagraphByIndex ubidi_getParagraphByIndex_4_0
    +#define ubidi_getProcessedLength ubidi_getProcessedLength_4_0
    +#define ubidi_getReorderingMode ubidi_getReorderingMode_4_0
    +#define ubidi_getReorderingOptions ubidi_getReorderingOptions_4_0
    +#define ubidi_getResultLength ubidi_getResultLength_4_0
    +#define ubidi_getRuns ubidi_getRuns_4_0
    +#define ubidi_getSingleton ubidi_getSingleton_4_0
    +#define ubidi_getText ubidi_getText_4_0
    +#define ubidi_getVisualIndex ubidi_getVisualIndex_4_0
    +#define ubidi_getVisualMap ubidi_getVisualMap_4_0
    +#define ubidi_getVisualRun ubidi_getVisualRun_4_0
    +#define ubidi_invertMap ubidi_invertMap_4_0
    +#define ubidi_isBidiControl ubidi_isBidiControl_4_0
    +#define ubidi_isInverse ubidi_isInverse_4_0
    +#define ubidi_isJoinControl ubidi_isJoinControl_4_0
    +#define ubidi_isMirrored ubidi_isMirrored_4_0
    +#define ubidi_isOrderParagraphsLTR ubidi_isOrderParagraphsLTR_4_0
    +#define ubidi_open ubidi_open_4_0
    +#define ubidi_openSized ubidi_openSized_4_0
    +#define ubidi_orderParagraphsLTR ubidi_orderParagraphsLTR_4_0
    +#define ubidi_reorderLogical ubidi_reorderLogical_4_0
    +#define ubidi_reorderVisual ubidi_reorderVisual_4_0
    +#define ubidi_setClassCallback ubidi_setClassCallback_4_0
    +#define ubidi_setInverse ubidi_setInverse_4_0
    +#define ubidi_setLine ubidi_setLine_4_0
    +#define ubidi_setPara ubidi_setPara_4_0
    +#define ubidi_setReorderingMode ubidi_setReorderingMode_4_0
    +#define ubidi_setReorderingOptions ubidi_setReorderingOptions_4_0
    +#define ubidi_writeReordered ubidi_writeReordered_4_0
    +#define ubidi_writeReverse ubidi_writeReverse_4_0
    +#define ublock_getCode ublock_getCode_4_0
    +#define ubrk_close ubrk_close_4_0
    +#define ubrk_countAvailable ubrk_countAvailable_4_0
    +#define ubrk_current ubrk_current_4_0
    +#define ubrk_first ubrk_first_4_0
    +#define ubrk_following ubrk_following_4_0
    +#define ubrk_getAvailable ubrk_getAvailable_4_0
    +#define ubrk_getLocaleByType ubrk_getLocaleByType_4_0
    +#define ubrk_getRuleStatus ubrk_getRuleStatus_4_0
    +#define ubrk_getRuleStatusVec ubrk_getRuleStatusVec_4_0
    +#define ubrk_isBoundary ubrk_isBoundary_4_0
    +#define ubrk_last ubrk_last_4_0
    +#define ubrk_next ubrk_next_4_0
    +#define ubrk_open ubrk_open_4_0
    +#define ubrk_openRules ubrk_openRules_4_0
    +#define ubrk_preceding ubrk_preceding_4_0
    +#define ubrk_previous ubrk_previous_4_0
    +#define ubrk_safeClone ubrk_safeClone_4_0
    +#define ubrk_setText ubrk_setText_4_0
    +#define ubrk_setUText ubrk_setUText_4_0
    +#define ubrk_swap ubrk_swap_4_0
    +#define ucal_add ucal_add_4_0
    +#define ucal_clear ucal_clear_4_0
    +#define ucal_clearField ucal_clearField_4_0
    +#define ucal_clone ucal_clone_4_0
    +#define ucal_close ucal_close_4_0
    +#define ucal_countAvailable ucal_countAvailable_4_0
    +#define ucal_equivalentTo ucal_equivalentTo_4_0
    +#define ucal_get ucal_get_4_0
    +#define ucal_getAttribute ucal_getAttribute_4_0
    +#define ucal_getAvailable ucal_getAvailable_4_0
    +#define ucal_getCanonicalTimeZoneID ucal_getCanonicalTimeZoneID_4_0
    +#define ucal_getDSTSavings ucal_getDSTSavings_4_0
    +#define ucal_getDefaultTimeZone ucal_getDefaultTimeZone_4_0
    +#define ucal_getGregorianChange ucal_getGregorianChange_4_0
    +#define ucal_getLimit ucal_getLimit_4_0
    +#define ucal_getLocaleByType ucal_getLocaleByType_4_0
    +#define ucal_getMillis ucal_getMillis_4_0
    +#define ucal_getNow ucal_getNow_4_0
    +#define ucal_getTZDataVersion ucal_getTZDataVersion_4_0
    +#define ucal_getTimeZoneDisplayName ucal_getTimeZoneDisplayName_4_0
    +#define ucal_inDaylightTime ucal_inDaylightTime_4_0
    +#define ucal_isSet ucal_isSet_4_0
    +#define ucal_open ucal_open_4_0
    +#define ucal_openCountryTimeZones ucal_openCountryTimeZones_4_0
    +#define ucal_openTimeZones ucal_openTimeZones_4_0
    +#define ucal_roll ucal_roll_4_0
    +#define ucal_set ucal_set_4_0
    +#define ucal_setAttribute ucal_setAttribute_4_0
    +#define ucal_setDate ucal_setDate_4_0
    +#define ucal_setDateTime ucal_setDateTime_4_0
    +#define ucal_setDefaultTimeZone ucal_setDefaultTimeZone_4_0
    +#define ucal_setGregorianChange ucal_setGregorianChange_4_0
    +#define ucal_setMillis ucal_setMillis_4_0
    +#define ucal_setTimeZone ucal_setTimeZone_4_0
    +#define ucase_addCaseClosure ucase_addCaseClosure_4_0
    +#define ucase_addPropertyStarts ucase_addPropertyStarts_4_0
    +#define ucase_addStringCaseClosure ucase_addStringCaseClosure_4_0
    +#define ucase_close ucase_close_4_0
    +#define ucase_fold ucase_fold_4_0
    +#define ucase_getCaseLocale ucase_getCaseLocale_4_0
    +#define ucase_getSingleton ucase_getSingleton_4_0
    +#define ucase_getType ucase_getType_4_0
    +#define ucase_getTypeOrIgnorable ucase_getTypeOrIgnorable_4_0
    +#define ucase_hasBinaryProperty ucase_hasBinaryProperty_4_0
    +#define ucase_isCaseSensitive ucase_isCaseSensitive_4_0
    +#define ucase_isSoftDotted ucase_isSoftDotted_4_0
    +#define ucase_toFullFolding ucase_toFullFolding_4_0
    +#define ucase_toFullLower ucase_toFullLower_4_0
    +#define ucase_toFullTitle ucase_toFullTitle_4_0
    +#define ucase_toFullUpper ucase_toFullUpper_4_0
    +#define ucase_tolower ucase_tolower_4_0
    +#define ucase_totitle ucase_totitle_4_0
    +#define ucase_toupper ucase_toupper_4_0
    +#define ucasemap_close ucasemap_close_4_0
    +#define ucasemap_getBreakIterator ucasemap_getBreakIterator_4_0
    +#define ucasemap_getLocale ucasemap_getLocale_4_0
    +#define ucasemap_getOptions ucasemap_getOptions_4_0
    +#define ucasemap_open ucasemap_open_4_0
    +#define ucasemap_setBreakIterator ucasemap_setBreakIterator_4_0
    +#define ucasemap_setLocale ucasemap_setLocale_4_0
    +#define ucasemap_setOptions ucasemap_setOptions_4_0
    +#define ucasemap_toTitle ucasemap_toTitle_4_0
    +#define ucasemap_utf8FoldCase ucasemap_utf8FoldCase_4_0
    +#define ucasemap_utf8ToLower ucasemap_utf8ToLower_4_0
    +#define ucasemap_utf8ToTitle ucasemap_utf8ToTitle_4_0
    +#define ucasemap_utf8ToUpper ucasemap_utf8ToUpper_4_0
    +#define uchar_addPropertyStarts uchar_addPropertyStarts_4_0
    +#define uchar_getHST uchar_getHST_4_0
    +#define uchar_swapNames uchar_swapNames_4_0
    +#define ucln_common_registerCleanup ucln_common_registerCleanup_4_0
    +#define ucln_i18n_registerCleanup ucln_i18n_registerCleanup_4_0
    +#define ucln_io_registerCleanup ucln_io_registerCleanup_4_0
    +#define ucln_lib_cleanup ucln_lib_cleanup_4_0
    +#define ucln_registerCleanup ucln_registerCleanup_4_0
    +#define ucnv_MBCSFromUChar32 ucnv_MBCSFromUChar32_4_0
    +#define ucnv_MBCSFromUnicodeWithOffsets ucnv_MBCSFromUnicodeWithOffsets_4_0
    +#define ucnv_MBCSGetFilteredUnicodeSetForUnicode ucnv_MBCSGetFilteredUnicodeSetForUnicode_4_0
    +#define ucnv_MBCSGetType ucnv_MBCSGetType_4_0
    +#define ucnv_MBCSGetUnicodeSetForUnicode ucnv_MBCSGetUnicodeSetForUnicode_4_0
    +#define ucnv_MBCSIsLeadByte ucnv_MBCSIsLeadByte_4_0
    +#define ucnv_MBCSSimpleGetNextUChar ucnv_MBCSSimpleGetNextUChar_4_0
    +#define ucnv_MBCSToUnicodeWithOffsets ucnv_MBCSToUnicodeWithOffsets_4_0
    +#define ucnv_bld_countAvailableConverters ucnv_bld_countAvailableConverters_4_0
    +#define ucnv_bld_getAvailableConverter ucnv_bld_getAvailableConverter_4_0
    +#define ucnv_cbFromUWriteBytes ucnv_cbFromUWriteBytes_4_0
    +#define ucnv_cbFromUWriteSub ucnv_cbFromUWriteSub_4_0
    +#define ucnv_cbFromUWriteUChars ucnv_cbFromUWriteUChars_4_0
    +#define ucnv_cbToUWriteSub ucnv_cbToUWriteSub_4_0
    +#define ucnv_cbToUWriteUChars ucnv_cbToUWriteUChars_4_0
    +#define ucnv_close ucnv_close_4_0
    +#define ucnv_compareNames ucnv_compareNames_4_0
    +#define ucnv_convert ucnv_convert_4_0
    +#define ucnv_convertEx ucnv_convertEx_4_0
    +#define ucnv_countAliases ucnv_countAliases_4_0
    +#define ucnv_countAvailable ucnv_countAvailable_4_0
    +#define ucnv_countStandards ucnv_countStandards_4_0
    +#define ucnv_createAlgorithmicConverter ucnv_createAlgorithmicConverter_4_0
    +#define ucnv_createConverter ucnv_createConverter_4_0
    +#define ucnv_createConverterFromPackage ucnv_createConverterFromPackage_4_0
    +#define ucnv_createConverterFromSharedData ucnv_createConverterFromSharedData_4_0
    +#define ucnv_detectUnicodeSignature ucnv_detectUnicodeSignature_4_0
    +#define ucnv_extContinueMatchFromU ucnv_extContinueMatchFromU_4_0
    +#define ucnv_extContinueMatchToU ucnv_extContinueMatchToU_4_0
    +#define ucnv_extGetUnicodeSet ucnv_extGetUnicodeSet_4_0
    +#define ucnv_extInitialMatchFromU ucnv_extInitialMatchFromU_4_0
    +#define ucnv_extInitialMatchToU ucnv_extInitialMatchToU_4_0
    +#define ucnv_extSimpleMatchFromU ucnv_extSimpleMatchFromU_4_0
    +#define ucnv_extSimpleMatchToU ucnv_extSimpleMatchToU_4_0
    +#define ucnv_fixFileSeparator ucnv_fixFileSeparator_4_0
    +#define ucnv_flushCache ucnv_flushCache_4_0
    +#define ucnv_fromAlgorithmic ucnv_fromAlgorithmic_4_0
    +#define ucnv_fromUChars ucnv_fromUChars_4_0
    +#define ucnv_fromUCountPending ucnv_fromUCountPending_4_0
    +#define ucnv_fromUWriteBytes ucnv_fromUWriteBytes_4_0
    +#define ucnv_fromUnicode ucnv_fromUnicode_4_0
    +#define ucnv_fromUnicode_UTF8 ucnv_fromUnicode_UTF8_4_0
    +#define ucnv_fromUnicode_UTF8_OFFSETS_LOGIC ucnv_fromUnicode_UTF8_OFFSETS_LOGIC_4_0
    +#define ucnv_getAlias ucnv_getAlias_4_0
    +#define ucnv_getAliases ucnv_getAliases_4_0
    +#define ucnv_getAvailableName ucnv_getAvailableName_4_0
    +#define ucnv_getCCSID ucnv_getCCSID_4_0
    +#define ucnv_getCanonicalName ucnv_getCanonicalName_4_0
    +#define ucnv_getCompleteUnicodeSet ucnv_getCompleteUnicodeSet_4_0
    +#define ucnv_getDefaultName ucnv_getDefaultName_4_0
    +#define ucnv_getDisplayName ucnv_getDisplayName_4_0
    +#define ucnv_getFromUCallBack ucnv_getFromUCallBack_4_0
    +#define ucnv_getInvalidChars ucnv_getInvalidChars_4_0
    +#define ucnv_getInvalidUChars ucnv_getInvalidUChars_4_0
    +#define ucnv_getMaxCharSize ucnv_getMaxCharSize_4_0
    +#define ucnv_getMinCharSize ucnv_getMinCharSize_4_0
    +#define ucnv_getName ucnv_getName_4_0
    +#define ucnv_getNextUChar ucnv_getNextUChar_4_0
    +#define ucnv_getNonSurrogateUnicodeSet ucnv_getNonSurrogateUnicodeSet_4_0
    +#define ucnv_getPlatform ucnv_getPlatform_4_0
    +#define ucnv_getStandard ucnv_getStandard_4_0
    +#define ucnv_getStandardName ucnv_getStandardName_4_0
    +#define ucnv_getStarters ucnv_getStarters_4_0
    +#define ucnv_getSubstChars ucnv_getSubstChars_4_0
    +#define ucnv_getToUCallBack ucnv_getToUCallBack_4_0
    +#define ucnv_getType ucnv_getType_4_0
    +#define ucnv_getUnicodeSet ucnv_getUnicodeSet_4_0
    +#define ucnv_incrementRefCount ucnv_incrementRefCount_4_0
    +#define ucnv_io_countKnownConverters ucnv_io_countKnownConverters_4_0
    +#define ucnv_io_getConverterName ucnv_io_getConverterName_4_0
    +#define ucnv_io_stripASCIIForCompare ucnv_io_stripASCIIForCompare_4_0
    +#define ucnv_io_stripEBCDICForCompare ucnv_io_stripEBCDICForCompare_4_0
    +#define ucnv_isAmbiguous ucnv_isAmbiguous_4_0
    +#define ucnv_load ucnv_load_4_0
    +#define ucnv_loadSharedData ucnv_loadSharedData_4_0
    +#define ucnv_open ucnv_open_4_0
    +#define ucnv_openAllNames ucnv_openAllNames_4_0
    +#define ucnv_openCCSID ucnv_openCCSID_4_0
    +#define ucnv_openPackage ucnv_openPackage_4_0
    +#define ucnv_openStandardNames ucnv_openStandardNames_4_0
    +#define ucnv_openU ucnv_openU_4_0
    +#define ucnv_reset ucnv_reset_4_0
    +#define ucnv_resetFromUnicode ucnv_resetFromUnicode_4_0
    +#define ucnv_resetToUnicode ucnv_resetToUnicode_4_0
    +#define ucnv_safeClone ucnv_safeClone_4_0
    +#define ucnv_setDefaultName ucnv_setDefaultName_4_0
    +#define ucnv_setFallback ucnv_setFallback_4_0
    +#define ucnv_setFromUCallBack ucnv_setFromUCallBack_4_0
    +#define ucnv_setSubstChars ucnv_setSubstChars_4_0
    +#define ucnv_setSubstString ucnv_setSubstString_4_0
    +#define ucnv_setToUCallBack ucnv_setToUCallBack_4_0
    +#define ucnv_swap ucnv_swap_4_0
    +#define ucnv_swapAliases ucnv_swapAliases_4_0
    +#define ucnv_toAlgorithmic ucnv_toAlgorithmic_4_0
    +#define ucnv_toUChars ucnv_toUChars_4_0
    +#define ucnv_toUCountPending ucnv_toUCountPending_4_0
    +#define ucnv_toUWriteCodePoint ucnv_toUWriteCodePoint_4_0
    +#define ucnv_toUWriteUChars ucnv_toUWriteUChars_4_0
    +#define ucnv_toUnicode ucnv_toUnicode_4_0
    +#define ucnv_unload ucnv_unload_4_0
    +#define ucnv_unloadSharedDataIfReady ucnv_unloadSharedDataIfReady_4_0
    +#define ucnv_usesFallback ucnv_usesFallback_4_0
    +#define ucol_allocWeights ucol_allocWeights_4_0
    +#define ucol_assembleTailoringTable ucol_assembleTailoringTable_4_0
    +#define ucol_calcSortKey ucol_calcSortKey_4_0
    +#define ucol_calcSortKeySimpleTertiary ucol_calcSortKeySimpleTertiary_4_0
    +#define ucol_cloneBinary ucol_cloneBinary_4_0
    +#define ucol_cloneRuleData ucol_cloneRuleData_4_0
    +#define ucol_close ucol_close_4_0
    +#define ucol_closeElements ucol_closeElements_4_0
    +#define ucol_countAvailable ucol_countAvailable_4_0
    +#define ucol_createElements ucol_createElements_4_0
    +#define ucol_doCE ucol_doCE_4_0
    +#define ucol_equal ucol_equal_4_0
    +#define ucol_equals ucol_equals_4_0
    +#define ucol_forgetUCA ucol_forgetUCA_4_0
    +#define ucol_getAttribute ucol_getAttribute_4_0
    +#define ucol_getAttributeOrDefault ucol_getAttributeOrDefault_4_0
    +#define ucol_getAvailable ucol_getAvailable_4_0
    +#define ucol_getBound ucol_getBound_4_0
    +#define ucol_getCEStrengthDifference ucol_getCEStrengthDifference_4_0
    +#define ucol_getContractions ucol_getContractions_4_0
    +#define ucol_getContractionsAndExpansions ucol_getContractionsAndExpansions_4_0
    +#define ucol_getDisplayName ucol_getDisplayName_4_0
    +#define ucol_getFirstCE ucol_getFirstCE_4_0
    +#define ucol_getFunctionalEquivalent ucol_getFunctionalEquivalent_4_0
    +#define ucol_getKeywordValues ucol_getKeywordValues_4_0
    +#define ucol_getKeywords ucol_getKeywords_4_0
    +#define ucol_getLocale ucol_getLocale_4_0
    +#define ucol_getLocaleByType ucol_getLocaleByType_4_0
    +#define ucol_getMaxExpansion ucol_getMaxExpansion_4_0
    +#define ucol_getNextCE ucol_getNextCE_4_0
    +#define ucol_getOffset ucol_getOffset_4_0
    +#define ucol_getPrevCE ucol_getPrevCE_4_0
    +#define ucol_getRules ucol_getRules_4_0
    +#define ucol_getRulesEx ucol_getRulesEx_4_0
    +#define ucol_getShortDefinitionString ucol_getShortDefinitionString_4_0
    +#define ucol_getSortKey ucol_getSortKey_4_0
    +#define ucol_getSortKeySize ucol_getSortKeySize_4_0
    +#define ucol_getSortKeyWithAllocation ucol_getSortKeyWithAllocation_4_0
    +#define ucol_getStrength ucol_getStrength_4_0
    +#define ucol_getTailoredSet ucol_getTailoredSet_4_0
    +#define ucol_getUCAVersion ucol_getUCAVersion_4_0
    +#define ucol_getUnsafeSet ucol_getUnsafeSet_4_0
    +#define ucol_getVariableTop ucol_getVariableTop_4_0
    +#define ucol_getVersion ucol_getVersion_4_0
    +#define ucol_greater ucol_greater_4_0
    +#define ucol_greaterOrEqual ucol_greaterOrEqual_4_0
    +#define ucol_initBuffers ucol_initBuffers_4_0
    +#define ucol_initCollator ucol_initCollator_4_0
    +#define ucol_initInverseUCA ucol_initInverseUCA_4_0
    +#define ucol_initUCA ucol_initUCA_4_0
    +#define ucol_inv_getNextCE ucol_inv_getNextCE_4_0
    +#define ucol_inv_getPrevCE ucol_inv_getPrevCE_4_0
    +#define ucol_isTailored ucol_isTailored_4_0
    +#define ucol_keyHashCode ucol_keyHashCode_4_0
    +#define ucol_mergeSortkeys ucol_mergeSortkeys_4_0
    +#define ucol_next ucol_next_4_0
    +#define ucol_nextProcessed ucol_nextProcessed_4_0
    +#define ucol_nextSortKeyPart ucol_nextSortKeyPart_4_0
    +#define ucol_nextWeight ucol_nextWeight_4_0
    +#define ucol_normalizeShortDefinitionString ucol_normalizeShortDefinitionString_4_0
    +#define ucol_open ucol_open_4_0
    +#define ucol_openAvailableLocales ucol_openAvailableLocales_4_0
    +#define ucol_openBinary ucol_openBinary_4_0
    +#define ucol_openElements ucol_openElements_4_0
    +#define ucol_openFromShortString ucol_openFromShortString_4_0
    +#define ucol_openRules ucol_openRules_4_0
    +#define ucol_open_internal ucol_open_internal_4_0
    +#define ucol_prepareShortStringOpen ucol_prepareShortStringOpen_4_0
    +#define ucol_previous ucol_previous_4_0
    +#define ucol_previousProcessed ucol_previousProcessed_4_0
    +#define ucol_primaryOrder ucol_primaryOrder_4_0
    +#define ucol_prv_getSpecialCE ucol_prv_getSpecialCE_4_0
    +#define ucol_prv_getSpecialPrevCE ucol_prv_getSpecialPrevCE_4_0
    +#define ucol_reset ucol_reset_4_0
    +#define ucol_restoreVariableTop ucol_restoreVariableTop_4_0
    +#define ucol_safeClone ucol_safeClone_4_0
    +#define ucol_secondaryOrder ucol_secondaryOrder_4_0
    +#define ucol_setAttribute ucol_setAttribute_4_0
    +#define ucol_setOffset ucol_setOffset_4_0
    +#define ucol_setOptionsFromHeader ucol_setOptionsFromHeader_4_0
    +#define ucol_setReqValidLocales ucol_setReqValidLocales_4_0
    +#define ucol_setStrength ucol_setStrength_4_0
    +#define ucol_setText ucol_setText_4_0
    +#define ucol_setVariableTop ucol_setVariableTop_4_0
    +#define ucol_strcoll ucol_strcoll_4_0
    +#define ucol_strcollIter ucol_strcollIter_4_0
    +#define ucol_swap ucol_swap_4_0
    +#define ucol_swapBinary ucol_swapBinary_4_0
    +#define ucol_swapInverseUCA ucol_swapInverseUCA_4_0
    +#define ucol_tertiaryOrder ucol_tertiaryOrder_4_0
    +#define ucol_tok_assembleTokenList ucol_tok_assembleTokenList_4_0
    +#define ucol_tok_closeTokenList ucol_tok_closeTokenList_4_0
    +#define ucol_tok_getNextArgument ucol_tok_getNextArgument_4_0
    +#define ucol_tok_initTokenList ucol_tok_initTokenList_4_0
    +#define ucol_tok_parseNextToken ucol_tok_parseNextToken_4_0
    +#define ucol_updateInternalState ucol_updateInternalState_4_0
    +#define ucsdet_close ucsdet_close_4_0
    +#define ucsdet_detect ucsdet_detect_4_0
    +#define ucsdet_detectAll ucsdet_detectAll_4_0
    +#define ucsdet_enableInputFilter ucsdet_enableInputFilter_4_0
    +#define ucsdet_getAllDetectableCharsets ucsdet_getAllDetectableCharsets_4_0
    +#define ucsdet_getConfidence ucsdet_getConfidence_4_0
    +#define ucsdet_getLanguage ucsdet_getLanguage_4_0
    +#define ucsdet_getName ucsdet_getName_4_0
    +#define ucsdet_getUChars ucsdet_getUChars_4_0
    +#define ucsdet_isInputFilterEnabled ucsdet_isInputFilterEnabled_4_0
    +#define ucsdet_open ucsdet_open_4_0
    +#define ucsdet_setDeclaredEncoding ucsdet_setDeclaredEncoding_4_0
    +#define ucsdet_setText ucsdet_setText_4_0
    +#define ucurr_countCurrencies ucurr_countCurrencies_4_0
    +#define ucurr_forLocale ucurr_forLocale_4_0
    +#define ucurr_forLocaleAndDate ucurr_forLocaleAndDate_4_0
    +#define ucurr_getDefaultFractionDigits ucurr_getDefaultFractionDigits_4_0
    +#define ucurr_getName ucurr_getName_4_0
    +#define ucurr_getRoundingIncrement ucurr_getRoundingIncrement_4_0
    +#define ucurr_openISOCurrencies ucurr_openISOCurrencies_4_0
    +#define ucurr_register ucurr_register_4_0
    +#define ucurr_unregister ucurr_unregister_4_0
    +#define udat_applyPattern udat_applyPattern_4_0
    +#define udat_clone udat_clone_4_0
    +#define udat_close udat_close_4_0
    +#define udat_countAvailable udat_countAvailable_4_0
    +#define udat_countSymbols udat_countSymbols_4_0
    +#define udat_format udat_format_4_0
    +#define udat_get2DigitYearStart udat_get2DigitYearStart_4_0
    +#define udat_getAvailable udat_getAvailable_4_0
    +#define udat_getCalendar udat_getCalendar_4_0
    +#define udat_getLocaleByType udat_getLocaleByType_4_0
    +#define udat_getNumberFormat udat_getNumberFormat_4_0
    +#define udat_getSymbols udat_getSymbols_4_0
    +#define udat_isLenient udat_isLenient_4_0
    +#define udat_open udat_open_4_0
    +#define udat_parse udat_parse_4_0
    +#define udat_parseCalendar udat_parseCalendar_4_0
    +#define udat_set2DigitYearStart udat_set2DigitYearStart_4_0
    +#define udat_setCalendar udat_setCalendar_4_0
    +#define udat_setLenient udat_setLenient_4_0
    +#define udat_setNumberFormat udat_setNumberFormat_4_0
    +#define udat_setSymbols udat_setSymbols_4_0
    +#define udat_toPattern udat_toPattern_4_0
    +#define udata_checkCommonData udata_checkCommonData_4_0
    +#define udata_close udata_close_4_0
    +#define udata_closeSwapper udata_closeSwapper_4_0
    +#define udata_getHeaderSize udata_getHeaderSize_4_0
    +#define udata_getInfo udata_getInfo_4_0
    +#define udata_getInfoSize udata_getInfoSize_4_0
    +#define udata_getLength udata_getLength_4_0
    +#define udata_getMemory udata_getMemory_4_0
    +#define udata_getRawMemory udata_getRawMemory_4_0
    +#define udata_open udata_open_4_0
    +#define udata_openChoice udata_openChoice_4_0
    +#define udata_openSwapper udata_openSwapper_4_0
    +#define udata_openSwapperForInputData udata_openSwapperForInputData_4_0
    +#define udata_printError udata_printError_4_0
    +#define udata_readInt16 udata_readInt16_4_0
    +#define udata_readInt32 udata_readInt32_4_0
    +#define udata_setAppData udata_setAppData_4_0
    +#define udata_setCommonData udata_setCommonData_4_0
    +#define udata_setFileAccess udata_setFileAccess_4_0
    +#define udata_swapDataHeader udata_swapDataHeader_4_0
    +#define udata_swapInvStringBlock udata_swapInvStringBlock_4_0
    +#define udatpg_addPattern udatpg_addPattern_4_0
    +#define udatpg_clone udatpg_clone_4_0
    +#define udatpg_close udatpg_close_4_0
    +#define udatpg_getAppendItemFormat udatpg_getAppendItemFormat_4_0
    +#define udatpg_getAppendItemName udatpg_getAppendItemName_4_0
    +#define udatpg_getBaseSkeleton udatpg_getBaseSkeleton_4_0
    +#define udatpg_getBestPattern udatpg_getBestPattern_4_0
    +#define udatpg_getDateTimeFormat udatpg_getDateTimeFormat_4_0
    +#define udatpg_getDecimal udatpg_getDecimal_4_0
    +#define udatpg_getPatternForSkeleton udatpg_getPatternForSkeleton_4_0
    +#define udatpg_getSkeleton udatpg_getSkeleton_4_0
    +#define udatpg_open udatpg_open_4_0
    +#define udatpg_openBaseSkeletons udatpg_openBaseSkeletons_4_0
    +#define udatpg_openEmpty udatpg_openEmpty_4_0
    +#define udatpg_openSkeletons udatpg_openSkeletons_4_0
    +#define udatpg_replaceFieldTypes udatpg_replaceFieldTypes_4_0
    +#define udatpg_setAppendItemFormat udatpg_setAppendItemFormat_4_0
    +#define udatpg_setAppendItemName udatpg_setAppendItemName_4_0
    +#define udatpg_setDateTimeFormat udatpg_setDateTimeFormat_4_0
    +#define udatpg_setDecimal udatpg_setDecimal_4_0
    +#define uenum_close uenum_close_4_0
    +#define uenum_count uenum_count_4_0
    +#define uenum_next uenum_next_4_0
    +#define uenum_nextDefault uenum_nextDefault_4_0
    +#define uenum_openCharStringsEnumeration uenum_openCharStringsEnumeration_4_0
    +#define uenum_openStringEnumeration uenum_openStringEnumeration_4_0
    +#define uenum_reset uenum_reset_4_0
    +#define uenum_unext uenum_unext_4_0
    +#define uenum_unextDefault uenum_unextDefault_4_0
    +#define ufile_close_translit ufile_close_translit_4_0
    +#define ufile_fill_uchar_buffer ufile_fill_uchar_buffer_4_0
    +#define ufile_flush_translit ufile_flush_translit_4_0
    +#define ufile_getch ufile_getch_4_0
    +#define ufile_getch32 ufile_getch32_4_0
    +#define ufmt_64tou ufmt_64tou_4_0
    +#define ufmt_defaultCPToUnicode ufmt_defaultCPToUnicode_4_0
    +#define ufmt_digitvalue ufmt_digitvalue_4_0
    +#define ufmt_isdigit ufmt_isdigit_4_0
    +#define ufmt_ptou ufmt_ptou_4_0
    +#define ufmt_uto64 ufmt_uto64_4_0
    +#define ufmt_utop ufmt_utop_4_0
    +#define uhash_close uhash_close_4_0
    +#define uhash_compareCaselessUnicodeString uhash_compareCaselessUnicodeString_4_0
    +#define uhash_compareChars uhash_compareChars_4_0
    +#define uhash_compareIChars uhash_compareIChars_4_0
    +#define uhash_compareLong uhash_compareLong_4_0
    +#define uhash_compareUChars uhash_compareUChars_4_0
    +#define uhash_compareUnicodeString uhash_compareUnicodeString_4_0
    +#define uhash_count uhash_count_4_0
    +#define uhash_deleteHashtable uhash_deleteHashtable_4_0
    +#define uhash_deleteUVector uhash_deleteUVector_4_0
    +#define uhash_deleteUnicodeString uhash_deleteUnicodeString_4_0
    +#define uhash_equals uhash_equals_4_0
    +#define uhash_find uhash_find_4_0
    +#define uhash_freeBlock uhash_freeBlock_4_0
    +#define uhash_get uhash_get_4_0
    +#define uhash_geti uhash_geti_4_0
    +#define uhash_hashCaselessUnicodeString uhash_hashCaselessUnicodeString_4_0
    +#define uhash_hashChars uhash_hashChars_4_0
    +#define uhash_hashIChars uhash_hashIChars_4_0
    +#define uhash_hashLong uhash_hashLong_4_0
    +#define uhash_hashUChars uhash_hashUChars_4_0
    +#define uhash_hashUCharsN uhash_hashUCharsN_4_0
    +#define uhash_hashUnicodeString uhash_hashUnicodeString_4_0
    +#define uhash_iget uhash_iget_4_0
    +#define uhash_igeti uhash_igeti_4_0
    +#define uhash_init uhash_init_4_0
    +#define uhash_iput uhash_iput_4_0
    +#define uhash_iputi uhash_iputi_4_0
    +#define uhash_iremove uhash_iremove_4_0
    +#define uhash_iremovei uhash_iremovei_4_0
    +#define uhash_nextElement uhash_nextElement_4_0
    +#define uhash_open uhash_open_4_0
    +#define uhash_openSize uhash_openSize_4_0
    +#define uhash_put uhash_put_4_0
    +#define uhash_puti uhash_puti_4_0
    +#define uhash_remove uhash_remove_4_0
    +#define uhash_removeAll uhash_removeAll_4_0
    +#define uhash_removeElement uhash_removeElement_4_0
    +#define uhash_removei uhash_removei_4_0
    +#define uhash_setKeyComparator uhash_setKeyComparator_4_0
    +#define uhash_setKeyDeleter uhash_setKeyDeleter_4_0
    +#define uhash_setKeyHasher uhash_setKeyHasher_4_0
    +#define uhash_setResizePolicy uhash_setResizePolicy_4_0
    +#define uhash_setValueComparator uhash_setValueComparator_4_0
    +#define uhash_setValueDeleter uhash_setValueDeleter_4_0
    +#define uhst_addPropertyStarts uhst_addPropertyStarts_4_0
    +#define uidna_IDNToASCII uidna_IDNToASCII_4_0
    +#define uidna_IDNToUnicode uidna_IDNToUnicode_4_0
    +#define uidna_compare uidna_compare_4_0
    +#define uidna_toASCII uidna_toASCII_4_0
    +#define uidna_toUnicode uidna_toUnicode_4_0
    +#define uiter_current32 uiter_current32_4_0
    +#define uiter_getState uiter_getState_4_0
    +#define uiter_next32 uiter_next32_4_0
    +#define uiter_previous32 uiter_previous32_4_0
    +#define uiter_setCharacterIterator uiter_setCharacterIterator_4_0
    +#define uiter_setReplaceable uiter_setReplaceable_4_0
    +#define uiter_setState uiter_setState_4_0
    +#define uiter_setString uiter_setString_4_0
    +#define uiter_setUTF16BE uiter_setUTF16BE_4_0
    +#define uiter_setUTF8 uiter_setUTF8_4_0
    +#define uloc_acceptLanguage uloc_acceptLanguage_4_0
    +#define uloc_acceptLanguageFromHTTP uloc_acceptLanguageFromHTTP_4_0
    +#define uloc_addLikelySubtags uloc_addLikelySubtags_4_0
    +#define uloc_canonicalize uloc_canonicalize_4_0
    +#define uloc_countAvailable uloc_countAvailable_4_0
    +#define uloc_getAvailable uloc_getAvailable_4_0
    +#define uloc_getBaseName uloc_getBaseName_4_0
    +#define uloc_getCharacterOrientation uloc_getCharacterOrientation_4_0
    +#define uloc_getCountry uloc_getCountry_4_0
    +#define uloc_getDefault uloc_getDefault_4_0
    +#define uloc_getDisplayCountry uloc_getDisplayCountry_4_0
    +#define uloc_getDisplayKeyword uloc_getDisplayKeyword_4_0
    +#define uloc_getDisplayKeywordValue uloc_getDisplayKeywordValue_4_0
    +#define uloc_getDisplayLanguage uloc_getDisplayLanguage_4_0
    +#define uloc_getDisplayName uloc_getDisplayName_4_0
    +#define uloc_getDisplayScript uloc_getDisplayScript_4_0
    +#define uloc_getDisplayVariant uloc_getDisplayVariant_4_0
    +#define uloc_getISO3Country uloc_getISO3Country_4_0
    +#define uloc_getISO3Language uloc_getISO3Language_4_0
    +#define uloc_getISOCountries uloc_getISOCountries_4_0
    +#define uloc_getISOLanguages uloc_getISOLanguages_4_0
    +#define uloc_getKeywordValue uloc_getKeywordValue_4_0
    +#define uloc_getLCID uloc_getLCID_4_0
    +#define uloc_getLanguage uloc_getLanguage_4_0
    +#define uloc_getLineOrientation uloc_getLineOrientation_4_0
    +#define uloc_getLocaleForLCID uloc_getLocaleForLCID_4_0
    +#define uloc_getName uloc_getName_4_0
    +#define uloc_getParent uloc_getParent_4_0
    +#define uloc_getScript uloc_getScript_4_0
    +#define uloc_getVariant uloc_getVariant_4_0
    +#define uloc_minimizeSubtags uloc_minimizeSubtags_4_0
    +#define uloc_openKeywordList uloc_openKeywordList_4_0
    +#define uloc_openKeywords uloc_openKeywords_4_0
    +#define uloc_setDefault uloc_setDefault_4_0
    +#define uloc_setKeywordValue uloc_setKeywordValue_4_0
    +#define ulocdata_close ulocdata_close_4_0
    +#define ulocdata_getDelimiter ulocdata_getDelimiter_4_0
    +#define ulocdata_getExemplarSet ulocdata_getExemplarSet_4_0
    +#define ulocdata_getMeasurementSystem ulocdata_getMeasurementSystem_4_0
    +#define ulocdata_getNoSubstitute ulocdata_getNoSubstitute_4_0
    +#define ulocdata_getPaperSize ulocdata_getPaperSize_4_0
    +#define ulocdata_open ulocdata_open_4_0
    +#define ulocdata_setNoSubstitute ulocdata_setNoSubstitute_4_0
    +#define umsg_applyPattern umsg_applyPattern_4_0
    +#define umsg_autoQuoteApostrophe umsg_autoQuoteApostrophe_4_0
    +#define umsg_clone umsg_clone_4_0
    +#define umsg_close umsg_close_4_0
    +#define umsg_format umsg_format_4_0
    +#define umsg_getLocale umsg_getLocale_4_0
    +#define umsg_open umsg_open_4_0
    +#define umsg_parse umsg_parse_4_0
    +#define umsg_setLocale umsg_setLocale_4_0
    +#define umsg_toPattern umsg_toPattern_4_0
    +#define umsg_vformat umsg_vformat_4_0
    +#define umsg_vparse umsg_vparse_4_0
    +#define umtx_atomic_dec umtx_atomic_dec_4_0
    +#define umtx_atomic_inc umtx_atomic_inc_4_0
    +#define umtx_cleanup umtx_cleanup_4_0
    +#define umtx_destroy umtx_destroy_4_0
    +#define umtx_init umtx_init_4_0
    +#define umtx_lock umtx_lock_4_0
    +#define umtx_unlock umtx_unlock_4_0
    +#define unorm_addPropertyStarts unorm_addPropertyStarts_4_0
    +#define unorm_closeIter unorm_closeIter_4_0
    +#define unorm_compare unorm_compare_4_0
    +#define unorm_compose unorm_compose_4_0
    +#define unorm_concatenate unorm_concatenate_4_0
    +#define unorm_decompose unorm_decompose_4_0
    +#define unorm_getCanonStartSet unorm_getCanonStartSet_4_0
    +#define unorm_getCanonicalDecomposition unorm_getCanonicalDecomposition_4_0
    +#define unorm_getDecomposition unorm_getDecomposition_4_0
    +#define unorm_getFCD16FromCodePoint unorm_getFCD16FromCodePoint_4_0
    +#define unorm_getFCDTrie unorm_getFCDTrie_4_0
    +#define unorm_getNX unorm_getNX_4_0
    +#define unorm_getQuickCheck unorm_getQuickCheck_4_0
    +#define unorm_getUnicodeVersion unorm_getUnicodeVersion_4_0
    +#define unorm_haveData unorm_haveData_4_0
    +#define unorm_internalIsFullCompositionExclusion unorm_internalIsFullCompositionExclusion_4_0
    +#define unorm_internalNormalize unorm_internalNormalize_4_0
    +#define unorm_internalNormalizeWithNX unorm_internalNormalizeWithNX_4_0
    +#define unorm_internalQuickCheck unorm_internalQuickCheck_4_0
    +#define unorm_isCanonSafeStart unorm_isCanonSafeStart_4_0
    +#define unorm_isNFSkippable unorm_isNFSkippable_4_0
    +#define unorm_isNormalized unorm_isNormalized_4_0
    +#define unorm_isNormalizedWithOptions unorm_isNormalizedWithOptions_4_0
    +#define unorm_next unorm_next_4_0
    +#define unorm_normalize unorm_normalize_4_0
    +#define unorm_openIter unorm_openIter_4_0
    +#define unorm_previous unorm_previous_4_0
    +#define unorm_quickCheck unorm_quickCheck_4_0
    +#define unorm_quickCheckWithOptions unorm_quickCheckWithOptions_4_0
    +#define unorm_setIter unorm_setIter_4_0
    +#define unum_applyPattern unum_applyPattern_4_0
    +#define unum_clone unum_clone_4_0
    +#define unum_close unum_close_4_0
    +#define unum_countAvailable unum_countAvailable_4_0
    +#define unum_format unum_format_4_0
    +#define unum_formatDouble unum_formatDouble_4_0
    +#define unum_formatDoubleCurrency unum_formatDoubleCurrency_4_0
    +#define unum_formatInt64 unum_formatInt64_4_0
    +#define unum_getAttribute unum_getAttribute_4_0
    +#define unum_getAvailable unum_getAvailable_4_0
    +#define unum_getDoubleAttribute unum_getDoubleAttribute_4_0
    +#define unum_getLocaleByType unum_getLocaleByType_4_0
    +#define unum_getSymbol unum_getSymbol_4_0
    +#define unum_getTextAttribute unum_getTextAttribute_4_0
    +#define unum_open unum_open_4_0
    +#define unum_parse unum_parse_4_0
    +#define unum_parseDouble unum_parseDouble_4_0
    +#define unum_parseDoubleCurrency unum_parseDoubleCurrency_4_0
    +#define unum_parseInt64 unum_parseInt64_4_0
    +#define unum_setAttribute unum_setAttribute_4_0
    +#define unum_setDoubleAttribute unum_setDoubleAttribute_4_0
    +#define unum_setSymbol unum_setSymbol_4_0
    +#define unum_setTextAttribute unum_setTextAttribute_4_0
    +#define unum_toPattern unum_toPattern_4_0
    +#define upname_swap upname_swap_4_0
    +#define uprops_getSource uprops_getSource_4_0
    +#define upropsvec_addPropertyStarts upropsvec_addPropertyStarts_4_0
    +#define uprv_asciiFromEbcdic uprv_asciiFromEbcdic_4_0
    +#define uprv_asciitolower uprv_asciitolower_4_0
    +#define uprv_ceil uprv_ceil_4_0
    +#define uprv_cnttab_addContraction uprv_cnttab_addContraction_4_0
    +#define uprv_cnttab_changeContraction uprv_cnttab_changeContraction_4_0
    +#define uprv_cnttab_changeLastCE uprv_cnttab_changeLastCE_4_0
    +#define uprv_cnttab_clone uprv_cnttab_clone_4_0
    +#define uprv_cnttab_close uprv_cnttab_close_4_0
    +#define uprv_cnttab_constructTable uprv_cnttab_constructTable_4_0
    +#define uprv_cnttab_findCE uprv_cnttab_findCE_4_0
    +#define uprv_cnttab_findCP uprv_cnttab_findCP_4_0
    +#define uprv_cnttab_getCE uprv_cnttab_getCE_4_0
    +#define uprv_cnttab_insertContraction uprv_cnttab_insertContraction_4_0
    +#define uprv_cnttab_isTailored uprv_cnttab_isTailored_4_0
    +#define uprv_cnttab_open uprv_cnttab_open_4_0
    +#define uprv_cnttab_setContraction uprv_cnttab_setContraction_4_0
    +#define uprv_compareASCIIPropertyNames uprv_compareASCIIPropertyNames_4_0
    +#define uprv_compareEBCDICPropertyNames uprv_compareEBCDICPropertyNames_4_0
    +#define uprv_compareInvAscii uprv_compareInvAscii_4_0
    +#define uprv_compareInvEbcdic uprv_compareInvEbcdic_4_0
    +#define uprv_convertToLCID uprv_convertToLCID_4_0
    +#define uprv_convertToPosix uprv_convertToPosix_4_0
    +#define uprv_copyAscii uprv_copyAscii_4_0
    +#define uprv_copyEbcdic uprv_copyEbcdic_4_0
    +#define uprv_ebcdicFromAscii uprv_ebcdicFromAscii_4_0
    +#define uprv_ebcdictolower uprv_ebcdictolower_4_0
    +#define uprv_fabs uprv_fabs_4_0
    +#define uprv_floor uprv_floor_4_0
    +#define uprv_fmax uprv_fmax_4_0
    +#define uprv_fmin uprv_fmin_4_0
    +#define uprv_fmod uprv_fmod_4_0
    +#define uprv_free uprv_free_4_0
    +#define uprv_getCharNameCharacters uprv_getCharNameCharacters_4_0
    +#define uprv_getDefaultCodepage uprv_getDefaultCodepage_4_0
    +#define uprv_getDefaultLocaleID uprv_getDefaultLocaleID_4_0
    +#define uprv_getInfinity uprv_getInfinity_4_0
    +#define uprv_getMaxCharNameLength uprv_getMaxCharNameLength_4_0
    +#define uprv_getMaxValues uprv_getMaxValues_4_0
    +#define uprv_getNaN uprv_getNaN_4_0
    +#define uprv_getStaticCurrencyName uprv_getStaticCurrencyName_4_0
    +#define uprv_getUTCtime uprv_getUTCtime_4_0
    +#define uprv_haveProperties uprv_haveProperties_4_0
    +#define uprv_init_collIterate uprv_init_collIterate_4_0
    +#define uprv_init_pce uprv_init_pce_4_0
    +#define uprv_int32Comparator uprv_int32Comparator_4_0
    +#define uprv_isInfinite uprv_isInfinite_4_0
    +#define uprv_isInvariantString uprv_isInvariantString_4_0
    +#define uprv_isInvariantUString uprv_isInvariantUString_4_0
    +#define uprv_isNaN uprv_isNaN_4_0
    +#define uprv_isNegativeInfinity uprv_isNegativeInfinity_4_0
    +#define uprv_isPositiveInfinity uprv_isPositiveInfinity_4_0
    +#define uprv_isRuleWhiteSpace uprv_isRuleWhiteSpace_4_0
    +#define uprv_itou uprv_itou_4_0
    +#define uprv_log uprv_log_4_0
    +#define uprv_malloc uprv_malloc_4_0
    +#define uprv_mapFile uprv_mapFile_4_0
    +#define uprv_max uprv_max_4_0
    +#define uprv_maxMantissa uprv_maxMantissa_4_0
    +#define uprv_maximumPtr uprv_maximumPtr_4_0
    +#define uprv_min uprv_min_4_0
    +#define uprv_modf uprv_modf_4_0
    +#define uprv_openRuleWhiteSpaceSet uprv_openRuleWhiteSpaceSet_4_0
    +#define uprv_parseCurrency uprv_parseCurrency_4_0
    +#define uprv_pathIsAbsolute uprv_pathIsAbsolute_4_0
    +#define uprv_pow uprv_pow_4_0
    +#define uprv_pow10 uprv_pow10_4_0
    +#define uprv_realloc uprv_realloc_4_0
    +#define uprv_round uprv_round_4_0
    +#define uprv_sortArray uprv_sortArray_4_0
    +#define uprv_strCompare uprv_strCompare_4_0
    +#define uprv_strdup uprv_strdup_4_0
    +#define uprv_strndup uprv_strndup_4_0
    +#define uprv_syntaxError uprv_syntaxError_4_0
    +#define uprv_timezone uprv_timezone_4_0
    +#define uprv_toupper uprv_toupper_4_0
    +#define uprv_trunc uprv_trunc_4_0
    +#define uprv_tzname uprv_tzname_4_0
    +#define uprv_tzset uprv_tzset_4_0
    +#define uprv_uca_addAnElement uprv_uca_addAnElement_4_0
    +#define uprv_uca_assembleTable uprv_uca_assembleTable_4_0
    +#define uprv_uca_canonicalClosure uprv_uca_canonicalClosure_4_0
    +#define uprv_uca_closeTempTable uprv_uca_closeTempTable_4_0
    +#define uprv_uca_getCodePointFromRaw uprv_uca_getCodePointFromRaw_4_0
    +#define uprv_uca_getImplicitFromRaw uprv_uca_getImplicitFromRaw_4_0
    +#define uprv_uca_getRawFromCodePoint uprv_uca_getRawFromCodePoint_4_0
    +#define uprv_uca_getRawFromImplicit uprv_uca_getRawFromImplicit_4_0
    +#define uprv_uca_initImplicitConstants uprv_uca_initImplicitConstants_4_0
    +#define uprv_uca_initTempTable uprv_uca_initTempTable_4_0
    +#define uprv_uint16Comparator uprv_uint16Comparator_4_0
    +#define uprv_uint32Comparator uprv_uint32Comparator_4_0
    +#define uprv_unmapFile uprv_unmapFile_4_0
    +#define uregex_appendReplacement uregex_appendReplacement_4_0
    +#define uregex_appendTail uregex_appendTail_4_0
    +#define uregex_clone uregex_clone_4_0
    +#define uregex_close uregex_close_4_0
    +#define uregex_end uregex_end_4_0
    +#define uregex_find uregex_find_4_0
    +#define uregex_findNext uregex_findNext_4_0
    +#define uregex_flags uregex_flags_4_0
    +#define uregex_getMatchCallback uregex_getMatchCallback_4_0
    +#define uregex_getStackLimit uregex_getStackLimit_4_0
    +#define uregex_getText uregex_getText_4_0
    +#define uregex_getTimeLimit uregex_getTimeLimit_4_0
    +#define uregex_group uregex_group_4_0
    +#define uregex_groupCount uregex_groupCount_4_0
    +#define uregex_hasAnchoringBounds uregex_hasAnchoringBounds_4_0
    +#define uregex_hasTransparentBounds uregex_hasTransparentBounds_4_0
    +#define uregex_hitEnd uregex_hitEnd_4_0
    +#define uregex_lookingAt uregex_lookingAt_4_0
    +#define uregex_matches uregex_matches_4_0
    +#define uregex_open uregex_open_4_0
    +#define uregex_openC uregex_openC_4_0
    +#define uregex_pattern uregex_pattern_4_0
    +#define uregex_regionEnd uregex_regionEnd_4_0
    +#define uregex_regionStart uregex_regionStart_4_0
    +#define uregex_replaceAll uregex_replaceAll_4_0
    +#define uregex_replaceFirst uregex_replaceFirst_4_0
    +#define uregex_requireEnd uregex_requireEnd_4_0
    +#define uregex_reset uregex_reset_4_0
    +#define uregex_setMatchCallback uregex_setMatchCallback_4_0
    +#define uregex_setRegion uregex_setRegion_4_0
    +#define uregex_setStackLimit uregex_setStackLimit_4_0
    +#define uregex_setText uregex_setText_4_0
    +#define uregex_setTimeLimit uregex_setTimeLimit_4_0
    +#define uregex_split uregex_split_4_0
    +#define uregex_start uregex_start_4_0
    +#define uregex_useAnchoringBounds uregex_useAnchoringBounds_4_0
    +#define uregex_useTransparentBounds uregex_useTransparentBounds_4_0
    +#define ures_close ures_close_4_0
    +#define ures_copyResb ures_copyResb_4_0
    +#define ures_countArrayItems ures_countArrayItems_4_0
    +#define ures_findResource ures_findResource_4_0
    +#define ures_findSubResource ures_findSubResource_4_0
    +#define ures_getBinary ures_getBinary_4_0
    +#define ures_getByIndex ures_getByIndex_4_0
    +#define ures_getByKey ures_getByKey_4_0
    +#define ures_getByKeyWithFallback ures_getByKeyWithFallback_4_0
    +#define ures_getFunctionalEquivalent ures_getFunctionalEquivalent_4_0
    +#define ures_getInt ures_getInt_4_0
    +#define ures_getIntVector ures_getIntVector_4_0
    +#define ures_getKey ures_getKey_4_0
    +#define ures_getKeywordValues ures_getKeywordValues_4_0
    +#define ures_getLocale ures_getLocale_4_0
    +#define ures_getLocaleByType ures_getLocaleByType_4_0
    +#define ures_getName ures_getName_4_0
    +#define ures_getNextResource ures_getNextResource_4_0
    +#define ures_getNextString ures_getNextString_4_0
    +#define ures_getSize ures_getSize_4_0
    +#define ures_getString ures_getString_4_0
    +#define ures_getStringByIndex ures_getStringByIndex_4_0
    +#define ures_getStringByKey ures_getStringByKey_4_0
    +#define ures_getStringByKeyWithFallback ures_getStringByKeyWithFallback_4_0
    +#define ures_getType ures_getType_4_0
    +#define ures_getUInt ures_getUInt_4_0
    +#define ures_getUTF8String ures_getUTF8String_4_0
    +#define ures_getUTF8StringByIndex ures_getUTF8StringByIndex_4_0
    +#define ures_getUTF8StringByKey ures_getUTF8StringByKey_4_0
    +#define ures_getVersion ures_getVersion_4_0
    +#define ures_getVersionNumber ures_getVersionNumber_4_0
    +#define ures_hasNext ures_hasNext_4_0
    +#define ures_initStackObject ures_initStackObject_4_0
    +#define ures_open ures_open_4_0
    +#define ures_openAvailableLocales ures_openAvailableLocales_4_0
    +#define ures_openDirect ures_openDirect_4_0
    +#define ures_openFillIn ures_openFillIn_4_0
    +#define ures_openU ures_openU_4_0
    +#define ures_resetIterator ures_resetIterator_4_0
    +#define ures_swap ures_swap_4_0
    +#define uscript_closeRun uscript_closeRun_4_0
    +#define uscript_getCode uscript_getCode_4_0
    +#define uscript_getName uscript_getName_4_0
    +#define uscript_getScript uscript_getScript_4_0
    +#define uscript_getShortName uscript_getShortName_4_0
    +#define uscript_nextRun uscript_nextRun_4_0
    +#define uscript_openRun uscript_openRun_4_0
    +#define uscript_resetRun uscript_resetRun_4_0
    +#define uscript_setRunText uscript_setRunText_4_0
    +#define usearch_close usearch_close_4_0
    +#define usearch_first usearch_first_4_0
    +#define usearch_following usearch_following_4_0
    +#define usearch_getAttribute usearch_getAttribute_4_0
    +#define usearch_getBreakIterator usearch_getBreakIterator_4_0
    +#define usearch_getCollator usearch_getCollator_4_0
    +#define usearch_getMatchedLength usearch_getMatchedLength_4_0
    +#define usearch_getMatchedStart usearch_getMatchedStart_4_0
    +#define usearch_getMatchedText usearch_getMatchedText_4_0
    +#define usearch_getOffset usearch_getOffset_4_0
    +#define usearch_getPattern usearch_getPattern_4_0
    +#define usearch_getText usearch_getText_4_0
    +#define usearch_handleNextCanonical usearch_handleNextCanonical_4_0
    +#define usearch_handleNextExact usearch_handleNextExact_4_0
    +#define usearch_handlePreviousCanonical usearch_handlePreviousCanonical_4_0
    +#define usearch_handlePreviousExact usearch_handlePreviousExact_4_0
    +#define usearch_last usearch_last_4_0
    +#define usearch_next usearch_next_4_0
    +#define usearch_open usearch_open_4_0
    +#define usearch_openFromCollator usearch_openFromCollator_4_0
    +#define usearch_preceding usearch_preceding_4_0
    +#define usearch_previous usearch_previous_4_0
    +#define usearch_reset usearch_reset_4_0
    +#define usearch_search usearch_search_4_0
    +#define usearch_searchBackwards usearch_searchBackwards_4_0
    +#define usearch_setAttribute usearch_setAttribute_4_0
    +#define usearch_setBreakIterator usearch_setBreakIterator_4_0
    +#define usearch_setCollator usearch_setCollator_4_0
    +#define usearch_setOffset usearch_setOffset_4_0
    +#define usearch_setPattern usearch_setPattern_4_0
    +#define usearch_setText usearch_setText_4_0
    +#define uset_add uset_add_4_0
    +#define uset_addAll uset_addAll_4_0
    +#define uset_addAllCodePoints uset_addAllCodePoints_4_0
    +#define uset_addRange uset_addRange_4_0
    +#define uset_addString uset_addString_4_0
    +#define uset_applyIntPropertyValue uset_applyIntPropertyValue_4_0
    +#define uset_applyPattern uset_applyPattern_4_0
    +#define uset_applyPropertyAlias uset_applyPropertyAlias_4_0
    +#define uset_charAt uset_charAt_4_0
    +#define uset_clear uset_clear_4_0
    +#define uset_clone uset_clone_4_0
    +#define uset_cloneAsThawed uset_cloneAsThawed_4_0
    +#define uset_close uset_close_4_0
    +#define uset_compact uset_compact_4_0
    +#define uset_complement uset_complement_4_0
    +#define uset_complementAll uset_complementAll_4_0
    +#define uset_contains uset_contains_4_0
    +#define uset_containsAll uset_containsAll_4_0
    +#define uset_containsAllCodePoints uset_containsAllCodePoints_4_0
    +#define uset_containsNone uset_containsNone_4_0
    +#define uset_containsRange uset_containsRange_4_0
    +#define uset_containsSome uset_containsSome_4_0
    +#define uset_containsString uset_containsString_4_0
    +#define uset_equals uset_equals_4_0
    +#define uset_freeze uset_freeze_4_0
    +#define uset_getItem uset_getItem_4_0
    +#define uset_getItemCount uset_getItemCount_4_0
    +#define uset_getSerializedRange uset_getSerializedRange_4_0
    +#define uset_getSerializedRangeCount uset_getSerializedRangeCount_4_0
    +#define uset_getSerializedSet uset_getSerializedSet_4_0
    +#define uset_indexOf uset_indexOf_4_0
    +#define uset_isEmpty uset_isEmpty_4_0
    +#define uset_isFrozen uset_isFrozen_4_0
    +#define uset_open uset_open_4_0
    +#define uset_openPattern uset_openPattern_4_0
    +#define uset_openPatternOptions uset_openPatternOptions_4_0
    +#define uset_remove uset_remove_4_0
    +#define uset_removeAll uset_removeAll_4_0
    +#define uset_removeRange uset_removeRange_4_0
    +#define uset_removeString uset_removeString_4_0
    +#define uset_resemblesPattern uset_resemblesPattern_4_0
    +#define uset_retain uset_retain_4_0
    +#define uset_retainAll uset_retainAll_4_0
    +#define uset_serialize uset_serialize_4_0
    +#define uset_serializedContains uset_serializedContains_4_0
    +#define uset_set uset_set_4_0
    +#define uset_setSerializedToOne uset_setSerializedToOne_4_0
    +#define uset_size uset_size_4_0
    +#define uset_span uset_span_4_0
    +#define uset_spanBack uset_spanBack_4_0
    +#define uset_spanBackUTF8 uset_spanBackUTF8_4_0
    +#define uset_spanUTF8 uset_spanUTF8_4_0
    +#define uset_toPattern uset_toPattern_4_0
    +#define usprep_close usprep_close_4_0
    +#define usprep_open usprep_open_4_0
    +#define usprep_prepare usprep_prepare_4_0
    +#define usprep_swap usprep_swap_4_0
    +#define ustr_foldCase ustr_foldCase_4_0
    +#define ustr_toLower ustr_toLower_4_0
    +#define ustr_toTitle ustr_toTitle_4_0
    +#define ustr_toUpper ustr_toUpper_4_0
    +#define utext_char32At utext_char32At_4_0
    +#define utext_clone utext_clone_4_0
    +#define utext_close utext_close_4_0
    +#define utext_copy utext_copy_4_0
    +#define utext_current32 utext_current32_4_0
    +#define utext_equals utext_equals_4_0
    +#define utext_extract utext_extract_4_0
    +#define utext_freeze utext_freeze_4_0
    +#define utext_getNativeIndex utext_getNativeIndex_4_0
    +#define utext_getPreviousNativeIndex utext_getPreviousNativeIndex_4_0
    +#define utext_hasMetaData utext_hasMetaData_4_0
    +#define utext_isLengthExpensive utext_isLengthExpensive_4_0
    +#define utext_isWritable utext_isWritable_4_0
    +#define utext_moveIndex32 utext_moveIndex32_4_0
    +#define utext_nativeLength utext_nativeLength_4_0
    +#define utext_next32 utext_next32_4_0
    +#define utext_next32From utext_next32From_4_0
    +#define utext_openCharacterIterator utext_openCharacterIterator_4_0
    +#define utext_openConstUnicodeString utext_openConstUnicodeString_4_0
    +#define utext_openReplaceable utext_openReplaceable_4_0
    +#define utext_openUChars utext_openUChars_4_0
    +#define utext_openUTF8 utext_openUTF8_4_0
    +#define utext_openUnicodeString utext_openUnicodeString_4_0
    +#define utext_previous32 utext_previous32_4_0
    +#define utext_previous32From utext_previous32From_4_0
    +#define utext_replace utext_replace_4_0
    +#define utext_setNativeIndex utext_setNativeIndex_4_0
    +#define utext_setup utext_setup_4_0
    +#define utf8_appendCharSafeBody utf8_appendCharSafeBody_4_0
    +#define utf8_back1SafeBody utf8_back1SafeBody_4_0
    +#define utf8_countTrailBytes utf8_countTrailBytes_4_0
    +#define utf8_nextCharSafeBody utf8_nextCharSafeBody_4_0
    +#define utf8_prevCharSafeBody utf8_prevCharSafeBody_4_0
    +#define utmscale_fromInt64 utmscale_fromInt64_4_0
    +#define utmscale_getTimeScaleValue utmscale_getTimeScaleValue_4_0
    +#define utmscale_toInt64 utmscale_toInt64_4_0
    +#define utrace_cleanup utrace_cleanup_4_0
    +#define utrace_data utrace_data_4_0
    +#define utrace_entry utrace_entry_4_0
    +#define utrace_exit utrace_exit_4_0
    +#define utrace_format utrace_format_4_0
    +#define utrace_functionName utrace_functionName_4_0
    +#define utrace_getFunctions utrace_getFunctions_4_0
    +#define utrace_getLevel utrace_getLevel_4_0
    +#define utrace_level utrace_level_4_0
    +#define utrace_setFunctions utrace_setFunctions_4_0
    +#define utrace_setLevel utrace_setLevel_4_0
    +#define utrace_vformat utrace_vformat_4_0
    +#define utrans_clone utrans_clone_4_0
    +#define utrans_close utrans_close_4_0
    +#define utrans_countAvailableIDs utrans_countAvailableIDs_4_0
    +#define utrans_getAvailableID utrans_getAvailableID_4_0
    +#define utrans_getID utrans_getID_4_0
    +#define utrans_getUnicodeID utrans_getUnicodeID_4_0
    +#define utrans_open utrans_open_4_0
    +#define utrans_openIDs utrans_openIDs_4_0
    +#define utrans_openInverse utrans_openInverse_4_0
    +#define utrans_openU utrans_openU_4_0
    +#define utrans_register utrans_register_4_0
    +#define utrans_rep_caseContextIterator utrans_rep_caseContextIterator_4_0
    +#define utrans_setFilter utrans_setFilter_4_0
    +#define utrans_stripRules utrans_stripRules_4_0
    +#define utrans_trans utrans_trans_4_0
    +#define utrans_transIncremental utrans_transIncremental_4_0
    +#define utrans_transIncrementalUChars utrans_transIncrementalUChars_4_0
    +#define utrans_transUChars utrans_transUChars_4_0
    +#define utrans_unregister utrans_unregister_4_0
    +#define utrans_unregisterID utrans_unregisterID_4_0
    +#define utrie_clone utrie_clone_4_0
    +#define utrie_close utrie_close_4_0
    +#define utrie_defaultGetFoldingOffset utrie_defaultGetFoldingOffset_4_0
    +#define utrie_enum utrie_enum_4_0
    +#define utrie_get32 utrie_get32_4_0
    +#define utrie_getData utrie_getData_4_0
    +#define utrie_open utrie_open_4_0
    +#define utrie_serialize utrie_serialize_4_0
    +#define utrie_set32 utrie_set32_4_0
    +#define utrie_setRange32 utrie_setRange32_4_0
    +#define utrie_swap utrie_swap_4_0
    +#define utrie_unserialize utrie_unserialize_4_0
    +#define utrie_unserializeDummy utrie_unserializeDummy_4_0
    +/* C++ class names renaming defines */
    +
    +#ifdef XP_CPLUSPLUS
    +#if !U_HAVE_NAMESPACE
    +
    +#define AbsoluteValueSubstitution AbsoluteValueSubstitution_4_0
    +#define AlternateSubstitutionSubtable AlternateSubstitutionSubtable_4_0
    +#define AnchorTable AnchorTable_4_0
    +#define AndConstraint AndConstraint_4_0
    +#define AnnualTimeZoneRule AnnualTimeZoneRule_4_0
    +#define AnyTransliterator AnyTransliterator_4_0
    +#define ArabicOpenTypeLayoutEngine ArabicOpenTypeLayoutEngine_4_0
    +#define ArabicShaping ArabicShaping_4_0
    +#define BMPSet BMPSet_4_0
    +#define BasicCalendarFactory BasicCalendarFactory_4_0
    +#define BasicTimeZone BasicTimeZone_4_0
    +#define BinarySearchLookupTable BinarySearchLookupTable_4_0
    +#define BreakIterator BreakIterator_4_0
    +#define BreakTransliterator BreakTransliterator_4_0
    +#define BuddhistCalendar BuddhistCalendar_4_0
    +#define BuildCompactTrieHorizontalNode BuildCompactTrieHorizontalNode_4_0
    +#define BuildCompactTrieNode BuildCompactTrieNode_4_0
    +#define BuildCompactTrieVerticalNode BuildCompactTrieVerticalNode_4_0
    +#define CEBuffer CEBuffer_4_0
    +#define CECalendar CECalendar_4_0
    +#define CFactory CFactory_4_0
    +#define Calendar Calendar_4_0
    +#define CalendarAstronomer CalendarAstronomer_4_0
    +#define CalendarCache CalendarCache_4_0
    +#define CalendarData CalendarData_4_0
    +#define CalendarService CalendarService_4_0
    +#define CanonMarkFilter CanonMarkFilter_4_0
    +#define CanonShaping CanonShaping_4_0
    +#define CanonicalIterator CanonicalIterator_4_0
    +#define CaseMapTransliterator CaseMapTransliterator_4_0
    +#define ChainingContextualSubstitutionFormat1Subtable ChainingContextualSubstitutionFormat1Subtable_4_0
    +#define ChainingContextualSubstitutionFormat2Subtable ChainingContextualSubstitutionFormat2Subtable_4_0
    +#define ChainingContextualSubstitutionFormat3Subtable ChainingContextualSubstitutionFormat3Subtable_4_0
    +#define ChainingContextualSubstitutionSubtable ChainingContextualSubstitutionSubtable_4_0
    +#define CharSubstitutionFilter CharSubstitutionFilter_4_0
    +#define CharacterIterator CharacterIterator_4_0
    +#define CharacterNode CharacterNode_4_0
    +#define CharsetDetector CharsetDetector_4_0
    +#define CharsetMatch CharsetMatch_4_0
    +#define CharsetRecog_2022 CharsetRecog_2022_4_0
    +#define CharsetRecog_2022CN CharsetRecog_2022CN_4_0
    +#define CharsetRecog_2022JP CharsetRecog_2022JP_4_0
    +#define CharsetRecog_2022KR CharsetRecog_2022KR_4_0
    +#define CharsetRecog_8859_1 CharsetRecog_8859_1_4_0
    +#define CharsetRecog_8859_1_da CharsetRecog_8859_1_da_4_0
    +#define CharsetRecog_8859_1_de CharsetRecog_8859_1_de_4_0
    +#define CharsetRecog_8859_1_en CharsetRecog_8859_1_en_4_0
    +#define CharsetRecog_8859_1_es CharsetRecog_8859_1_es_4_0
    +#define CharsetRecog_8859_1_fr CharsetRecog_8859_1_fr_4_0
    +#define CharsetRecog_8859_1_it CharsetRecog_8859_1_it_4_0
    +#define CharsetRecog_8859_1_nl CharsetRecog_8859_1_nl_4_0
    +#define CharsetRecog_8859_1_no CharsetRecog_8859_1_no_4_0
    +#define CharsetRecog_8859_1_pt CharsetRecog_8859_1_pt_4_0
    +#define CharsetRecog_8859_1_sv CharsetRecog_8859_1_sv_4_0
    +#define CharsetRecog_8859_2 CharsetRecog_8859_2_4_0
    +#define CharsetRecog_8859_2_cs CharsetRecog_8859_2_cs_4_0
    +#define CharsetRecog_8859_2_hu CharsetRecog_8859_2_hu_4_0
    +#define CharsetRecog_8859_2_pl CharsetRecog_8859_2_pl_4_0
    +#define CharsetRecog_8859_2_ro CharsetRecog_8859_2_ro_4_0
    +#define CharsetRecog_8859_5 CharsetRecog_8859_5_4_0
    +#define CharsetRecog_8859_5_ru CharsetRecog_8859_5_ru_4_0
    +#define CharsetRecog_8859_6 CharsetRecog_8859_6_4_0
    +#define CharsetRecog_8859_6_ar CharsetRecog_8859_6_ar_4_0
    +#define CharsetRecog_8859_7 CharsetRecog_8859_7_4_0
    +#define CharsetRecog_8859_7_el CharsetRecog_8859_7_el_4_0
    +#define CharsetRecog_8859_8 CharsetRecog_8859_8_4_0
    +#define CharsetRecog_8859_8_I_he CharsetRecog_8859_8_I_he_4_0
    +#define CharsetRecog_8859_8_he CharsetRecog_8859_8_he_4_0
    +#define CharsetRecog_8859_9 CharsetRecog_8859_9_4_0
    +#define CharsetRecog_8859_9_tr CharsetRecog_8859_9_tr_4_0
    +#define CharsetRecog_KOI8_R CharsetRecog_KOI8_R_4_0
    +#define CharsetRecog_UTF8 CharsetRecog_UTF8_4_0
    +#define CharsetRecog_UTF_16_BE CharsetRecog_UTF_16_BE_4_0
    +#define CharsetRecog_UTF_16_LE CharsetRecog_UTF_16_LE_4_0
    +#define CharsetRecog_UTF_32 CharsetRecog_UTF_32_4_0
    +#define CharsetRecog_UTF_32_BE CharsetRecog_UTF_32_BE_4_0
    +#define CharsetRecog_UTF_32_LE CharsetRecog_UTF_32_LE_4_0
    +#define CharsetRecog_Unicode CharsetRecog_Unicode_4_0
    +#define CharsetRecog_big5 CharsetRecog_big5_4_0
    +#define CharsetRecog_euc CharsetRecog_euc_4_0
    +#define CharsetRecog_euc_jp CharsetRecog_euc_jp_4_0
    +#define CharsetRecog_euc_kr CharsetRecog_euc_kr_4_0
    +#define CharsetRecog_gb_18030 CharsetRecog_gb_18030_4_0
    +#define CharsetRecog_mbcs CharsetRecog_mbcs_4_0
    +#define CharsetRecog_sbcs CharsetRecog_sbcs_4_0
    +#define CharsetRecog_sjis CharsetRecog_sjis_4_0
    +#define CharsetRecog_windows_1251 CharsetRecog_windows_1251_4_0
    +#define CharsetRecog_windows_1256 CharsetRecog_windows_1256_4_0
    +#define CharsetRecognizer CharsetRecognizer_4_0
    +#define ChineseCalendar ChineseCalendar_4_0
    +#define ChoiceFormat ChoiceFormat_4_0
    +#define ClassDefFormat1Table ClassDefFormat1Table_4_0
    +#define ClassDefFormat2Table ClassDefFormat2Table_4_0
    +#define ClassDefinitionTable ClassDefinitionTable_4_0
    +#define CollationElementIterator CollationElementIterator_4_0
    +#define CollationKey CollationKey_4_0
    +#define CollationLocaleListEnumeration CollationLocaleListEnumeration_4_0
    +#define Collator Collator_4_0
    +#define CollatorFactory CollatorFactory_4_0
    +#define CompactTrieDictionary CompactTrieDictionary_4_0
    +#define CompactTrieEnumeration CompactTrieEnumeration_4_0
    +#define CompoundTransliterator CompoundTransliterator_4_0
    +#define ContextualGlyphSubstitutionProcessor ContextualGlyphSubstitutionProcessor_4_0
    +#define ContextualSubstitutionBase ContextualSubstitutionBase_4_0
    +#define ContextualSubstitutionFormat1Subtable ContextualSubstitutionFormat1Subtable_4_0
    +#define ContextualSubstitutionFormat2Subtable ContextualSubstitutionFormat2Subtable_4_0
    +#define ContextualSubstitutionFormat3Subtable ContextualSubstitutionFormat3Subtable_4_0
    +#define ContextualSubstitutionSubtable ContextualSubstitutionSubtable_4_0
    +#define CopticCalendar CopticCalendar_4_0
    +#define CoverageFormat1Table CoverageFormat1Table_4_0
    +#define CoverageFormat2Table CoverageFormat2Table_4_0
    +#define CoverageTable CoverageTable_4_0
    +#define CurrencyAmount CurrencyAmount_4_0
    +#define CurrencyFormat CurrencyFormat_4_0
    +#define CurrencyUnit CurrencyUnit_4_0
    +#define CursiveAttachmentSubtable CursiveAttachmentSubtable_4_0
    +#define DTRedundantEnumeration DTRedundantEnumeration_4_0
    +#define DTSkeletonEnumeration DTSkeletonEnumeration_4_0
    +#define DateFormat DateFormat_4_0
    +#define DateFormatSymbols DateFormatSymbols_4_0
    +#define DateInterval DateInterval_4_0
    +#define DateIntervalFormat DateIntervalFormat_4_0
    +#define DateIntervalInfo DateIntervalInfo_4_0
    +#define DateTimeMatcher DateTimeMatcher_4_0
    +#define DateTimePatternGenerator DateTimePatternGenerator_4_0
    +#define DateTimeRule DateTimeRule_4_0
    +#define DecimalFormat DecimalFormat_4_0
    +#define DecimalFormatSymbols DecimalFormatSymbols_4_0
    +#define DefaultCalendarFactory DefaultCalendarFactory_4_0
    +#define DefaultCharMapper DefaultCharMapper_4_0
    +#define DeviceTable DeviceTable_4_0
    +#define DictionaryBreakEngine DictionaryBreakEngine_4_0
    +#define DigitList DigitList_4_0
    +#define DistanceInfo DistanceInfo_4_0
    +#define Entry Entry_4_0
    +#define EnumToOffset EnumToOffset_4_0
    +#define EscapeTransliterator EscapeTransliterator_4_0
    +#define EthiopicCalendar EthiopicCalendar_4_0
    +#define EventListener EventListener_4_0
    +#define ExtensionSubtable ExtensionSubtable_4_0
    +#define FeatureListTable FeatureListTable_4_0
    +#define FieldPosition FieldPosition_4_0
    +#define FontRuns FontRuns_4_0
    +#define Format Format_4_0
    +#define Format1AnchorTable Format1AnchorTable_4_0
    +#define Format2AnchorTable Format2AnchorTable_4_0
    +#define Format3AnchorTable Format3AnchorTable_4_0
    +#define FormatNameEnumeration FormatNameEnumeration_4_0
    +#define FormatParser FormatParser_4_0
    +#define Formattable Formattable_4_0
    +#define ForwardCharacterIterator ForwardCharacterIterator_4_0
    +#define FractionalPartSubstitution FractionalPartSubstitution_4_0
    +#define FunctionReplacer FunctionReplacer_4_0
    +#define GDEFMarkFilter GDEFMarkFilter_4_0
    +#define GXLayoutEngine GXLayoutEngine_4_0
    +#define GlyphDefinitionTableHeader GlyphDefinitionTableHeader_4_0
    +#define GlyphIterator GlyphIterator_4_0
    +#define GlyphLookupTableHeader GlyphLookupTableHeader_4_0
    +#define GlyphPositionAdjustments GlyphPositionAdjustments_4_0
    +#define GlyphPositioningLookupProcessor GlyphPositioningLookupProcessor_4_0
    +#define GlyphPositioningTableHeader GlyphPositioningTableHeader_4_0
    +#define GlyphSubstitutionLookupProcessor GlyphSubstitutionLookupProcessor_4_0
    +#define GlyphSubstitutionTableHeader GlyphSubstitutionTableHeader_4_0
    +#define Grego Grego_4_0
    +#define GregorianCalendar GregorianCalendar_4_0
    +#define HanOpenTypeLayoutEngine HanOpenTypeLayoutEngine_4_0
    +#define HangulOpenTypeLayoutEngine HangulOpenTypeLayoutEngine_4_0
    +#define HebrewCalendar HebrewCalendar_4_0
    +#define ICUBreakIteratorFactory ICUBreakIteratorFactory_4_0
    +#define ICUBreakIteratorService ICUBreakIteratorService_4_0
    +#define ICUCollatorFactory ICUCollatorFactory_4_0
    +#define ICUCollatorService ICUCollatorService_4_0
    +#define ICULanguageBreakFactory ICULanguageBreakFactory_4_0
    +#define ICULocaleService ICULocaleService_4_0
    +#define ICUNotifier ICUNotifier_4_0
    +#define ICUNumberFormatFactory ICUNumberFormatFactory_4_0
    +#define ICUNumberFormatService ICUNumberFormatService_4_0
    +#define ICUResourceBundleFactory ICUResourceBundleFactory_4_0
    +#define ICUService ICUService_4_0
    +#define ICUServiceFactory ICUServiceFactory_4_0
    +#define ICUServiceKey ICUServiceKey_4_0
    +#define ICU_Utility ICU_Utility_4_0
    +#define IndianCalendar IndianCalendar_4_0
    +#define IndicClassTable IndicClassTable_4_0
    +#define IndicOpenTypeLayoutEngine IndicOpenTypeLayoutEngine_4_0
    +#define IndicRearrangementProcessor IndicRearrangementProcessor_4_0
    +#define IndicReordering IndicReordering_4_0
    +#define InitialTimeZoneRule InitialTimeZoneRule_4_0
    +#define InputText InputText_4_0
    +#define IntegralPartSubstitution IntegralPartSubstitution_4_0
    +#define IslamicCalendar IslamicCalendar_4_0
    +#define IteratedChar IteratedChar_4_0
    +#define JapaneseCalendar JapaneseCalendar_4_0
    +#define KernTable KernTable_4_0
    +#define KeywordEnumeration KeywordEnumeration_4_0
    +#define KhmerClassTable KhmerClassTable_4_0
    +#define KhmerOpenTypeLayoutEngine KhmerOpenTypeLayoutEngine_4_0
    +#define KhmerReordering KhmerReordering_4_0
    +#define LECharMapper LECharMapper_4_0
    +#define LEFontInstance LEFontInstance_4_0
    +#define LEGlyphFilter LEGlyphFilter_4_0
    +#define LEGlyphStorage LEGlyphStorage_4_0
    +#define LEInsertionCallback LEInsertionCallback_4_0
    +#define LEInsertionList LEInsertionList_4_0
    +#define LXUtilities LXUtilities_4_0
    +#define LanguageBreakEngine LanguageBreakEngine_4_0
    +#define LanguageBreakFactory LanguageBreakFactory_4_0
    +#define LayoutEngine LayoutEngine_4_0
    +#define LigatureSubstitutionProcessor LigatureSubstitutionProcessor_4_0
    +#define LigatureSubstitutionSubtable LigatureSubstitutionSubtable_4_0
    +#define LocDataParser LocDataParser_4_0
    +#define Locale Locale_4_0
    +#define LocaleBased LocaleBased_4_0
    +#define LocaleKey LocaleKey_4_0
    +#define LocaleKeyFactory LocaleKeyFactory_4_0
    +#define LocaleRuns LocaleRuns_4_0
    +#define LocaleUtility LocaleUtility_4_0
    +#define LocalizationInfo LocalizationInfo_4_0
    +#define LookupListTable LookupListTable_4_0
    +#define LookupProcessor LookupProcessor_4_0
    +#define LookupSubtable LookupSubtable_4_0
    +#define LookupTable LookupTable_4_0
    +#define LowercaseTransliterator LowercaseTransliterator_4_0
    +#define MPreFixups MPreFixups_4_0
    +#define MarkArray MarkArray_4_0
    +#define MarkToBasePositioningSubtable MarkToBasePositioningSubtable_4_0
    +#define MarkToLigaturePositioningSubtable MarkToLigaturePositioningSubtable_4_0
    +#define MarkToMarkPositioningSubtable MarkToMarkPositioningSubtable_4_0
    +#define Math Math_4_0
    +#define Measure Measure_4_0
    +#define MeasureFormat MeasureFormat_4_0
    +#define MeasureUnit MeasureUnit_4_0
    +#define MessageFormat MessageFormat_4_0
    +#define MessageFormatAdapter MessageFormatAdapter_4_0
    +#define ModulusSubstitution ModulusSubstitution_4_0
    +#define MoonRiseSetCoordFunc MoonRiseSetCoordFunc_4_0
    +#define MoonTimeAngleFunc MoonTimeAngleFunc_4_0
    +#define MorphSubtableHeader MorphSubtableHeader_4_0
    +#define MorphTableHeader MorphTableHeader_4_0
    +#define MultipleSubstitutionSubtable MultipleSubstitutionSubtable_4_0
    +#define MultiplierSubstitution MultiplierSubstitution_4_0
    +#define MutableTrieDictionary MutableTrieDictionary_4_0
    +#define MutableTrieEnumeration MutableTrieEnumeration_4_0
    +#define NFFactory NFFactory_4_0
    +#define NFRule NFRule_4_0
    +#define NFRuleSet NFRuleSet_4_0
    +#define NFSubstitution NFSubstitution_4_0
    +#define NGramParser NGramParser_4_0
    +#define NameToEnum NameToEnum_4_0
    +#define NameUnicodeTransliterator NameUnicodeTransliterator_4_0
    +#define NonContextualGlyphSubstitutionProcessor NonContextualGlyphSubstitutionProcessor_4_0
    +#define NonContiguousEnumToOffset NonContiguousEnumToOffset_4_0
    +#define NormalizationTransliterator NormalizationTransliterator_4_0
    +#define Normalizer Normalizer_4_0
    +#define NullSubstitution NullSubstitution_4_0
    +#define NullTransliterator NullTransliterator_4_0
    +#define NumberFormat NumberFormat_4_0
    +#define NumberFormatFactory NumberFormatFactory_4_0
    +#define NumeratorSubstitution NumeratorSubstitution_4_0
    +#define OlsonTimeZone OlsonTimeZone_4_0
    +#define OpenTypeLayoutEngine OpenTypeLayoutEngine_4_0
    +#define OpenTypeUtilities OpenTypeUtilities_4_0
    +#define OrConstraint OrConstraint_4_0
    +#define PCEBuffer PCEBuffer_4_0
    +#define PairPositioningFormat1Subtable PairPositioningFormat1Subtable_4_0
    +#define PairPositioningFormat2Subtable PairPositioningFormat2Subtable_4_0
    +#define PairPositioningSubtable PairPositioningSubtable_4_0
    +#define ParagraphLayout ParagraphLayout_4_0
    +#define ParseData ParseData_4_0
    +#define ParsePosition ParsePosition_4_0
    +#define PatternMap PatternMap_4_0
    +#define PatternMapIterator PatternMapIterator_4_0
    +#define PersianCalendar PersianCalendar_4_0
    +#define PluralFormat PluralFormat_4_0
    +#define PluralKeywordEnumeration PluralKeywordEnumeration_4_0
    +#define PluralRules PluralRules_4_0
    +#define PropertyAliases PropertyAliases_4_0
    +#define PtnElem PtnElem_4_0
    +#define PtnSkeleton PtnSkeleton_4_0
    +#define Quantifier Quantifier_4_0
    +#define RBBIDataWrapper RBBIDataWrapper_4_0
    +#define RBBINode RBBINode_4_0
    +#define RBBIRuleBuilder RBBIRuleBuilder_4_0
    +#define RBBIRuleScanner RBBIRuleScanner_4_0
    +#define RBBISetBuilder RBBISetBuilder_4_0
    +#define RBBIStateDescriptor RBBIStateDescriptor_4_0
    +#define RBBISymbolTable RBBISymbolTable_4_0
    +#define RBBISymbolTableEntry RBBISymbolTableEntry_4_0
    +#define RBBITableBuilder RBBITableBuilder_4_0
    +#define RCEBuffer RCEBuffer_4_0
    +#define RangeDescriptor RangeDescriptor_4_0
    +#define RegexCImpl RegexCImpl_4_0
    +#define RegexCompile RegexCompile_4_0
    +#define RegexMatcher RegexMatcher_4_0
    +#define RegexPattern RegexPattern_4_0
    +#define RegexStaticSets RegexStaticSets_4_0
    +#define RelativeDateFormat RelativeDateFormat_4_0
    +#define RemoveTransliterator RemoveTransliterator_4_0
    +#define Replaceable Replaceable_4_0
    +#define ReplaceableGlue ReplaceableGlue_4_0
    +#define ResourceBundle ResourceBundle_4_0
    +#define RiseSetCoordFunc RiseSetCoordFunc_4_0
    +#define RuleBasedBreakIterator RuleBasedBreakIterator_4_0
    +#define RuleBasedCollator RuleBasedCollator_4_0
    +#define RuleBasedNumberFormat RuleBasedNumberFormat_4_0
    +#define RuleBasedTimeZone RuleBasedTimeZone_4_0
    +#define RuleBasedTransliterator RuleBasedTransliterator_4_0
    +#define RuleChain RuleChain_4_0
    +#define RuleCharacterIterator RuleCharacterIterator_4_0
    +#define RuleHalf RuleHalf_4_0
    +#define RuleParser RuleParser_4_0
    +#define RunArray RunArray_4_0
    +#define SafeZoneStringFormatPtr SafeZoneStringFormatPtr_4_0
    +#define SameValueSubstitution SameValueSubstitution_4_0
    +#define ScriptListTable ScriptListTable_4_0
    +#define ScriptRunIterator ScriptRunIterator_4_0
    +#define ScriptTable ScriptTable_4_0
    +#define SearchIterator SearchIterator_4_0
    +#define SegmentArrayProcessor SegmentArrayProcessor_4_0
    +#define SegmentSingleProcessor SegmentSingleProcessor_4_0
    +#define ServiceEnumeration ServiceEnumeration_4_0
    +#define ServiceListener ServiceListener_4_0
    +#define SimpleArrayProcessor SimpleArrayProcessor_4_0
    +#define SimpleDateFormat SimpleDateFormat_4_0
    +#define SimpleFactory SimpleFactory_4_0
    +#define SimpleLocaleKeyFactory SimpleLocaleKeyFactory_4_0
    +#define SimpleNumberFormatFactory SimpleNumberFormatFactory_4_0
    +#define SimpleTimeZone SimpleTimeZone_4_0
    +#define SinglePositioningFormat1Subtable SinglePositioningFormat1Subtable_4_0
    +#define SinglePositioningFormat2Subtable SinglePositioningFormat2Subtable_4_0
    +#define SinglePositioningSubtable SinglePositioningSubtable_4_0
    +#define SingleSubstitutionFormat1Subtable SingleSubstitutionFormat1Subtable_4_0
    +#define SingleSubstitutionFormat2Subtable SingleSubstitutionFormat2Subtable_4_0
    +#define SingleSubstitutionSubtable SingleSubstitutionSubtable_4_0
    +#define SingleTableProcessor SingleTableProcessor_4_0
    +#define Spec Spec_4_0
    +#define StateTableProcessor StateTableProcessor_4_0
    +#define StringCharacterIterator StringCharacterIterator_4_0
    +#define StringEnumeration StringEnumeration_4_0
    +#define StringLocalizationInfo StringLocalizationInfo_4_0
    +#define StringMatcher StringMatcher_4_0
    +#define StringPair StringPair_4_0
    +#define StringReplacer StringReplacer_4_0
    +#define StringSearch StringSearch_4_0
    +#define StyleRuns StyleRuns_4_0
    +#define SubstitutionLookup SubstitutionLookup_4_0
    +#define SubtableProcessor SubtableProcessor_4_0
    +#define SunTimeAngleFunc SunTimeAngleFunc_4_0
    +#define SymbolTable SymbolTable_4_0
    +#define TZEnumeration TZEnumeration_4_0
    +#define TaiwanCalendar TaiwanCalendar_4_0
    +#define TernaryNode TernaryNode_4_0
    +#define TextTrieMap TextTrieMap_4_0
    +#define TextTrieMapSearchResultHandler TextTrieMapSearchResultHandler_4_0
    +#define ThaiBreakEngine ThaiBreakEngine_4_0
    +#define ThaiLayoutEngine ThaiLayoutEngine_4_0
    +#define ThaiShaping ThaiShaping_4_0
    +#define TibetanClassTable TibetanClassTable_4_0
    +#define TibetanOpenTypeLayoutEngine TibetanOpenTypeLayoutEngine_4_0
    +#define TibetanReordering TibetanReordering_4_0
    +#define TimeArrayTimeZoneRule TimeArrayTimeZoneRule_4_0
    +#define TimeZone TimeZone_4_0
    +#define TimeZoneRule TimeZoneRule_4_0
    +#define TimeZoneTransition TimeZoneTransition_4_0
    +#define TitlecaseTransliterator TitlecaseTransliterator_4_0
    +#define TransliterationRule TransliterationRule_4_0
    +#define TransliterationRuleData TransliterationRuleData_4_0
    +#define TransliterationRuleSet TransliterationRuleSet_4_0
    +#define Transliterator Transliterator_4_0
    +#define TransliteratorAlias TransliteratorAlias_4_0
    +#define TransliteratorIDParser TransliteratorIDParser_4_0
    +#define TransliteratorParser TransliteratorParser_4_0
    +#define TransliteratorRegistry TransliteratorRegistry_4_0
    +#define TrieWordDictionary TrieWordDictionary_4_0
    +#define TrimmedArrayProcessor TrimmedArrayProcessor_4_0
    +#define UCharCharacterIterator UCharCharacterIterator_4_0
    +#define UCollationPCE UCollationPCE_4_0
    +#define ULocRuns ULocRuns_4_0
    +#define UMemory UMemory_4_0
    +#define UObject UObject_4_0
    +#define URegularExpression URegularExpression_4_0
    +#define UStack UStack_4_0
    +#define UStringEnumeration UStringEnumeration_4_0
    +#define UVector UVector_4_0
    +#define UVector32 UVector32_4_0
    +#define UnescapeTransliterator UnescapeTransliterator_4_0
    +#define UnhandledEngine UnhandledEngine_4_0
    +#define UnicodeArabicOpenTypeLayoutEngine UnicodeArabicOpenTypeLayoutEngine_4_0
    +#define UnicodeFilter UnicodeFilter_4_0
    +#define UnicodeFunctor UnicodeFunctor_4_0
    +#define UnicodeMatcher UnicodeMatcher_4_0
    +#define UnicodeNameTransliterator UnicodeNameTransliterator_4_0
    +#define UnicodeReplacer UnicodeReplacer_4_0
    +#define UnicodeSet UnicodeSet_4_0
    +#define UnicodeSetIterator UnicodeSetIterator_4_0
    +#define UnicodeSetStringSpan UnicodeSetStringSpan_4_0
    +#define UnicodeString UnicodeString_4_0
    +#define UppercaseTransliterator UppercaseTransliterator_4_0
    +#define VTZReader VTZReader_4_0
    +#define VTZWriter VTZWriter_4_0
    +#define VTimeZone VTimeZone_4_0
    +#define ValueRecord ValueRecord_4_0
    +#define ValueRuns ValueRuns_4_0
    +#define ZSFCache ZSFCache_4_0
    +#define ZSFCacheEntry ZSFCacheEntry_4_0
    +#define ZoneMeta ZoneMeta_4_0
    +#define ZoneStringFormat ZoneStringFormat_4_0
    +#define ZoneStringInfo ZoneStringInfo_4_0
    +#define ZoneStringSearchResultHandler ZoneStringSearchResultHandler_4_0
    +#define ZoneStrings ZoneStrings_4_0
    +#define locale_set_default_internal locale_set_default_internal_4_0
    +#define util64_fromDouble util64_fromDouble_4_0
    +#define util64_pow util64_pow_4_0
    +#define util64_tou util64_tou_4_0
    +
    +#endif
    +#endif
    +
    +#endif
    +
    +#endif
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/dtfmtsym.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/dtfmtsym.h b/platform/osx/icu/unicode/dtfmtsym.h
    new file mode 100644
    index 0000000..a4b08bc
    --- /dev/null
    +++ b/platform/osx/icu/unicode/dtfmtsym.h
    @@ -0,0 +1,721 @@
    +/*
    +********************************************************************************
    +* Copyright (C) 1997-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +********************************************************************************
    +*
    +* File DTFMTSYM.H
    +*
    +* Modification History:
    +*
    +* Date Name Description
    +* 02/19/97 aliu Converted from java.
    +* 07/21/98 stephen Added getZoneIndex()
    +* Changed to match C++ conventions
    +********************************************************************************
    +*/
    +
    +#ifndef DTFMTSYM_H
    +#define DTFMTSYM_H
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/calendar.h"
    +#include "unicode/uobject.h"
    +#include "unicode/locid.h"
    +#include "unicode/ures.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Symbols for formatting dates.
    + */
    +
    +U_NAMESPACE_BEGIN
    +
    +/* forward declaration */
    +class SimpleDateFormat;
    +class Hashtable;
    +class ZoneStringFormat;
    +class SafeZoneStringFormatPtr;
    +
    +/**
    + * DateFormatSymbols is a public class for encapsulating localizable date-time
    + * formatting data -- including timezone data. DateFormatSymbols is used by
    + * DateFormat and SimpleDateFormat.
    + * <P>
    + * Rather than first creating a DateFormatSymbols to get a date-time formatter
    + * by using a SimpleDateFormat constructor, clients are encouraged to create a
    + * date-time formatter using the getTimeInstance(), getDateInstance(), or
    + * getDateTimeInstance() method in DateFormat. Each of these methods can return a
    + * date/time formatter initialized with a default format pattern along with the
    + * date-time formatting data for a given or default locale. After a formatter is
    + * created, clients may modify the format pattern using the setPattern function
    + * as so desired. For more information on using these formatter factory
    + * functions, see DateFormat.
    + * <P>
    + * If clients decide to create a date-time formatter with a particular format
    + * pattern and locale, they can do so with new SimpleDateFormat(aPattern,
    + * new DateFormatSymbols(aLocale)). This will load the appropriate date-time
    + * formatting data from the locale.
    + * <P>
    + * DateFormatSymbols objects are clonable. When clients obtain a
    + * DateFormatSymbols object, they can feel free to modify the date-time
    + * formatting data as necessary. For instance, clients can
    + * replace the localized date-time format pattern characters with the ones that
    + * they feel easy to remember. Or they can change the representative cities
    + * originally picked by default to using their favorite ones.
    + * <P>
    + * DateFormatSymbols are not expected to be subclassed. Data for a calendar is
    + * loaded out of resource bundles. The 'type' parameter indicates the type of
    + * calendar, for example, "gregorian" or "japanese". If the type is not gregorian
    + * (or NULL, or an empty string) then the type is appended to the resource name,
    + * for example, 'Eras_japanese' instead of 'Eras'. If the resource 'Eras_japanese' did
    + * not exist (even in root), then this class will fall back to just 'Eras', that is,
    + * Gregorian data. Therefore, the calendar implementor MUST ensure that the root
    + * locale at least contains any resources that are to be particularized for the
    + * calendar type.
    + */
    +class U_I18N_API DateFormatSymbols : public UObject {
    +public:
    + /**
    + * Construct a DateFormatSymbols object by loading format data from
    + * resources for the default locale, in the default calendar (Gregorian).
    + * <P>
    + * NOTE: This constructor will never fail; if it cannot get resource
    + * data for the default locale, it will return a last-resort object
    + * based on hard-coded strings.
    + *
    + * @param status Status code. Failure
    + * results if the resources for the default cannot be
    + * found or cannot be loaded
    + * @stable ICU 2.0
    + */
    + DateFormatSymbols(UErrorCode& status);
    +
    + /**
    + * Construct a DateFormatSymbols object by loading format data from
    + * resources for the given locale, in the default calendar (Gregorian).
    + *
    + * @param locale Locale to load format data from.
    + * @param status Status code. Failure
    + * results if the resources for the locale cannot be
    + * found or cannot be loaded
    + * @stable ICU 2.0
    + */
    + DateFormatSymbols(const Locale& locale,
    + UErrorCode& status);
    +
    + /**
    + * Construct a DateFormatSymbols object by loading format data from
    + * resources for the default locale, in the default calendar (Gregorian).
    + * <P>
    + * NOTE: This constructor will never fail; if it cannot get resource
    + * data for the default locale, it will return a last-resort object
    + * based on hard-coded strings.
    + *
    + * @param type Type of calendar (as returned by Calendar::getType).
    + * Will be used to access the correct set of strings.
    + * (NULL or empty string defaults to "gregorian".)
    + * @param status Status code. Failure
    + * results if the resources for the default cannot be
    + * found or cannot be loaded
    + * @internal
    + */
    + DateFormatSymbols(const char *type, UErrorCode& status);
    +
    + /**
    + * Construct a DateFormatSymbols object by loading format data from
    + * resources for the given locale, in the default calendar (Gregorian).
    + *
    + * @param locale Locale to load format data from.
    + * @param type Type of calendar (as returned by Calendar::getType).
    + * Will be used to access the correct set of strings.
    + * (NULL or empty string defaults to "gregorian".)
    + * @param status Status code. Failure
    + * results if the resources for the locale cannot be
    + * found or cannot be loaded
    + * @internal
    + */
    + DateFormatSymbols(const Locale& locale,
    + const char *type,
    + UErrorCode& status);
    +
    + /**
    + * Copy constructor.
    + * @stable ICU 2.0
    + */
    + DateFormatSymbols(const DateFormatSymbols&);
    +
    + /**
    + * Assignment operator.
    + * @stable ICU 2.0
    + */
    + DateFormatSymbols& operator=(const DateFormatSymbols&);
    +
    + /**
    + * Destructor. This is nonvirtual because this class is not designed to be
    + * subclassed.
    + * @stable ICU 2.0
    + */
    + virtual ~DateFormatSymbols();
    +
    + /**
    + * Return true if another object is semantically equal to this one.
    + *
    + * @param other the DateFormatSymbols object to be compared with.
    + * @return true if other is semantically equal to this.
    + * @stable ICU 2.0
    + */
    + UBool operator==(const DateFormatSymbols& other) const;
    +
    + /**
    + * Return true if another object is semantically unequal to this one.
    + *
    + * @param other the DateFormatSymbols object to be compared with.
    + * @return true if other is semantically unequal to this.
    + * @stable ICU 2.0
    + */
    + UBool operator!=(const DateFormatSymbols& other) const { return !operator==(other); }
    +
    + /**
    + * Gets abbreviated era strings. For example: "AD" and "BC".
    + *
    + * @param count Filled in with length of the array.
    + * @return the era strings.
    + * @stable ICU 2.0
    + */
    + const UnicodeString* getEras(int32_t& count) const;
    +
    + /**
    + * Sets abbreviated era strings. For example: "AD" and "BC".
    + * @param eras Array of era strings (DateFormatSymbols retains ownership.)
    + * @param count Filled in with length of the array.
    + * @stable ICU 2.0
    + */
    + void setEras(const UnicodeString* eras, int32_t count);
    +
    + /**
    + * Gets era name strings. For example: "Anno Domini" and "Before Christ".
    + *
    + * @param count Filled in with length of the array.
    + * @return the era name strings.
    + * @stable ICU 3.4
    + */
    + const UnicodeString* getEraNames(int32_t& count) const;
    +
    + /**
    + * Sets era name strings. For example: "Anno Domini" and "Before Christ".
    + * @param eraNames Array of era name strings (DateFormatSymbols retains ownership.)
    + * @param count Filled in with length of the array.
    + * @stable ICU 3.6
    + */
    + void setEraNames(const UnicodeString* eraNames, int32_t count);
    +
    + /**
    + * Gets narrow era strings. For example: A" and "D".
    + *
    + * @param count Filled in with length of the array.
    + * @return the narrow era strings.
    + * @draft ICU 4.2
    + */
    + const UnicodeString* getNarrowEras(int32_t& count) const;
    +
    + /**
    + * Sets narrow era strings. For example: "A" and "B".
    + * @param narrowEras Array of narrow era strings (DateFormatSymbols retains ownership.)
    + * @param count Filled in with length of the array.
    + * @draft ICU 4.2
    + */
    + void setNarrowEras(const UnicodeString* narrowEras, int32_t count);
    +
    + /**
    + * Gets month strings. For example: "January", "February", etc.
    + * @param count Filled in with length of the array.
    + * @return the month strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 2.0
    + */
    + const UnicodeString* getMonths(int32_t& count) const;
    +
    + /**
    + * Sets month strings. For example: "January", "February", etc.
    + *
    + * @param months the new month strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @stable ICU 2.0
    + */
    + void setMonths(const UnicodeString* months, int32_t count);
    +
    + /**
    + * Gets short month strings. For example: "Jan", "Feb", etc.
    + *
    + * @param count Filled in with length of the array.
    + * @return the short month strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 2.0
    + */
    + const UnicodeString* getShortMonths(int32_t& count) const;
    +
    + /**
    + * Sets short month strings. For example: "Jan", "Feb", etc.
    + * @param count Filled in with length of the array.
    + * @param shortMonths the new short month strings. (not adopted; caller retains ownership)
    + * @stable ICU 2.0
    + */
    + void setShortMonths(const UnicodeString* shortMonths, int32_t count);
    +
    + /**
    + * Selector for date formatting context
    + * @stable ICU 3.6
    + */
    + enum DtContextType {
    + FORMAT,
    + STANDALONE,
    + DT_CONTEXT_COUNT
    + };
    +
    + /**
    + * Selector for date formatting width
    + * @stable ICU 3.6
    + */
    + enum DtWidthType {
    + ABBREVIATED,
    + WIDE,
    + NARROW,
    + DT_WIDTH_COUNT
    + };
    +
    + /**
    + * Gets month strings by width and context. For example: "January", "February", etc.
    + * @param count Filled in with length of the array.
    + * @param context The formatting context, either FORMAT or STANDALONE
    + * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
    + * @return the month strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 3.4
    + */
    + const UnicodeString* getMonths(int32_t& count, DtContextType context, DtWidthType width) const;
    +
    + /**
    + * Sets month strings by width and context. For example: "January", "February", etc.
    + *
    + * @param months The new month strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @param context The formatting context, either FORMAT or STANDALONE
    + * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
    + * @stable ICU 3.6
    + */
    + void setMonths(const UnicodeString* months, int32_t count, DtContextType context, DtWidthType width);
    +
    + /**
    + * Gets weekday strings. For example: "Sunday", "Monday", etc.
    + * @param count Filled in with length of the array.
    + * @return the weekday strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 2.0
    + */
    + const UnicodeString* getWeekdays(int32_t& count) const;
    +
    +
    + /**
    + * Sets weekday strings. For example: "Sunday", "Monday", etc.
    + * @param weekdays the new weekday strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @stable ICU 2.0
    + */
    + void setWeekdays(const UnicodeString* weekdays, int32_t count);
    +
    + /**
    + * Gets short weekday strings. For example: "Sun", "Mon", etc.
    + * @param count Filled in with length of the array.
    + * @return the short weekday strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 2.0
    + */
    + const UnicodeString* getShortWeekdays(int32_t& count) const;
    +
    + /**
    + * Sets short weekday strings. For example: "Sun", "Mon", etc.
    + * @param shortWeekdays the new short weekday strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @stable ICU 2.0
    + */
    + void setShortWeekdays(const UnicodeString* shortWeekdays, int32_t count);
    +
    + /**
    + * Gets weekday strings by width and context. For example: "Sunday", "Monday", etc.
    + * @param count Filled in with length of the array.
    + * @param context The formatting context, either FORMAT or STANDALONE
    + * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW
    + * @return the month strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 3.4
    + */
    + const UnicodeString* getWeekdays(int32_t& count, DtContextType context, DtWidthType width) const;
    +
    + /**
    + * Sets weekday strings by width and context. For example: "Sunday", "Monday", etc.
    + * @param weekdays The new weekday strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @param context The formatting context, either FORMAT or STANDALONE
    + * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW
    + * @stable ICU 3.6
    + */
    + void setWeekdays(const UnicodeString* weekdays, int32_t count, DtContextType context, DtWidthType width);
    +
    + /**
    + * Gets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
    + * @param count Filled in with length of the array.
    + * @param context The formatting context, either FORMAT or STANDALONE
    + * @param width The width of returned strings, either WIDE or ABBREVIATED. There
    + * are no NARROW quarters.
    + * @return the quarter strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 3.6
    + */
    + const UnicodeString* getQuarters(int32_t& count, DtContextType context, DtWidthType width) const;
    +
    + /**
    + * Sets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
    + *
    + * @param quarters The new quarter strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @param context The formatting context, either FORMAT or STANDALONE
    + * @param width The width of returned strings, either WIDE or ABBREVIATED. There
    + * are no NARROW quarters.
    + * @stable ICU 3.6
    + */
    + void setQuarters(const UnicodeString* quarters, int32_t count, DtContextType context, DtWidthType width);
    +
    + /**
    + * Gets AM/PM strings. For example: "AM" and "PM".
    + * @param count Filled in with length of the array.
    + * @return the weekday strings. (DateFormatSymbols retains ownership.)
    + * @stable ICU 2.0
    + */
    + const UnicodeString* getAmPmStrings(int32_t& count) const;
    +
    + /**
    + * Sets ampm strings. For example: "AM" and "PM".
    + * @param ampms the new ampm strings. (not adopted; caller retains ownership)
    + * @param count Filled in with length of the array.
    + * @stable ICU 2.0
    + */
    + void setAmPmStrings(const UnicodeString* ampms, int32_t count);
    +
    + /**
    + * Gets timezone strings. These strings are stored in a 2-dimensional array.
    + * @param rowCount Output param to receive number of rows.
    + * @param columnCount Output param to receive number of columns.
    + * @return The timezone strings as a 2-d array. (DateFormatSymbols retains ownership.)
    + * @deprecated ICU 3.6
    + */
    + const UnicodeString** getZoneStrings(int32_t& rowCount, int32_t& columnCount) const;
    +
    + /**
    + * Sets timezone strings. These strings are stored in a 2-dimensional array.
    + * @param strings The timezone strings as a 2-d array to be copied. (not adopted; caller retains ownership)
    + * @param rowCount The number of rows (count of first index).
    + * @param columnCount The number of columns (count of second index).
    + * @stable ICU 2.0
    + */
    + void setZoneStrings(const UnicodeString* const* strings, int32_t rowCount, int32_t columnCount);
    +
    + /**
    + * Get the non-localized date-time pattern characters.
    + * @return the non-localized date-time pattern characters
    + * @stable ICU 2.0
    + */
    + static const UChar * U_EXPORT2 getPatternUChars(void);
    +
    + /**
    + * Gets localized date-time pattern characters. For example: 'u', 't', etc.
    + * <p>
    + * Note: ICU no longer provides localized date-time pattern characters for a locale
    + * starting ICU 3.8. This method returns the non-localized date-time pattern
    + * characters unless user defined localized data is set by setLocalPatternChars.
    + * @param result Output param which will receive the localized date-time pattern characters.
    + * @return A reference to 'result'.
    + * @stable ICU 2.0
    + */
    + UnicodeString& getLocalPatternChars(UnicodeString& result) const;
    +
    + /**
    + * Sets localized date-time pattern characters. For example: 'u', 't', etc.
    + * @param newLocalPatternChars the new localized date-time
    + * pattern characters.
    + * @stable ICU 2.0
    + */
    + void setLocalPatternChars(const UnicodeString& newLocalPatternChars);
    +
    + /**
    + * Returns the locale for this object. Two flavors are available:
    + * valid and actual locale.
    + * @stable ICU 2.8
    + */
    + Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for the actual class.
    + *
    + * @stable ICU 2.2
    + */
    + virtual UClassID getDynamicClassID() const;
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for this class.
    + *
    + * @stable ICU 2.2
    + */
    + static UClassID U_EXPORT2 getStaticClassID();
    +
    +private:
    +
    + friend class SimpleDateFormat;
    + friend class DateFormatSymbolsSingleSetter; // see udat.cpp
    +
    + /**
    + * Abbreviated era strings. For example: "AD" and "BC".
    + */
    + UnicodeString* fEras;
    + int32_t fErasCount;
    +
    + /**
    + * Era name strings. For example: "Anno Domini" and "Before Christ".
    + */
    + UnicodeString* fEraNames;
    + int32_t fEraNamesCount;
    +
    + /**
    + * Narrow era strings. For example: "A" and "B".
    + */
    + UnicodeString* fNarrowEras;
    + int32_t fNarrowErasCount;
    +
    + /**
    + * Month strings. For example: "January", "February", etc.
    + */
    + UnicodeString* fMonths;
    + int32_t fMonthsCount;
    +
    + /**
    + * Short month strings. For example: "Jan", "Feb", etc.
    + */
    + UnicodeString* fShortMonths;
    + int32_t fShortMonthsCount;
    +
    + /**
    + * Narrow month strings. For example: "J", "F", etc.
    + */
    + UnicodeString* fNarrowMonths;
    + int32_t fNarrowMonthsCount;
    +
    + /**
    + * Standalone Month strings. For example: "January", "February", etc.
    + */
    + UnicodeString* fStandaloneMonths;
    + int32_t fStandaloneMonthsCount;
    +
    + /**
    + * Standalone Short month strings. For example: "Jan", "Feb", etc.
    + */
    + UnicodeString* fStandaloneShortMonths;
    + int32_t fStandaloneShortMonthsCount;
    +
    + /**
    + * Standalone Narrow month strings. For example: "J", "F", etc.
    + */
    + UnicodeString* fStandaloneNarrowMonths;
    + int32_t fStandaloneNarrowMonthsCount;
    +
    + /**
    + * Weekday strings. For example: "Sunday", "Monday", etc.
    + */
    + UnicodeString* fWeekdays;
    + int32_t fWeekdaysCount;
    +
    + /**
    + * Short weekday strings. For example: "Sun", "Mon", etc.
    + */
    + UnicodeString* fShortWeekdays;
    + int32_t fShortWeekdaysCount;
    +
    + /**
    + * Narrow weekday strings. For example: "Sun", "Mon", etc.
    + */
    + UnicodeString* fNarrowWeekdays;
    + int32_t fNarrowWeekdaysCount;
    +
    + /**
    + * Standalone Weekday strings. For example: "Sunday", "Monday", etc.
    + */
    + UnicodeString* fStandaloneWeekdays;
    + int32_t fStandaloneWeekdaysCount;
    +
    + /**
    + * Standalone Short weekday strings. For example: "Sun", "Mon", etc.
    + */
    + UnicodeString* fStandaloneShortWeekdays;
    + int32_t fStandaloneShortWeekdaysCount;
    +
    + /**
    + * Standalone Narrow weekday strings. For example: "Sun", "Mon", etc.
    + */
    + UnicodeString* fStandaloneNarrowWeekdays;
    + int32_t fStandaloneNarrowWeekdaysCount;
    +
    + /**
    + * Ampm strings. For example: "AM" and "PM".
    + */
    + UnicodeString* fAmPms;
    + int32_t fAmPmsCount;
    +
    + /**
    + * Quarter strings. For example: "1st quarter", "2nd quarter", etc.
    + */
    + UnicodeString *fQuarters;
    + int32_t fQuartersCount;
    +
    + /**
    + * Short quarters. For example: "Q1", "Q2", etc.
    + */
    + UnicodeString *fShortQuarters;
    + int32_t fShortQuartersCount;
    +
    + /**
    + * Standalone quarter strings. For example: "1st quarter", "2nd quarter", etc.
    + */
    + UnicodeString *fStandaloneQuarters;
    + int32_t fStandaloneQuartersCount;
    +
    + /**
    + * Standalone short quarter strings. For example: "Q1", "Q2", etc.
    + */
    + UnicodeString *fStandaloneShortQuarters;
    + int32_t fStandaloneShortQuartersCount;
    +
    + /**
    + * The format data of all the timezones in this locale.
    + */
    + UnicodeString **fZoneStrings; // Zone string array set by setZoneStrings
    + UnicodeString **fLocaleZoneStrings; // Zone string array created by the locale
    + int32_t fZoneStringsRowCount;
    + int32_t fZoneStringsColCount;
    +
    + const ZoneStringFormat *fZoneStringFormat;
    + ZoneStringFormat *fZSFLocal; // Local ZoneStringFormat instance
    + SafeZoneStringFormatPtr *fZSFCachePtr; // Cached ZoneStringFormat
    + Locale fZSFLocale; // Locale used for getting ZoneStringFormat
    +
    + /**
    + * Pattern string used for localized time zone GMT format. For example, "GMT{0}"
    + */
    + UnicodeString fGmtFormat;
    +
    + /**
    + * Pattern strings used for formatting zone offset in a localized time zone GMT string.
    + */
    + UnicodeString *fGmtHourFormats;
    + int32_t fGmtHourFormatsCount;
    +
    + enum GMTHourType {
    + GMT_NEGATIVE_HMS = 0,
    + GMT_NEGATIVE_HM,
    + GMT_POSITIVE_HMS,
    + GMT_POSITIVE_HM,
    + GMT_HOUR_COUNT
    + };
    +
    + /**
    + * Localized date-time pattern characters. For example: use 'u' as 'y'.
    + */
    + UnicodeString fLocalPatternChars;
    +
    +private:
    + /** valid/actual locale information
    + * these are always ICU locales, so the length should not be a problem
    + */
    + char validLocale[ULOC_FULLNAME_CAPACITY];
    + char actualLocale[ULOC_FULLNAME_CAPACITY];
    +
    + DateFormatSymbols(); // default constructor not implemented
    +
    + /**
    + * Called by the constructors to actually load data from the resources
    + *
    + * @param locale The locale to get symbols for.
    + * @param type Calendar Type (as from Calendar::getType())
    + * @param status Input/output parameter, set to success or
    + * failure code upon return.
    + * @param useLastResortData determine if use last resort data
    + */
    + void initializeData(const Locale&, const char *type, UErrorCode& status, UBool useLastResortData = FALSE);
    +
    + /**
    + * Copy or alias an array in another object, as appropriate.
    + *
    + * @param dstArray the copy destination array.
    + * @param dstCount fill in with the lenth of 'dstArray'.
    + * @param srcArray the source array to be copied.
    + * @param srcCount the length of items to be copied from the 'srcArray'.
    + */
    + static void assignArray(UnicodeString*& dstArray,
    + int32_t& dstCount,
    + const UnicodeString* srcArray,
    + int32_t srcCount);
    +
    + /**
    + * Return true if the given arrays' contents are equal, or if the arrays are
    + * identical (pointers are equal).
    + *
    + * @param array1 one array to be compared with.
    + * @param array2 another array to be compared with.
    + * @param count the length of items to be copied.
    + * @return true if the given arrays' contents are equal, or if the arrays are
    + * identical (pointers are equal).
    + */
    + static UBool arrayCompare(const UnicodeString* array1,
    + const UnicodeString* array2,
    + int32_t count);
    +
    + /**
    + * Create a copy, in fZoneStrings, of the given zone strings array. The
    + * member variables fZoneStringsRowCount and fZoneStringsColCount should be
    + * set already by the caller.
    + */
    + void createZoneStrings(const UnicodeString *const * otherStrings);
    +
    + /**
    + * Delete all the storage owned by this object.
    + */
    + void dispose(void);
    +
    + /**
    + * Copy all of the other's data to this.
    + * @param other the object to be copied.
    + */
    + void copyData(const DateFormatSymbols& other);
    +
    +
    + /**
    + * Returns a ZoneStringFormat, used only by SimpleDateFormat for now.
    + */
    + const ZoneStringFormat* getZoneStringFormat(void) const;
    +
    + /**
    + * Create a ZoneStringFormat by locale if not yet availble
    + */
    + void initZoneStringFormat(void);
    +
    + /**
    + * Create zone strings array by locale if not yet available
    + */
    + void initZoneStringsArray(void);
    +
    + /**
    + * Delete just the zone strings.
    + */
    + void disposeZoneStrings(void);
    +};
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // _DTFMTSYM
    +//eof

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/dtintrv.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/dtintrv.h b/platform/osx/icu/unicode/dtintrv.h
    new file mode 100644
    index 0000000..b55dcd4
    --- /dev/null
    +++ b/platform/osx/icu/unicode/dtintrv.h
    @@ -0,0 +1,159 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2008, International Business Machines Corporation and
    +* others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* File DTINTRV.H
    +*
    +*******************************************************************************
    +*/
    +
    +#ifndef __DTINTRV_H__
    +#define __DTINTRV_H__
    +
    +#include "unicode/utypes.h"
    +#include "unicode/uobject.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Date Interval data type
    + */
    +
    +
    +U_NAMESPACE_BEGIN
    +
    +
    +/**
    + * This class represents a date interval.
    + * It is a pair of UDate representing from UDate 1 to UDate 2.
    + * @draft ICU 4.0
    +**/
    +class U_COMMON_API DateInterval : public UObject {
    +public:
    +
    + /**
    + * Construct a DateInterval given a from date and a to date.
    + * @param fromDate The from date in date interval.
    + * @param toDate The to date in date interval.
    + * @draft ICU 4.0
    + */
    + DateInterval(UDate fromDate, UDate toDate);
    +
    + /**
    + * destructor
    + * @draft ICU 4.0
    + */
    + virtual ~DateInterval();
    +
    + /**
    + * Get the from date.
    + * @return the from date in dateInterval.
    + * @draft ICU 4.0
    + */
    + UDate getFromDate() const;
    +
    + /**
    + * Get the to date.
    + * @return the to date in dateInterval.
    + * @draft ICU 4.0
    + */
    + UDate getToDate() const;
    +
    +
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @draft ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @draft ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +
    +
    + /**
    + * Copy constructor.
    + * @draft ICU 4.0
    + */
    + DateInterval(const DateInterval& other);
    +
    + /**
    + * Default assignment operator
    + * @draft ICU 4.0
    + */
    + DateInterval& operator=(const DateInterval&);
    +
    + /**
    + * Equality operator.
    + * @return TRUE if the two DateIntervals are the same
    + * @draft ICU 4.0
    + */
    + virtual UBool operator==(const DateInterval& other) const;
    +
    + /**
    + * Non-equality operator
    + * @return TRUE if the two DateIntervals are not the same
    + * @draft ICU 4.0
    + */
    + UBool operator!=(const DateInterval& other) const;
    +
    +
    + /**
    + * clone this object.
    + * The caller owns the result and should delete it when done.
    + * @return a cloned DateInterval
    + * @draft ICU 4.0
    + */
    + virtual DateInterval* clone() const;
    +
    +private:
    + /**
    + * Default constructor, not implemented.
    + * @draft ICU 4.0
    + */
    + DateInterval();
    +
    + UDate fromDate;
    + UDate toDate;
    +
    +} ;// end class DateInterval
    +
    +
    +inline UDate
    +DateInterval::getFromDate() const {
    + return fromDate;
    +}
    +
    +
    +inline UDate
    +DateInterval::getToDate() const {
    + return toDate;
    +}
    +
    +
    +inline UBool
    +DateInterval::operator!=(const DateInterval& other) const {
    + return ( !operator==(other) );
    +}
    +
    +
    +U_NAMESPACE_END
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/dtitvfmt.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/dtitvfmt.h b/platform/osx/icu/unicode/dtitvfmt.h
    new file mode 100644
    index 0000000..2384437
    --- /dev/null
    +++ b/platform/osx/icu/unicode/dtitvfmt.h
    @@ -0,0 +1,949 @@
    +/********************************************************************************
    +* Copyright (C) 2008, International Business Machines Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* File DTITVFMT.H
    +*
    +*******************************************************************************
    +*/
    +
    +#ifndef __DTITVFMT_H__
    +#define __DTITVFMT_H__
    +
    +
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Format and parse date interval in a language-independent manner.
    + */
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/ucal.h"
    +#include "unicode/smpdtfmt.h"
    +#include "unicode/dtintrv.h"
    +#include "unicode/dtitvinf.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +
    +
    +/**
    + * DateIntervalFormat is a class for formatting and parsing date
    + * intervals in a language-independent manner.
    + * Date interval formatting is supported in Gregorian calendar only.
    + * And only formatting is supported. Parsing is not supported.
    + *
    + * <P>
    + * Date interval means from one date to another date,
    + * for example, from "Jan 11, 2008" to "Jan 18, 2008".
    + * We introduced class DateInterval to represent it.
    + * DateInterval is a pair of UDate, which is
    + * the standard milliseconds since 24:00 GMT, Jan 1, 1970.
    + *
    + * <P>
    + * DateIntervalFormat formats a DateInterval into
    + * text as compactly as possible.
    + * For example, the date interval format from "Jan 11, 2008" to "Jan 18,. 2008"
    + * is "Jan 11-18, 2008" for English.
    + * And it parses text into DateInterval,
    + * although initially, parsing is not supported.
    + *
    + * <P>
    + * There is no structural information in date time patterns.
    + * For any punctuations and string literals inside a date time pattern,
    + * we do not know whether it is just a separator, or a prefix, or a suffix.
    + * Without such information, so, it is difficult to generate a sub-pattern
    + * (or super-pattern) by algorithm.
    + * So, formatting a DateInterval is pattern-driven. It is very
    + * similar to formatting in SimpleDateFormat.
    + * We introduce class DateIntervalInfo to save date interval
    + * patterns, similar to date time pattern in SimpleDateFormat.
    + *
    + * <P>
    + * Logically, the interval patterns are mappings
    + * from (skeleton, the_largest_different_calendar_field)
    + * to (date_interval_pattern).
    + *
    + * <P>
    + * A skeleton
    + * <ol>
    + * <li>
    + * only keeps the field pattern letter and ignores all other parts
    + * in a pattern, such as space, punctuations, and string literals.
    + * </li>
    + * <li>
    + * hides the order of fields.
    + * </li>
    + * <li>
    + * might hide a field's pattern letter length.
    + * </li>
    + * </ol>
    + *
    + * For those non-digit calendar fields, the pattern letter length is
    + * important, such as MMM, MMMM, and MMMMM; EEE and EEEE,
    + * and the field's pattern letter length is honored.
    + *
    + * For the digit calendar fields, such as M or MM, d or dd, yy or yyyy,
    + * the field pattern length is ignored and the best match, which is defined
    + * in date time patterns, will be returned without honor the field pattern
    + * letter length in skeleton.
    + *
    + * <P>
    + * The calendar fields we support for interval formatting are:
    + * year, month, date, day-of-week, am-pm, hour, hour-of-day, and minute.
    + * Those calendar fields can be defined in the following order:
    + * year > month > date > hour (in day) > minute
    + *
    + * The largest different calendar fields between 2 calendars is the
    + * first different calendar field in above order.
    + *
    + * For example: the largest different calendar fields between "Jan 10, 2007"
    + * and "Feb 20, 2008" is year.
    + *
    + * <P>
    + * For other calendar fields, the compact interval formatting is not
    + * supported. And the interval format will be fall back to fall-back
    + * patterns, which is mostly "{date0} - {date1}".
    + *
    + * <P>
    + * There is a set of pre-defined static skeleton strings.
    + * There are pre-defined interval patterns for those pre-defined skeletons
    + * in locales' resource files.
    + * For example, for a skeleton UDAT_YEAR_ABBR_MONTH_DAY, which is "yMMMd",
    + * in en_US, if the largest different calendar field between date1 and date2
    + * is "year", the date interval pattern is "MMM d, yyyy - MMM d, yyyy",
    + * such as "Jan 10, 2007 - Jan 10, 2008".
    + * If the largest different calendar field between date1 and date2 is "month",
    + * the date interval pattern is "MMM d - MMM d, yyyy",
    + * such as "Jan 10 - Feb 10, 2007".
    + * If the largest different calendar field between date1 and date2 is "day",
    + * the date interval pattern is ""MMM d-d, yyyy", such as "Jan 10-20, 2007".
    + *
    + * For date skeleton, the interval patterns when year, or month, or date is
    + * different are defined in resource files.
    + * For time skeleton, the interval patterns when am/pm, or hour, or minute is
    + * different are defined in resource files.
    + *
    + * <P>
    + * If a skeleton is not found in a locale's DateIntervalInfo, which means
    + * the interval patterns for the skeleton is not defined in resource file,
    + * the interval pattern will falls back to the interval "fallback" pattern
    + * defined in resource file.
    + * If the interval "fallback" pattern is not defined, the default fall-back
    + * is "{date0} - {data1}".
    + *
    + * <P>
    + * For the combination of date and time,
    + * The rule to generate interval patterns are:
    + * <ol>
    + * <li>
    + * when the year, month, or day differs, falls back to fall-back
    + * interval pattern, which mostly is the concatenate the two original
    + * expressions with a separator between,
    + * For example, interval pattern from "Jan 10, 2007 10:10 am"
    + * to "Jan 11, 2007 10:10am" is
    + * "Jan 10, 2007 10:10 am - Jan 11, 2007 10:10am"
    + * </li>
    + * <li>
    + * otherwise, present the date followed by the range expression
    + * for the time.
    + * For example, interval pattern from "Jan 10, 2007 10:10 am"
    + * to "Jan 10, 2007 11:10am" is "Jan 10, 2007 10:10 am - 11:10am"
    + * </li>
    + * </ol>
    + *
    + *
    + * <P>
    + * If two dates are the same, the interval pattern is the single date pattern.
    + * For example, interval pattern from "Jan 10, 2007" to "Jan 10, 2007" is
    + * "Jan 10, 2007".
    + *
    + * Or if the presenting fields between 2 dates have the exact same values,
    + * the interval pattern is the single date pattern.
    + * For example, if user only requests year and month,
    + * the interval pattern from "Jan 10, 2007" to "Jan 20, 2007" is "Jan 2007".
    + *
    + * <P>
    + * DateIntervalFormat needs the following information for correct
    + * formatting: time zone, calendar type, pattern, date format symbols,
    + * and date interval patterns.
    + * It can be instantiated in 2 ways:
    + * <ol>
    + * <li>
    + * create an instance using default or given locale plus given skeleton.
    + * Users are encouraged to created date interval formatter this way and
    + * to use the pre-defined skeleton macros, such as
    + * UDAT_YEAR_NUM_MONTH, which consists the calendar fields and
    + * the format style.
    + * </li>
    + * <li>
    + * create an instance using default or given locale plus given skeleton
    + * plus a given DateIntervalInfo.
    + * This factory method is for powerful users who want to provide their own
    + * interval patterns.
    + * Locale provides the timezone, calendar, and format symbols information.
    + * Local plus skeleton provides full pattern information.
    + * DateIntervalInfo provides the date interval patterns.
    + * </li>
    + * </ol>
    + *
    + * <P>
    + * For the calendar field pattern letter, such as G, y, M, d, a, h, H, m, s etc.
    + * DateIntervalFormat uses the same syntax as that of
    + * DateTime format.
    + *
    + * <P>
    + * Code Sample: general usage
    + * <pre>
    + * \code
    + * // the date interval object which the DateIntervalFormat formats on
    + * // and parses into
    + * DateInterval* dtInterval = new DateInterval(1000*3600*24, 1000*3600*24*2);
    + * UErrorCode status = U_ZERO_ERROR;
    + * DateIntervalFormat* dtIntervalFmt = DateIntervalFormat::createInstance(
    + * UDAT_YEAR_MONTH_DAY,
    + * Locale("en", "GB", ""), status);
    + * UnicodeUnicodeString dateIntervalString;
    + * FieldPosition pos = 0;
    + * // formatting
    + * dtIntervalFmt->format(dtInterval, dateIntervalUnicodeString, pos, status);
    + * delete dtIntervalFmt;
    + * \endcode
    + * </pre>
    + */
    +
    +class U_I18N_API DateIntervalFormat : public Format {
    +public:
    +
    + /**
    + * Construct a DateIntervalFormat from skeleton and the default locale.
    + *
    + * This is a convenient override of
    + * createInstance(const UnicodeString& skeleton, const Locale& locale,
    + * UErrorCode&)
    + * with the value of locale as default locale.
    + *
    + * @param skeleton the skeleton on which interval format based.
    + * @param status output param set to success/failure code on exit
    + * @return a date time interval formatter which the caller owns.
    + * @draft ICU 4.0
    + */
    + static DateIntervalFormat* U_EXPORT2 createInstance(
    + const UnicodeString& skeleton,
    + UErrorCode& status);
    +
    + /**
    + * Construct a DateIntervalFormat from skeleton and a given locale.
    + * <P>
    + * In this factory method,
    + * the date interval pattern information is load from resource files.
    + * Users are encouraged to created date interval formatter this way and
    + * to use the pre-defined skeleton macros.
    + *
    + * <P>
    + * There are pre-defined skeletons (defined in udate.h) having predefined
    + * interval patterns in resource files.
    + * Users are encouraged to use those macros.
    + * For example:
    + * DateIntervalFormat::createInstance(UDAT_MONTH_DAY, status)
    + *
    + * The given Locale provides the interval patterns.
    + * For example, for en_GB, if skeleton is UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY,
    + * which is "yMMMEEEd",
    + * the interval patterns defined in resource file to above skeleton are:
    + * "EEE, d MMM, yyyy - EEE, d MMM, yyyy" for year differs,
    + * "EEE, d MMM - EEE, d MMM, yyyy" for month differs,
    + * "EEE, d - EEE, d MMM, yyyy" for day differs,
    + * @param skeleton the skeleton on which interval format based.
    + * @param locale the given locale
    + * @param status output param set to success/failure code on exit
    + * @return a date time interval formatter which the caller owns.
    + * @draft ICU 4.0
    + */
    +
    + static DateIntervalFormat* U_EXPORT2 createInstance(
    + const UnicodeString& skeleton,
    + const Locale& locale,
    + UErrorCode& status);
    +
    + /**
    + * Construct a DateIntervalFormat from skeleton
    + * DateIntervalInfo, and default locale.
    + *
    + * This is a convenient override of
    + * createInstance(const UnicodeString& skeleton, const Locale& locale,
    + * const DateIntervalInfo& dtitvinf, UErrorCode&)
    + * with the locale value as default locale.
    + *
    + * @param skeleton the skeleton on which interval format based.
    + * @param dtitvinf the DateIntervalInfo object.
    + * @param status output param set to success/failure code on exit
    + * @return a date time interval formatter which the caller owns.
    + * @draft ICU 4.0
    + */
    + static DateIntervalFormat* U_EXPORT2 createInstance(
    + const UnicodeString& skeleton,
    + const DateIntervalInfo& dtitvinf,
    + UErrorCode& status);
    +
    + /**
    + * Construct a DateIntervalFormat from skeleton
    + * a DateIntervalInfo, and the given locale.
    + *
    + * <P>
    + * In this factory method, user provides its own date interval pattern
    + * information, instead of using those pre-defined data in resource file.
    + * This factory method is for powerful users who want to provide their own
    + * interval patterns.
    + * <P>
    + * There are pre-defined skeletons (defined in udate.h) having predefined
    + * interval patterns in resource files.
    + * Users are encouraged to use those macros.
    + * For example:
    + * DateIntervalFormat::createInstance(UDAT_MONTH_DAY, status)
    + *
    + * The DateIntervalInfo provides the interval patterns.
    + * and the DateIntervalInfo ownership remains to the caller.
    + *
    + * User are encouraged to set default interval pattern in DateIntervalInfo
    + * as well, if they want to set other interval patterns ( instead of
    + * reading the interval patterns from resource files).
    + * When the corresponding interval pattern for a largest calendar different
    + * field is not found ( if user not set it ), interval format fallback to
    + * the default interval pattern.
    + * If user does not provide default interval pattern, it fallback to
    + * "{date0} - {date1}"
    + *
    + * @param skeleton the skeleton on which interval format based.
    + * @param locale the given locale
    + * @param dtitvinf the DateIntervalInfo object.
    + * @param status output param set to success/failure code on exit
    + * @return a date time interval formatter which the caller owns.
    + * @draft ICU 4.0
    + */
    + static DateIntervalFormat* U_EXPORT2 createInstance(
    + const UnicodeString& skeleton,
    + const Locale& locale,
    + const DateIntervalInfo& dtitvinf,
    + UErrorCode& status);
    +
    + /**
    + * Destructor.
    + * @draft ICU 4.0
    + */
    + virtual ~DateIntervalFormat();
    +
    + /**
    + * Clone this Format object polymorphically. The caller owns the result and
    + * should delete it when done.
    + * @return A copy of the object.
    + * @draft ICU 4.0
    + */
    + virtual Format* clone(void) const;
    +
    + /**
    + * Return true if the given Format objects are semantically equal. Objects
    + * of different subclasses are considered unequal.
    + * @param other the object to be compared with.
    + * @return true if the given Format objects are semantically equal.
    + * @draft ICU 4.0
    + */
    + virtual UBool operator==(const Format& other) const;
    +
    + /**
    + * Return true if the given Format objects are not semantically equal.
    + * Objects of different subclasses are considered unequal.
    + * @param other the object to be compared with.
    + * @return true if the given Format objects are not semantically equal.
    + * @draft ICU 4.0
    + */
    + UBool operator!=(const Format& other) const;
    +
    + /**
    + * Format an object to produce a string. This method handles Formattable
    + * objects with a DateInterval type.
    + * If a the Formattable object type is not a DateInterval,
    + * then it returns a failing UErrorCode.
    + *
    + * @param obj The object to format.
    + * Must be a DateInterval.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param fieldPosition On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param status Output param filled with success/failure status.
    + * @return Reference to 'appendTo' parameter.
    + * @draft ICU 4.0
    + */
    + virtual UnicodeString& format(const Formattable& obj,
    + UnicodeString& appendTo,
    + FieldPosition& fieldPosition,
    + UErrorCode& status) const ;
    +
    +
    +
    + /**
    + * Format a DateInterval to produce a string.
    + *
    + * @param dtInterval DateInterval to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param fieldPosition On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param status Output param filled with success/failure status.
    + * @return Reference to 'appendTo' parameter.
    + * @draft ICU 4.0
    + */
    + UnicodeString& format(const DateInterval* dtInterval,
    + UnicodeString& appendTo,
    + FieldPosition& fieldPosition,
    + UErrorCode& status) const ;
    +
    +
    + /**
    + * Format 2 Calendars to produce a string.
    + *
    + * Note: "fromCalendar" and "toCalendar" are not const,
    + * since calendar is not const in SimpleDateFormat::format(Calendar&),
    + *
    + * @param fromCalendar calendar set to the from date in date interval
    + * to be formatted into date interval string
    + * @param toCalendar calendar set to the to date in date interval
    + * to be formatted into date interval string
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param fieldPosition On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param status Output param filled with success/failure status.
    + * Caller needs to make sure it is SUCCESS
    + * at the function entrance
    + * @return Reference to 'appendTo' parameter.
    + * @draft ICU 4.0
    + */
    + UnicodeString& format(Calendar& fromCalendar,
    + Calendar& toCalendar,
    + UnicodeString& appendTo,
    + FieldPosition& fieldPosition,
    + UErrorCode& status) const ;
    +
    + /**
    + * Date interval parsing is not supported. Please do not use.
    + * <P>
    + * This method should handle parsing of
    + * date time interval strings into Formattable objects with
    + * DateInterval type, which is a pair of UDate.
    + * <P>
    + * Before calling, set parse_pos.index to the offset you want to start
    + * parsing at in the source. After calling, parse_pos.index is the end of
    + * the text you parsed. If error occurs, index is unchanged.
    + * <P>
    + * When parsing, leading whitespace is discarded (with a successful parse),
    + * while trailing whitespace is left as is.
    + * <P>
    + * See Format::parseObject() for more.
    + *
    + * @param source The string to be parsed into an object.
    + * @param result Formattable to be set to the parse result.
    + * If parse fails, return contents are undefined.
    + * @param parse_pos The position to start parsing at. Since no parsing
    + * is supported, upon return this param is unchanged.
    + * @return A newly created Formattable* object, or NULL
    + * on failure. The caller owns this and should
    + * delete it when done.
    + * @internal ICU 4.0
    + */
    + virtual void parseObject(const UnicodeString& source,
    + Formattable& result,
    + ParsePosition& parse_pos) const;
    +
    +
    + /**
    + * Gets the date time interval patterns.
    + * @return the date time interval patterns associated with
    + * this date interval formatter.
    + * @draft ICU 4.0
    + */
    + const DateIntervalInfo* getDateIntervalInfo(void) const;
    +
    +
    + /**
    + * Set the date time interval patterns.
    + * @param newIntervalPatterns the given interval patterns to copy.
    + * @param status output param set to success/failure code on exit
    + * @draft ICU 4.0
    + */
    + void setDateIntervalInfo(const DateIntervalInfo& newIntervalPatterns,
    + UErrorCode& status);
    +
    +
    + /**
    + * Gets the date formatter
    + * @return the date formatter associated with this date interval formatter.
    + * @draft ICU 4.0
    + */
    + const DateFormat* getDateFormat(void) const;
    +
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @draft ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @draft ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +
    +protected:
    +
    + /**
    + * Copy constructor.
    + * @draft ICU 4.0
    + */
    + DateIntervalFormat(const DateIntervalFormat&);
    +
    + /**
    + * Assignment operator.
    + * @draft ICU 4.0
    + */
    + DateIntervalFormat& operator=(const DateIntervalFormat&);
    +
    +private:
    +
    + /*
    + * This is for ICU internal use only. Please do not use.
    + * Save the interval pattern information.
    + * Interval pattern consists of 2 single date patterns and the separator.
    + * For example, interval pattern "MMM d - MMM d, yyyy" consists
    + * a single date pattern "MMM d", another single date pattern "MMM d, yyyy",
    + * and a separator "-".
    + * The pattern is divided into 2 parts. For above example,
    + * the first part is "MMM d - ", and the second part is "MMM d, yyyy".
    + * Also, the first date appears in an interval pattern could be
    + * the earlier date or the later date.
    + * And such information is saved in the interval pattern as well.
    + * @internal ICU 4.0
    + */
    + struct PatternInfo {
    + UnicodeString firstPart;
    + UnicodeString secondPart;
    + /**
    + * Whether the first date in interval pattern is later date or not.
    + * Fallback format set the default ordering.
    + * And for a particular interval pattern, the order can be
    + * overriden by prefixing the interval pattern with "latestFirst:" or
    + * "earliestFirst:"
    + * For example, given 2 date, Jan 10, 2007 to Feb 10, 2007.
    + * if the fallback format is "{0} - {1}",
    + * and the pattern is "d MMM - d MMM yyyy", the interval format is
    + * "10 Jan - 10 Feb, 2007".
    + * If the pattern is "latestFirst:d MMM - d MMM yyyy",
    + * the interval format is "10 Feb - 10 Jan, 2007"
    + */
    + UBool laterDateFirst;
    + };
    +
    +
    + /**
    + * default constructor
    + * @internal ICU 4.0
    + */
    + DateIntervalFormat();
    +
    + /**
    + * Construct a DateIntervalFormat from DateFormat,
    + * a DateIntervalInfo, and skeleton.
    + * DateFormat provides the timezone, calendar,
    + * full pattern, and date format symbols information.
    + * It should be a SimpleDateFormat object which
    + * has a pattern in it.
    + * the DateIntervalInfo provides the interval patterns.
    + *
    + * Note: the DateIntervalFormat takes ownership of both
    + * DateFormat and DateIntervalInfo objects.
    + * Caller should not delete them.
    + *
    + * @param dtfmt the SimpleDateFormat object to be adopted.
    + * @param dtitvinf the DateIntervalInfo object to be adopted.
    + * @param skeleton the skeleton of the date formatter
    + * @param status output param set to success/failure code on exit
    + * @internal ICU 4.0
    + */
    + DateIntervalFormat(DateFormat* dtfmt, DateIntervalInfo* dtItvInfo,
    + const UnicodeString* skeleton, UErrorCode& status);
    +
    +
    + /**
    + * Construct a DateIntervalFormat from DateFormat
    + * and a DateIntervalInfo.
    + *
    + * It is a wrapper of the constructor.
    + *
    + * @param dtfmt the DateFormat object to be adopted.
    + * @param dtitvinf the DateIntervalInfo object to be adopted.
    + * @param skeleton the skeleton of this formatter.
    + * @param status Output param set to success/failure code.
    + * @return a date time interval formatter which the caller owns.
    + * @internal ICU 4.0
    + */
    + static DateIntervalFormat* U_EXPORT2 create(DateFormat* dtfmt,
    + DateIntervalInfo* dtitvinf,
    + const UnicodeString* skeleton,
    + UErrorCode& status);
    +
    +
    + /**
    + * Below are for generating interval patterns locale to the formatter
    + */
    +
    +
    + /**
    + * Format 2 Calendars using fall-back interval pattern
    + *
    + * The full pattern used in this fall-back format is the
    + * full pattern of the date formatter.
    + *
    + * @param fromCalendar calendar set to the from date in date interval
    + * to be formatted into date interval string
    + * @param toCalendar calendar set to the to date in date interval
    + * to be formatted into date interval string
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param status output param set to success/failure code on exit
    + * @return Reference to 'appendTo' parameter.
    + * @internal ICU 4.0
    + */
    + UnicodeString& fallbackFormat(Calendar& fromCalendar,
    + Calendar& toCalendar,
    + UnicodeString& appendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    +
    +
    +
    + /**
    + * Initialize interval patterns locale to this formatter
    + *
    + * This code is a bit complicated since
    + * 1. the interval patterns saved in resource bundle files are interval
    + * patterns based on date or time only.
    + * It does not have interval patterns based on both date and time.
    + * Interval patterns on both date and time are algorithm generated.
    + *
    + * For example, it has interval patterns on skeleton "dMy" and "hm",
    + * but it does not have interval patterns on skeleton "dMyhm".
    + *
    + * The rule to generate interval patterns for both date and time skeleton are
    + * 1) when the year, month, or day differs, concatenate the two original
    + * expressions with a separator between,
    + * For example, interval pattern from "Jan 10, 2007 10:10 am"
    + * to "Jan 11, 2007 10:10am" is
    + * "Jan 10, 2007 10:10 am - Jan 11, 2007 10:10am"
    + *
    + * 2) otherwise, present the date followed by the range expression
    + * for the time.
    + * For example, interval pattern from "Jan 10, 2007 10:10 am"
    + * to "Jan 10, 2007 11:10am" is
    + * "Jan 10, 2007 10:10 am - 11:10am"
    + *
    + * 2. even a pattern does not request a certain calendar field,
    + * the interval pattern needs to include such field if such fields are
    + * different between 2 dates.
    + * For example, a pattern/skeleton is "hm", but the interval pattern
    + * includes year, month, and date when year, month, and date differs.
    + *
    + *
    + * @param status output param set to success/failure code on exit
    + * @internal ICU 4.0
    + */
    + void initializePattern(UErrorCode& status);
    +
    +
    +
    + /**
    + * Set fall back interval pattern given a calendar field,
    + * a skeleton, and a date time pattern generator.
    + * @param field the largest different calendar field
    + * @param skeleton a skeleton
    + * @param dtpng date time pattern generator
    + * @param status output param set to success/failure code on exit
    + * @internal ICU 4.0
    + */
    + void setFallbackPattern(UCalendarDateFields field,
    + const UnicodeString& skeleton,
    + DateTimePatternGenerator* dtpng,
    + UErrorCode& status);
    +
    +
    +
    + /**
    + * get separated date and time skeleton from a combined skeleton.
    + *
    + * The difference between date skeleton and normalizedDateSkeleton are:
    + * 1. both 'y' and 'd' are appeared only once in normalizeDateSkeleton
    + * 2. 'E' and 'EE' are normalized into 'EEE'
    + * 3. 'MM' is normalized into 'M'
    + *
    + ** the difference between time skeleton and normalizedTimeSkeleton are:
    + * 1. both 'H' and 'h' are normalized as 'h' in normalized time skeleton,
    + * 2. 'a' is omitted in normalized time skeleton.
    + * 3. there is only one appearance for 'h', 'm','v', 'z' in normalized time
    + * skeleton
    + *
    + *
    + * @param skeleton given combined skeleton.
    + * @param date Output parameter for date only skeleton.
    + * @param normalizedDate Output parameter for normalized date only
    + *
    + * @param time Output parameter for time only skeleton.
    + * @param normalizedTime Output parameter for normalized time only
    + * skeleton.
    + *
    + * @internal ICU 4.0
    + */
    + static void U_EXPORT2 getDateTimeSkeleton(const UnicodeString& skeleton,
    + UnicodeString& date,
    + UnicodeString& normalizedDate,
    + UnicodeString& time,
    + UnicodeString& normalizedTime);
    +
    +
    +
    + /**
    + * Generate date or time interval pattern from resource,
    + * and set them into the interval pattern locale to this formatter.
    + *
    + * It needs to handle the following:
    + * 1. need to adjust field width.
    + * For example, the interval patterns saved in DateIntervalInfo
    + * includes "dMMMy", but not "dMMMMy".
    + * Need to get interval patterns for dMMMMy from dMMMy.
    + * Another example, the interval patterns saved in DateIntervalInfo
    + * includes "hmv", but not "hmz".
    + * Need to get interval patterns for "hmz' from 'hmv'
    + *
    + * 2. there might be no pattern for 'y' differ for skeleton "Md",
    + * in order to get interval patterns for 'y' differ,
    + * need to look for it from skeleton 'yMd'
    + *
    + * @param dateSkeleton normalized date skeleton
    + * @param timeSkeleton normalized time skeleton
    + * @return whether the resource is found for the skeleton.
    + * TRUE if interval pattern found for the skeleton,
    + * FALSE otherwise.
    + * @internal ICU 4.0
    + */
    + UBool setSeparateDateTimePtn(const UnicodeString& dateSkeleton,
    + const UnicodeString& timeSkeleton);
    +
    +
    +
    +
    + /**
    + * Generate interval pattern from existing resource
    + *
    + * It not only save the interval patterns,
    + * but also return the extended skeleton and its best match skeleton.
    + *
    + * @param field largest different calendar field
    + * @param skeleton skeleton
    + * @param bestSkeleton the best match skeleton which has interval pattern
    + * defined in resource
    + * @param differenceInfo the difference between skeleton and best skeleton
    + * 0 means the best matched skeleton is the same as input skeleton
    + * 1 means the fields are the same, but field width are different
    + * 2 means the only difference between fields are v/z,
    + * -1 means there are other fields difference
    + *
    + * @param extendedSkeleton extended skeleton
    + * @param extendedBestSkeleton extended best match skeleton
    + * @return whether the interval pattern is found
    + * through extending skeleton or not.
    + * TRUE if interval pattern is found by
    + * extending skeleton, FALSE otherwise.
    + * @internal ICU 4.0
    + */
    + UBool setIntervalPattern(UCalendarDateFields field,
    + const UnicodeString* skeleton,
    + const UnicodeString* bestSkeleton,
    + int8_t differenceInfo,
    + UnicodeString* extendedSkeleton = NULL,
    + UnicodeString* extendedBestSkeleton = NULL);
    +
    + /**
    + * Adjust field width in best match interval pattern to match
    + * the field width in input skeleton.
    + *
    + * TODO (xji) make a general solution
    + * The adjusting rule can be:
    + * 1. always adjust
    + * 2. never adjust
    + * 3. default adjust, which means adjust according to the following rules
    + * 3.1 always adjust string, such as MMM and MMMM
    + * 3.2 never adjust between string and numeric, such as MM and MMM
    + * 3.3 always adjust year
    + * 3.4 do not adjust 'd', 'h', or 'm' if h presents
    + * 3.5 do not adjust 'M' if it is numeric(?)
    + *
    + * Since date interval format is well-formed format,
    + * date and time skeletons are normalized previously,
    + * till this stage, the adjust here is only "adjust strings, such as MMM
    + * and MMMM, EEE and EEEE.
    + *
    + * @param inputSkeleton the input skeleton
    + * @param bestMatchSkeleton the best match skeleton
    + * @param bestMatchIntervalpattern the best match interval pattern
    + * @param differenceInfo the difference between 2 skeletons
    + * 1 means only field width differs
    + * 2 means v/z exchange
    + * @param adjustedIntervalPattern adjusted interval pattern
    + * @internal ICU 4.0
    + */
    + static void U_EXPORT2 adjustFieldWidth(
    + const UnicodeString& inputSkeleton,
    + const UnicodeString& bestMatchSkeleton,
    + const UnicodeString& bestMatchIntervalPattern,
    + int8_t differenceInfo,
    + UnicodeString& adjustedIntervalPattern);
    +
    + /**
    + * Concat a single date pattern with a time interval pattern,
    + * set it into the intervalPatterns, while field is time field.
    + * This is used to handle time interval patterns on skeleton with
    + * both time and date. Present the date followed by
    + * the range expression for the time.
    + * @param format date and time format
    + * @param formatLen format string length
    + * @param datePattern date pattern
    + * @param field time calendar field: AM_PM, HOUR, MINUTE
    + * @param status output param set to success/failure code on exit
    + * @internal ICU 4.0
    + */
    + void concatSingleDate2TimeInterval(const UChar* format,
    + int32_t formatLen,
    + const UnicodeString& datePattern,
    + UCalendarDateFields field,
    + UErrorCode& status);
    +
    + /**
    + * check whether a calendar field present in a skeleton.
    + * @param field calendar field need to check
    + * @param skeleton given skeleton on which to check the calendar field
    + * @return true if field present in a skeleton.
    + * @internal ICU 4.0
    + */
    + static UBool U_EXPORT2 fieldExistsInSkeleton(UCalendarDateFields field,
    + const UnicodeString& skeleton);
    +
    +
    + /**
    + * Split interval patterns into 2 part.
    + * @param intervalPattern interval pattern
    + * @return the index in interval pattern which split the pattern into 2 part
    + * @internal ICU 4.0
    + */
    + static int32_t U_EXPORT2 splitPatternInto2Part(const UnicodeString& intervalPattern);
    +
    +
    + /**
    + * Break interval patterns as 2 part and save them into pattern info.
    + * @param field calendar field
    + * @param intervalPattern interval pattern
    + * @internal ICU 4.0
    + */
    + void setIntervalPattern(UCalendarDateFields field,
    + const UnicodeString& intervalPattern);
    +
    +
    + /**
    + * Break interval patterns as 2 part and save them into pattern info.
    + * @param field calendar field
    + * @param intervalPattern interval pattern
    + * @param laterDateFirst whether later date appear first in interval pattern
    + * @internal ICU 4.0
    + */
    + void setIntervalPattern(UCalendarDateFields field,
    + const UnicodeString& intervalPattern,
    + UBool laterDateFirst);
    +
    +
    + /**
    + * Set pattern information.
    + *
    + * @param field calendar field
    + * @param firstPart the first part in interval pattern
    + * @param secondPart the second part in interval pattern
    + * @param laterDateFirst whether the first date in intervalPattern
    + * is earlier date or later date
    + * @internal ICU 4.0
    + */
    + void setPatternInfo(UCalendarDateFields field,
    + const UnicodeString* firstPart,
    + const UnicodeString* secondpart,
    + UBool laterDateFirst);
    +
    +
    + // from calendar field to pattern letter
    + static const UChar fgCalendarFieldToPatternLetter[];
    +
    +
    + /**
    + * The interval patterns for this locale.
    + */
    + DateIntervalInfo* fInfo;
    +
    + /**
    + * The DateFormat object used to format single pattern
    + */
    + SimpleDateFormat* fDateFormat;
    +
    + /**
    + * The 2 calendars with the from and to date.
    + * could re-use the calendar in fDateFormat,
    + * but keeping 2 calendars make it clear and clean.
    + */
    + Calendar* fFromCalendar;
    + Calendar* fToCalendar;
    +
    + /**
    + * Following are interval information relavent (locale) to this formatter.
    + */
    + UnicodeString fSkeleton;
    + PatternInfo fIntervalPatterns[DateIntervalInfo::kIPI_MAX_INDEX];
    +};
    +
    +
    +
    +
    +
    +
    +inline UBool
    +DateIntervalFormat::operator!=(const Format& other) const {
    + return !operator==(other);
    +}
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // _DTITVFMT_H__
    +//eof
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/udata.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/udata.h b/platform/osx/icu/unicode/udata.h
    new file mode 100644
    index 0000000..84046d5
    --- /dev/null
    +++ b/platform/osx/icu/unicode/udata.h
    @@ -0,0 +1,389 @@
    +/*
    +******************************************************************************
    +*
    +* Copyright (C) 1999-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +******************************************************************************
    +* file name: udata.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* created on: 1999oct25
    +* created by: Markus W. Scherer
    +*/
    +
    +#ifndef __UDATA_H__
    +#define __UDATA_H__
    +
    +#include "unicode/utypes.h"
    +
    +U_CDECL_BEGIN
    +
    +/**
    + * \file
    + * \brief C API: Data loading interface
    + *
    + * <h2>Information about data loading interface</h2>
    + *
    + * This API is used to find and efficiently load data for ICU and applications
    + * using ICU. It provides an abstract interface that specifies a data type and
    + * name to find and load the data. Normally this API is used by other ICU APIs
    + * to load required data out of the ICU data library, but it can be used to
    + * load data out of other places.
    + *
    + * See the User Guide Data Management chapter.
    + */
    +
    +#ifndef U_HIDE_INTERNAL_API
    +/**
    + * Character used to separate package names from tree names
    + * @internal ICU 3.0
    + */
    +#define U_TREE_SEPARATOR '-'
    +
    +/**
    + * String used to separate package names from tree names
    + * @internal ICU 3.0
    + */
    +#define U_TREE_SEPARATOR_STRING "-"
    +
    +/**
    + * Character used to separate parts of entry names
    + * @internal ICU 3.0
    + */
    +#define U_TREE_ENTRY_SEP_CHAR '/'
    +
    +/**
    + * String used to separate parts of entry names
    + * @internal ICU 3.0
    + */
    +#define U_TREE_ENTRY_SEP_STRING "/"
    +
    +/**
    + * Alias for standard ICU data
    + * @internal ICU 3.0
    + */
    +#define U_ICUDATA_ALIAS "ICUDATA"
    +
    +#endif /* U_HIDE_INTERNAL_API */
    +
    +/**
    + * UDataInfo contains the properties about the requested data.
    + * This is meta data.
    + *
    + * <p>This structure may grow in the future, indicated by the
    + * <code>size</code> field.</p>
    + *
    + * <p>The platform data property fields help determine if a data
    + * file can be efficiently used on a given machine.
    + * The particular fields are of importance only if the data
    + * is affected by the properties - if there is integer data
    + * with word sizes > 1 byte, char* text, or UChar* text.</p>
    + *
    + * <p>The implementation for the <code>udata_open[Choice]()</code>
    + * functions may reject data based on the value in <code>isBigEndian</code>.
    + * No other field is used by the <code>udata</code> API implementation.</p>
    + *
    + * <p>The <code>dataFormat</code> may be used to identify
    + * the kind of data, e.g. a converter table.</p>
    + *
    + * <p>The <code>formatVersion</code> field should be used to
    + * make sure that the format can be interpreted.
    + * I may be a good idea to check only for the one or two highest
    + * of the version elements to allow the data memory to
    + * get more or somewhat rearranged contents, for as long
    + * as the using code can still interpret the older contents.</p>
    + *
    + * <p>The <code>dataVersion</code> field is intended to be a
    + * common place to store the source version of the data;
    + * for data from the Unicode character database, this could
    + * reflect the Unicode version.</p>
    + * @stable ICU 2.0
    + */
    +typedef struct {
    + /** sizeof(UDataInfo)
    + * @stable ICU 2.0 */
    + uint16_t size;
    +
    + /** unused, set to 0
    + * @stable ICU 2.0*/
    + uint16_t reservedWord;
    +
    + /* platform data properties */
    + /** 0 for little-endian machine, 1 for big-endian
    + * @stable ICU 2.0 */
    + uint8_t isBigEndian;
    +
    + /** see U_CHARSET_FAMILY values in utypes.h
    + * @stable ICU 2.0*/
    + uint8_t charsetFamily;
    +
    + /** sizeof(UChar), one of { 1, 2, 4 }
    + * @stable ICU 2.0*/
    + uint8_t sizeofUChar;
    +
    + /** unused, set to 0
    + * @stable ICU 2.0*/
    + uint8_t reservedByte;
    +
    + /** data format identifier
    + * @stable ICU 2.0*/
    + uint8_t dataFormat[4];
    +
    + /** versions: [0] major [1] minor [2] milli [3] micro
    + * @stable ICU 2.0*/
    + uint8_t formatVersion[4];
    +
    + /** versions: [0] major [1] minor [2] milli [3] micro
    + * @stable ICU 2.0*/
    + uint8_t dataVersion[4];
    +} UDataInfo;
    +
    +/* API for reading data -----------------------------------------------------*/
    +
    +/**
    + * Forward declaration of the data memory type.
    + * @stable ICU 2.0
    + */
    +typedef struct UDataMemory UDataMemory;
    +
    +/**
    + * Callback function for udata_openChoice().
    + * @param context parameter passed into <code>udata_openChoice()</code>.
    + * @param type The type of the data as passed into <code>udata_openChoice()</code>.
    + * It may be <code>NULL</code>.
    + * @param name The name of the data as passed into <code>udata_openChoice()</code>.
    + * @param pInfo A pointer to the <code>UDataInfo</code> structure
    + * of data that has been loaded and will be returned
    + * by <code>udata_openChoice()</code> if this function
    + * returns <code>TRUE</code>.
    + * @return TRUE if the current data memory is acceptable
    + * @stable ICU 2.0
    + */
    +typedef UBool U_CALLCONV
    +UDataMemoryIsAcceptable(void *context,
    + const char *type, const char *name,
    + const UDataInfo *pInfo);
    +
    +
    +/**
    + * Convenience function.
    + * This function works the same as <code>udata_openChoice</code>
    + * except that any data that matches the type and name
    + * is assumed to be acceptable.
    + * @param path Specifies an absolute path and/or a basename for the
    + * finding of the data in the file system.
    + * <code>NULL</code> for ICU data.
    + * @param type A string that specifies the type of data to be loaded.
    + * For example, resource bundles are loaded with type "res",
    + * conversion tables with type "cnv".
    + * This may be <code>NULL</code> or empty.
    + * @param name A string that specifies the name of the data.
    + * @param pErrorCode An ICU UErrorCode parameter. It must not be <code>NULL</code>.
    + * @return A pointer (handle) to a data memory object, or <code>NULL</code>
    + * if an error occurs. Call <code>udata_getMemory()</code>
    + * to get a pointer to the actual data.
    + *
    + * @see udata_openChoice
    + * @stable ICU 2.0
    + */
    +U_STABLE UDataMemory * U_EXPORT2
    +udata_open(const char *path, const char *type, const char *name,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Data loading function.
    + * This function is used to find and load efficiently data for
    + * ICU and applications using ICU.
    + * It provides an abstract interface that allows to specify a data
    + * type and name to find and load the data.
    + *
    + * <p>The implementation depends on platform properties and user preferences
    + * and may involve loading shared libraries (DLLs), mapping
    + * files into memory, or fopen()/fread() files.
    + * It may also involve using static memory or database queries etc.
    + * Several or all data items may be combined into one entity
    + * (DLL, memory-mappable file).</p>
    + *
    + * <p>The data is always preceded by a header that includes
    + * a <code>UDataInfo</code> structure.
    + * The caller's <code>isAcceptable()</code> function is called to make
    + * sure that the data is useful. It may be called several times if it
    + * rejects the data and there is more than one location with data
    + * matching the type and name.</p>
    + *
    + * <p>If <code>path==NULL</code>, then ICU data is loaded.
    + * Otherwise, it is separated into a basename and a basename-less directory string.
    + * The basename is used as the data package name, and the directory is
    + * logically prepended to the ICU data directory string.</p>
    + *
    + * <p>For details about ICU data loading see the User Guide
    + * Data Management chapter. (http://icu-project.org/userguide/icudata.html)</p>
    + *
    + * @param path Specifies an absolute path and/or a basename for the
    + * finding of the data in the file system.
    + * <code>NULL</code> for ICU data.
    + * @param type A string that specifies the type of data to be loaded.
    + * For example, resource bundles are loaded with type "res",
    + * conversion tables with type "cnv".
    + * This may be <code>NULL</code> or empty.
    + * @param name A string that specifies the name of the data.
    + * @param isAcceptable This function is called to verify that loaded data
    + * is useful for the client code. If it returns FALSE
    + * for all data items, then <code>udata_openChoice()</code>
    + * will return with an error.
    + * @param context Arbitrary parameter to be passed into isAcceptable.
    + * @param pErrorCode An ICU UErrorCode parameter. It must not be <code>NULL</code>.
    + * @return A pointer (handle) to a data memory object, or <code>NULL</code>
    + * if an error occurs. Call <code>udata_getMemory()</code>
    + * to get a pointer to the actual data.
    + * @stable ICU 2.0
    + */
    +U_STABLE UDataMemory * U_EXPORT2
    +udata_openChoice(const char *path, const char *type, const char *name,
    + UDataMemoryIsAcceptable *isAcceptable, void *context,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Close the data memory.
    + * This function must be called to allow the system to
    + * release resources associated with this data memory.
    + * @param pData The pointer to data memory object
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +udata_close(UDataMemory *pData);
    +
    +/**
    + * Get the pointer to the actual data inside the data memory.
    + * The data is read-only.
    + * @param pData The pointer to data memory object
    + * @stable ICU 2.0
    + */
    +U_STABLE const void * U_EXPORT2
    +udata_getMemory(UDataMemory *pData);
    +
    +/**
    + * Get the information from the data memory header.
    + * This allows to get access to the header containing
    + * platform data properties etc. which is not part of
    + * the data itself and can therefore not be accessed
    + * via the pointer that <code>udata_getMemory()</code> returns.
    + *
    + * @param pData pointer to the data memory object
    + * @param pInfo pointer to a UDataInfo object;
    + * its <code>size</code> field must be set correctly,
    + * typically to <code>sizeof(UDataInfo)</code>.
    + *
    + * <code>*pInfo</code> will be filled with the UDataInfo structure
    + * in the data memory object. If this structure is smaller than
    + * <code>pInfo->size</code>, then the <code>size</code> will be
    + * adjusted and only part of the structure will be filled.
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +udata_getInfo(UDataMemory *pData, UDataInfo *pInfo);
    +
    +/**
    + * This function bypasses the normal ICU data loading process and
    + * allows you to force ICU's system data to come out of a user-specified
    + * area in memory.
    + *
    + * The format of this data is that of the icu common data file, as is
    + * generated by the pkgdata tool with mode=common or mode=dll.
    + * You can read in a whole common mode file and pass the address to the start of the
    + * data, or (with the appropriate link options) pass in the pointer to
    + * the data that has been loaded from a dll by the operating system,
    + * as shown in this code:
    + *
    + * extern const char U_IMPORT U_ICUDATA_ENTRY_POINT [];
    + * // U_ICUDATA_ENTRY_POINT is same as entry point specified to pkgdata tool
    + * UErrorCode status = U_ZERO_ERROR;
    + *
    + * udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status);
    + *
    + * Warning: ICU must NOT have even attempted to access its data yet
    + * when this call is made, or U_USING_DEFAULT_WARNING code will
    + * be returned. Be careful of UnicodeStrings in static initialization which
    + * may attempt to load a converter (use the UNICODE_STRING(x) macro instead).
    + *
    + * Also note that it is important that the declaration be as above. The entry point
    + * must not be declared as an extern void*.
    + *
    + * This function has no effect on application (non ICU) data. See udata_setAppData()
    + * for similar functionality for application data.
    + *
    + * @param data pointer to ICU common data
    + * @param err outgoing error status <code>U_USING_DEFAULT_WARNING, U_UNSUPPORTED_ERROR</code>
    + * @stable ICU 2.0
    + */
    +
    +U_STABLE void U_EXPORT2
    +udata_setCommonData(const void *data, UErrorCode *err);
    +
    +
    +/**
    + * This function bypasses the normal ICU data loading process for application-specific
    + * data and allows you to force the it to come out of a user-specified
    + * pointer.
    + *
    + * The format of this data is that of the icu common data file, like 'icudt26l.dat'
    + * or the corresponding shared library (DLL) file.
    + * The application must read in or otherwise construct an image of the data and then
    + * pass the address of it to this function.
    + *
    + *
    + * Warning: setAppData will set a U_USING_DEFAULT_WARNING code if
    + * data with the specifed path that has already been opened, or
    + * if setAppData with the same path has already been called.
    + * Any such calls to setAppData will have no effect.
    + *
    + *
    + * @param packageName the package name by which the application will refer
    + * to (open) this data
    + * @param data pointer to the data
    + * @param err outgoing error status <code>U_USING_DEFAULT_WARNING, U_UNSUPPORTED_ERROR</code>
    + * @see udata_setCommonData
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +udata_setAppData(const char *packageName, const void *data, UErrorCode *err);
    +
    +/**
    + * Possible settings for udata_setFileAccess()
    + * @see udata_setFileAccess
    + * @stable ICU 3.4
    + */
    +typedef enum UDataFileAccess {
    + /** ICU looks for data in single files first, then in packages. (default) */
    + UDATA_FILES_FIRST,
    + /** ICU only loads data from packages, not from single files. */
    + UDATA_ONLY_PACKAGES,
    + /** ICU loads data from packages first, and only from single files
    + if the data cannot be found in a package. */
    + UDATA_PACKAGES_FIRST,
    + /** ICU does not access the file system for data loading. */
    + UDATA_NO_FILES,
    + /** An alias for the default access mode. */
    + UDATA_DEFAULT_ACCESS = UDATA_FILES_FIRST,
    + UDATA_FILE_ACCESS_COUNT
    +} UDataFileAccess;
    +
    +/**
    + * This function may be called to control how ICU loads data. It must be called
    + * before any ICU data is loaded, including application data loaded with ures/ResourceBundle or
    + * udata APIs. It should be called before u_init. This function is not multithread safe.
    + * The results of calling it while other threads are loading data are undefined.
    + * @param access The type of file access to be used
    + * @param status Error code.
    + * @see UDataFileAccess
    + * @stable ICU 3.4
    + */
    +U_STABLE void U_EXPORT2
    +udata_setFileAccess(UDataFileAccess access, UErrorCode *status);
    +
    +U_CDECL_END
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/udatpg.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/udatpg.h b/platform/osx/icu/unicode/udatpg.h
    new file mode 100644
    index 0000000..206637f
    --- /dev/null
    +++ b/platform/osx/icu/unicode/udatpg.h
    @@ -0,0 +1,471 @@
    +/*
    +*******************************************************************************
    +*
    +* Copyright (C) 2007-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +*******************************************************************************
    +* file name: udatpg.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* created on: 2007jul30
    +* created by: Markus W. Scherer
    +*/
    +
    +#ifndef __UDATPG_H__
    +#define __UDATPG_H__
    +
    +#include "unicode/utypes.h"
    +#include "unicode/uenum.h"
    +
    +/**
    + * \file
    + * \brief C API: Wrapper for DateTimePatternGenerator (unicode/dtptngen.h).
    + *
    + * UDateTimePatternGenerator provides flexible generation of date format patterns,
    + * like "yy-MM-dd". The user can build up the generator by adding successive
    + * patterns. Once that is done, a query can be made using a "skeleton", which is
    + * a pattern which just includes the desired fields and lengths. The generator
    + * will return the "best fit" pattern corresponding to that skeleton.
    + * <p>The main method people will use is udatpg_getBestPattern, since normally
    + * UDateTimePatternGenerator is pre-built with data from a particular locale.
    + * However, generators can be built directly from other data as well.
    + * <p><i>Issue: may be useful to also have a function that returns the list of
    + * fields in a pattern, in order, since we have that internally.
    + * That would be useful for getting the UI order of field elements.</i>
    + */
    +
    +/**
    + * Opaque type for a date/time pattern generator object.
    + * @stable ICU 4.0
    + */
    +typedef void *UDateTimePatternGenerator;
    +
    +/**
    + * Field number constants for udatpg_getAppendItemFormats() and similar functions.
    + * These constants are separate from UDateFormatField despite semantic overlap
    + * because some fields are merged for the date/time pattern generator.
    + * @stable ICU 4.0
    + */
    +typedef enum UDateTimePatternField {
    + /** @stable ICU 4.0 */
    + UDATPG_ERA_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_YEAR_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_QUARTER_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_MONTH_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_WEEK_OF_YEAR_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_WEEK_OF_MONTH_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_WEEKDAY_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_DAY_OF_YEAR_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_DAY_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_DAYPERIOD_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_HOUR_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_MINUTE_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_SECOND_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_FRACTIONAL_SECOND_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_ZONE_FIELD,
    + /** @stable ICU 4.0 */
    + UDATPG_FIELD_COUNT
    +} UDateTimePatternField;
    +
    +/**
    + * Status return values from udatpg_addPattern().
    + * @stable ICU 4.0
    + */
    +typedef enum UDateTimePatternConflict {
    + /** @stable ICU 4.0 */
    + UDATPG_NO_CONFLICT,
    + /** @stable ICU 4.0 */
    + UDATPG_BASE_CONFLICT,
    + /** @stable ICU 4.0 */
    + UDATPG_CONFLICT,
    + /** @stable ICU 4.0 */
    + UDATPG_CONFLICT_COUNT
    +} UDateTimePatternConflict;
    +
    +/**
    + * Open a generator according to a given locale.
    + * @param locale
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return a pointer to UDateTimePatternGenerator.
    + * @stable ICU 4.0
    + */
    +U_DRAFT UDateTimePatternGenerator * U_EXPORT2
    +udatpg_open(const char *locale, UErrorCode *pErrorCode);
    +
    +/**
    + * Open an empty generator, to be constructed with udatpg_addPattern(...) etc.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return a pointer to UDateTimePatternGenerator.
    + * @stable ICU 4.0
    + */
    +U_DRAFT UDateTimePatternGenerator * U_EXPORT2
    +udatpg_openEmpty(UErrorCode *pErrorCode);
    +
    +/**
    + * Close a generator.
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @stable ICU 4.0
    + */
    +U_DRAFT void U_EXPORT2
    +udatpg_close(UDateTimePatternGenerator *dtpg);
    +
    +/**
    + * Create a copy pf a generator.
    + * @param dtpg a pointer to UDateTimePatternGenerator to be copied.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return a pointer to a new UDateTimePatternGenerator.
    + * @stable ICU 4.0
    + */
    +U_DRAFT UDateTimePatternGenerator * U_EXPORT2
    +udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
    +
    +/**
    + * Get the best pattern matching the input skeleton. It is guaranteed to
    + * have all of the fields in the skeleton.
    + *
    + * Note that this function uses a non-const UDateTimePatternGenerator:
    + * It uses a stateful pattern parser which is set up for each generator object,
    + * rather than creating one for each function call.
    + * Consecutive calls to this function do not affect each other,
    + * but this function cannot be used concurrently on a single generator object.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param skeleton
    + * The skeleton is a pattern containing only the variable fields.
    + * For example, "MMMdd" and "mmhh" are skeletons.
    + * @param length the length of skeleton
    + * @param bestPattern
    + * The best pattern found from the given skeleton.
    + * @param capacity the capacity of bestPattern.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return the length of bestPattern.
    + * @stable ICU 4.0
    + */
    +U_DRAFT int32_t U_EXPORT2
    +udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
    + const UChar *skeleton, int32_t length,
    + UChar *bestPattern, int32_t capacity,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Get a unique skeleton from a given pattern. For example,
    + * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
    + *
    + * Note that this function uses a non-const UDateTimePatternGenerator:
    + * It uses a stateful pattern parser which is set up for each generator object,
    + * rather than creating one for each function call.
    + * Consecutive calls to this function do not affect each other,
    + * but this function cannot be used concurrently on a single generator object.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pattern input pattern, such as "dd/MMM".
    + * @param length the length of pattern.
    + * @param skeleton such as "MMMdd"
    + * @param capacity the capacity of skeleton.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return the length of skeleton.
    + * @stable ICU 4.0
    + */
    +U_DRAFT int32_t U_EXPORT2
    +udatpg_getSkeleton(UDateTimePatternGenerator *dtpg,
    + const UChar *pattern, int32_t length,
    + UChar *skeleton, int32_t capacity,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Get a unique base skeleton from a given pattern. This is the same
    + * as the skeleton, except that differences in length are minimized so
    + * as to only preserve the difference between string and numeric form. So
    + * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd"
    + * (notice the single d).
    + *
    + * Note that this function uses a non-const UDateTimePatternGenerator:
    + * It uses a stateful pattern parser which is set up for each generator object,
    + * rather than creating one for each function call.
    + * Consecutive calls to this function do not affect each other,
    + * but this function cannot be used concurrently on a single generator object.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pattern input pattern, such as "dd/MMM".
    + * @param length the length of pattern.
    + * @param baseSkeleton such as "Md"
    + * @param capacity the capacity of base skeleton.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return the length of baseSkeleton.
    + * @stable ICU 4.0
    + */
    +U_DRAFT int32_t U_EXPORT2
    +udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg,
    + const UChar *pattern, int32_t length,
    + UChar *baseSkeleton, int32_t capacity,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Adds a pattern to the generator. If the pattern has the same skeleton as
    + * an existing pattern, and the override parameter is set, then the previous
    + * value is overriden. Otherwise, the previous value is retained. In either
    + * case, the conflicting status is set and previous vale is stored in
    + * conflicting pattern.
    + * <p>
    + * Note that single-field patterns (like "MMM") are automatically added, and
    + * don't need to be added explicitly!
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pattern input pattern, such as "dd/MMM"
    + * @param patternLength the length of pattern.
    + * @param override When existing values are to be overridden use true,
    + * otherwise use false.
    + * @param conflictingPattern Previous pattern with the same skeleton.
    + * @param capacity the capacity of conflictingPattern.
    + * @param pLength a pointer to the length of conflictingPattern.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return conflicting status. The value could be UDATPG_NO_CONFLICT,
    + * UDATPG_BASE_CONFLICT or UDATPG_CONFLICT.
    + * @stable ICU 4.0
    + */
    +U_DRAFT UDateTimePatternConflict U_EXPORT2
    +udatpg_addPattern(UDateTimePatternGenerator *dtpg,
    + const UChar *pattern, int32_t patternLength,
    + UBool override,
    + UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * An AppendItem format is a pattern used to append a field if there is no
    + * good match. For example, suppose that the input skeleton is "GyyyyMMMd",
    + * and there is no matching pattern internally, but there is a pattern
    + * matching "yyyyMMMd", say "d-MM-yyyy". Then that pattern is used, plus the
    + * G. The way these two are conjoined is by using the AppendItemFormat for G
    + * (era). So if that value is, say "{0}, {1}" then the final resulting
    + * pattern is "d-MM-yyyy, G".
    + * <p>
    + * There are actually three available variables: {0} is the pattern so far,
    + * {1} is the element we are adding, and {2} is the name of the element.
    + * <p>
    + * This reflects the way that the CLDR data is organized.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param field UDateTimePatternField, such as UDATPG_ERA_FIELD
    + * @param value pattern, such as "{0}, {1}"
    + * @param length the length of value.
    + * @stable ICU 4.0
    + */
    +U_DRAFT void U_EXPORT2
    +udatpg_setAppendItemFormat(UDateTimePatternGenerator *dtpg,
    + UDateTimePatternField field,
    + const UChar *value, int32_t length);
    +
    +/**
    + * Getter corresponding to setAppendItemFormat. Values below 0 or at or
    + * above UDATPG_FIELD_COUNT are illegal arguments.
    + *
    + * @param dtpg A pointer to UDateTimePatternGenerator.
    + * @param field UDateTimePatternField, such as UDATPG_ERA_FIELD
    + * @param pLength A pointer that will receive the length of appendItemFormat.
    + * @return appendItemFormat for field.
    + * @stable ICU 4.0
    + */
    +U_DRAFT const UChar * U_EXPORT2
    +udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg,
    + UDateTimePatternField field,
    + int32_t *pLength);
    +
    +/**
    + * Set the name of field, eg "era" in English for ERA. These are only
    + * used if the corresponding AppendItemFormat is used, and if it contains a
    + * {2} variable.
    + * <p>
    + * This reflects the way that the CLDR data is organized.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param field UDateTimePatternField
    + * @param value name for the field.
    + * @param length the length of value.
    + * @stable ICU 4.0
    + */
    +U_DRAFT void U_EXPORT2
    +udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg,
    + UDateTimePatternField field,
    + const UChar *value, int32_t length);
    +
    +/**
    + * Getter corresponding to setAppendItemNames. Values below 0 or at or above
    + * UDATPG_FIELD_COUNT are illegal arguments.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param field UDateTimePatternField, such as UDATPG_ERA_FIELD
    + * @param pLength A pointer that will receive the length of the name for field.
    + * @return name for field
    + * @stable ICU 4.0
    + */
    +U_DRAFT const UChar * U_EXPORT2
    +udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg,
    + UDateTimePatternField field,
    + int32_t *pLength);
    +
    +/**
    + * The date time format is a message format pattern used to compose date and
    + * time patterns. The default value is "{0} {1}", where {0} will be replaced
    + * by the date pattern and {1} will be replaced by the time pattern.
    + * <p>
    + * This is used when the input skeleton contains both date and time fields,
    + * but there is not a close match among the added patterns. For example,
    + * suppose that this object was created by adding "dd-MMM" and "hh:mm", and
    + * its datetimeFormat is the default "{0} {1}". Then if the input skeleton
    + * is "MMMdhmm", there is not an exact match, so the input skeleton is
    + * broken up into two components "MMMd" and "hmm". There are close matches
    + * for those two skeletons, so the result is put together with this pattern,
    + * resulting in "d-MMM h:mm".
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param dtFormat
    + * message format pattern, here {0} will be replaced by the date
    + * pattern and {1} will be replaced by the time pattern.
    + * @param length the length of dtFormat.
    + * @stable ICU 4.0
    + */
    +U_DRAFT void U_EXPORT2
    +udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg,
    + const UChar *dtFormat, int32_t length);
    +
    +/**
    + * Getter corresponding to setDateTimeFormat.
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pLength A pointer that will receive the length of the format
    + * @return dateTimeFormat.
    + * @stable ICU 4.0
    + */
    +U_DRAFT const UChar * U_EXPORT2
    +udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg,
    + int32_t *pLength);
    +
    +/**
    + * The decimal value is used in formatting fractions of seconds. If the
    + * skeleton contains fractional seconds, then this is used with the
    + * fractional seconds. For example, suppose that the input pattern is
    + * "hhmmssSSSS", and the best matching pattern internally is "H:mm:ss", and
    + * the decimal string is ",". Then the resulting pattern is modified to be
    + * "H:mm:ss,SSSS"
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param decimal
    + * @param length the length of decimal.
    + * @stable ICU 4.0
    + */
    +U_DRAFT void U_EXPORT2
    +udatpg_setDecimal(UDateTimePatternGenerator *dtpg,
    + const UChar *decimal, int32_t length);
    +
    +/**
    + * Getter corresponding to setDecimal.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pLength A pointer that will receive the length of the decimal string.
    + * @return corresponding to the decimal point.
    + * @stable ICU 4.0
    + */
    +U_DRAFT const UChar * U_EXPORT2
    +udatpg_getDecimal(const UDateTimePatternGenerator *dtpg,
    + int32_t *pLength);
    +
    +/**
    + * Adjusts the field types (width and subtype) of a pattern to match what is
    + * in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
    + * skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
    + * "dd-MMMM hh:mm". This is used internally to get the best match for the
    + * input skeleton, but can also be used externally.
    + *
    + * Note that this function uses a non-const UDateTimePatternGenerator:
    + * It uses a stateful pattern parser which is set up for each generator object,
    + * rather than creating one for each function call.
    + * Consecutive calls to this function do not affect each other,
    + * but this function cannot be used concurrently on a single generator object.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pattern Input pattern
    + * @param patternLength the length of input pattern.
    + * @param skeleton
    + * @param skeletonLength the length of input skeleton.
    + * @param dest pattern adjusted to match the skeleton fields widths and subtypes.
    + * @param destCapacity the capacity of dest.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return the length of dest.
    + * @stable ICU 4.0
    + */
    +U_DRAFT int32_t U_EXPORT2
    +udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
    + const UChar *pattern, int32_t patternLength,
    + const UChar *skeleton, int32_t skeletonLength,
    + UChar *dest, int32_t destCapacity,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Return a UEnumeration list of all the skeletons in canonical form.
    + * Call udatpg_getPatternForSkeleton() to get the corresponding pattern.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call
    + * @return a UEnumeration list of all the skeletons
    + * The caller must close the object.
    + * @stable ICU 4.0
    + */
    +U_DRAFT UEnumeration * U_EXPORT2
    +udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
    +
    +/**
    + * Return a UEnumeration list of all the base skeletons in canonical form.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param pErrorCode a pointer to the UErrorCode which must not indicate a
    + * failure before the function call.
    + * @return a UEnumeration list of all the base skeletons
    + * The caller must close the object.
    + * @stable ICU 4.0
    + */
    +U_DRAFT UEnumeration * U_EXPORT2
    +udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
    +
    +/**
    + * Get the pattern corresponding to a given skeleton.
    + *
    + * @param dtpg a pointer to UDateTimePatternGenerator.
    + * @param skeleton
    + * @param skeletonLength pointer to the length of skeleton.
    + * @param pLength pointer to the length of return pattern.
    + * @return pattern corresponding to a given skeleton.
    + * @stable ICU 4.0
    + */
    +U_DRAFT const UChar * U_EXPORT2
    +udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
    + const UChar *skeleton, int32_t skeletonLength,
    + int32_t *pLength);
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/udeprctd.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/udeprctd.h b/platform/osx/icu/unicode/udeprctd.h
    new file mode 100644
    index 0000000..9bf45f3
    --- /dev/null
    +++ b/platform/osx/icu/unicode/udeprctd.h
    @@ -0,0 +1,50 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2004-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* file name:
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* Created by: genheaders.pl, a perl script written by Ram Viswanadha
    +*
    +* Contains data for commenting out APIs.
    +* Gets included by umachine.h
    +*
    +* THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHAT
    +* YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN!
    +*/
    +
    +#ifndef UDEPRCTD_H
    +#define UDEPRCTD_H
    +
    +#ifdef U_HIDE_DEPRECATED_API
    +
    +# if U_DISABLE_RENAMING
    +# define ucol_getContractions ucol_getContractions_DEPRECATED_API_DO_NOT_USE
    +# define ucol_getLocale ucol_getLocale_DEPRECATED_API_DO_NOT_USE
    +# define ures_countArrayItems ures_countArrayItems_DEPRECATED_API_DO_NOT_USE
    +# define ures_getLocale ures_getLocale_DEPRECATED_API_DO_NOT_USE
    +# define ures_getVersionNumber ures_getVersionNumber_DEPRECATED_API_DO_NOT_USE
    +# define utrans_getAvailableID utrans_getAvailableID_DEPRECATED_API_DO_NOT_USE
    +# define utrans_getID utrans_getID_DEPRECATED_API_DO_NOT_USE
    +# define utrans_open utrans_open_DEPRECATED_API_DO_NOT_USE
    +# define utrans_unregister utrans_unregister_DEPRECATED_API_DO_NOT_USE
    +# else
    +# define ucol_getContractions_4_0 ucol_getContractions_DEPRECATED_API_DO_NOT_USE
    +# define ucol_getLocale_4_0 ucol_getLocale_DEPRECATED_API_DO_NOT_USE
    +# define ures_countArrayItems_4_0 ures_countArrayItems_DEPRECATED_API_DO_NOT_USE
    +# define ures_getLocale_4_0 ures_getLocale_DEPRECATED_API_DO_NOT_USE
    +# define ures_getVersionNumber_4_0 ures_getVersionNumber_DEPRECATED_API_DO_NOT_USE
    +# define utrans_getAvailableID_4_0 utrans_getAvailableID_DEPRECATED_API_DO_NOT_USE
    +# define utrans_getID_4_0 utrans_getID_DEPRECATED_API_DO_NOT_USE
    +# define utrans_open_4_0 utrans_open_DEPRECATED_API_DO_NOT_USE
    +# define utrans_unregister_4_0 utrans_unregister_DEPRECATED_API_DO_NOT_USE
    +# endif /* U_DISABLE_RENAMING */
    +
    +#endif /* U_HIDE_DEPRECATED_API */
    +#endif /* UDEPRCTD_H */
    +

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/udraft.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/udraft.h b/platform/osx/icu/unicode/udraft.h
    new file mode 100644
    index 0000000..5426adf
    --- /dev/null
    +++ b/platform/osx/icu/unicode/udraft.h
    @@ -0,0 +1,166 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2004-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* file name:
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* Created by: genheaders.pl, a perl script written by Ram Viswanadha
    +*
    +* Contains data for commenting out APIs.
    +* Gets included by umachine.h
    +*
    +* THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHAT
    +* YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN!
    +*/
    +
    +#ifndef UDRAFT_H
    +#define UDRAFT_H
    +
    +#ifdef U_HIDE_DRAFT_API
    +
    +# if U_DISABLE_RENAMING
    +# define afkLanguageCode afkLanguageCode_DRAFT_API_DO_NOT_USE
    +# define armiScriptCode armiScriptCode_DRAFT_API_DO_NOT_USE
    +# define u_fclose u_fclose_DRAFT_API_DO_NOT_USE
    +# define u_feof u_feof_DRAFT_API_DO_NOT_USE
    +# define u_fflush u_fflush_DRAFT_API_DO_NOT_USE
    +# define u_fgetConverter u_fgetConverter_DRAFT_API_DO_NOT_USE
    +# define u_fgetc u_fgetc_DRAFT_API_DO_NOT_USE
    +# define u_fgetcodepage u_fgetcodepage_DRAFT_API_DO_NOT_USE
    +# define u_fgetcx u_fgetcx_DRAFT_API_DO_NOT_USE
    +# define u_fgetfile u_fgetfile_DRAFT_API_DO_NOT_USE
    +# define u_fgetlocale u_fgetlocale_DRAFT_API_DO_NOT_USE
    +# define u_fgets u_fgets_DRAFT_API_DO_NOT_USE
    +# define u_file_read u_file_read_DRAFT_API_DO_NOT_USE
    +# define u_file_write u_file_write_DRAFT_API_DO_NOT_USE
    +# define u_finit u_finit_DRAFT_API_DO_NOT_USE
    +# define u_fopen u_fopen_DRAFT_API_DO_NOT_USE
    +# define u_fprintf u_fprintf_DRAFT_API_DO_NOT_USE
    +# define u_fprintf_u u_fprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_fputc u_fputc_DRAFT_API_DO_NOT_USE
    +# define u_fputs u_fputs_DRAFT_API_DO_NOT_USE
    +# define u_frewind u_frewind_DRAFT_API_DO_NOT_USE
    +# define u_fscanf u_fscanf_DRAFT_API_DO_NOT_USE
    +# define u_fscanf_u u_fscanf_u_DRAFT_API_DO_NOT_USE
    +# define u_fsetcodepage u_fsetcodepage_DRAFT_API_DO_NOT_USE
    +# define u_fsetlocale u_fsetlocale_DRAFT_API_DO_NOT_USE
    +# define u_fsettransliterator u_fsettransliterator_DRAFT_API_DO_NOT_USE
    +# define u_fstropen u_fstropen_DRAFT_API_DO_NOT_USE
    +# define u_fungetc u_fungetc_DRAFT_API_DO_NOT_USE
    +# define u_snprintf u_snprintf_DRAFT_API_DO_NOT_USE
    +# define u_snprintf_u u_snprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_sprintf u_sprintf_DRAFT_API_DO_NOT_USE
    +# define u_sprintf_u u_sprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_sscanf u_sscanf_DRAFT_API_DO_NOT_USE
    +# define u_sscanf_u u_sscanf_u_DRAFT_API_DO_NOT_USE
    +# define u_vfprintf u_vfprintf_DRAFT_API_DO_NOT_USE
    +# define u_vfprintf_u u_vfprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_vfscanf u_vfscanf_DRAFT_API_DO_NOT_USE
    +# define u_vfscanf_u u_vfscanf_u_DRAFT_API_DO_NOT_USE
    +# define u_vsnprintf u_vsnprintf_DRAFT_API_DO_NOT_USE
    +# define u_vsnprintf_u u_vsnprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_vsprintf u_vsprintf_DRAFT_API_DO_NOT_USE
    +# define u_vsprintf_u u_vsprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_vsscanf u_vsscanf_DRAFT_API_DO_NOT_USE
    +# define u_vsscanf_u u_vsscanf_u_DRAFT_API_DO_NOT_USE
    +# define ucal_clone ucal_clone_DRAFT_API_DO_NOT_USE
    +# define ucal_getCanonicalTimeZoneID ucal_getCanonicalTimeZoneID_DRAFT_API_DO_NOT_USE
    +# define ucurr_countCurrencies ucurr_countCurrencies_DRAFT_API_DO_NOT_USE
    +# define ucurr_forLocaleAndDate ucurr_forLocaleAndDate_DRAFT_API_DO_NOT_USE
    +# define uloc_addLikelySubtags uloc_addLikelySubtags_DRAFT_API_DO_NOT_USE
    +# define uloc_getCharacterOrientation uloc_getCharacterOrientation_DRAFT_API_DO_NOT_USE
    +# define uloc_getLineOrientation uloc_getLineOrientation_DRAFT_API_DO_NOT_USE
    +# define uloc_minimizeSubtags uloc_minimizeSubtags_DRAFT_API_DO_NOT_USE
    +# define uregex_getMatchCallback uregex_getMatchCallback_DRAFT_API_DO_NOT_USE
    +# define uregex_getStackLimit uregex_getStackLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_getTimeLimit uregex_getTimeLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_hasAnchoringBounds uregex_hasAnchoringBounds_DRAFT_API_DO_NOT_USE
    +# define uregex_hasTransparentBounds uregex_hasTransparentBounds_DRAFT_API_DO_NOT_USE
    +# define uregex_hitEnd uregex_hitEnd_DRAFT_API_DO_NOT_USE
    +# define uregex_regionEnd uregex_regionEnd_DRAFT_API_DO_NOT_USE
    +# define uregex_regionStart uregex_regionStart_DRAFT_API_DO_NOT_USE
    +# define uregex_requireEnd uregex_requireEnd_DRAFT_API_DO_NOT_USE
    +# define uregex_setMatchCallback uregex_setMatchCallback_DRAFT_API_DO_NOT_USE
    +# define uregex_setRegion uregex_setRegion_DRAFT_API_DO_NOT_USE
    +# define uregex_setStackLimit uregex_setStackLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_setTimeLimit uregex_setTimeLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_useAnchoringBounds uregex_useAnchoringBounds_DRAFT_API_DO_NOT_USE
    +# define uregex_useTransparentBounds uregex_useTransparentBounds_DRAFT_API_DO_NOT_USE
    +# else
    +# define afkLanguageCode_4_0 afkLanguageCode_DRAFT_API_DO_NOT_USE
    +# define armiScriptCode_4_0 armiScriptCode_DRAFT_API_DO_NOT_USE
    +# define u_fclose_4_0 u_fclose_DRAFT_API_DO_NOT_USE
    +# define u_feof_4_0 u_feof_DRAFT_API_DO_NOT_USE
    +# define u_fflush_4_0 u_fflush_DRAFT_API_DO_NOT_USE
    +# define u_fgetConverter_4_0 u_fgetConverter_DRAFT_API_DO_NOT_USE
    +# define u_fgetc_4_0 u_fgetc_DRAFT_API_DO_NOT_USE
    +# define u_fgetcodepage_4_0 u_fgetcodepage_DRAFT_API_DO_NOT_USE
    +# define u_fgetcx_4_0 u_fgetcx_DRAFT_API_DO_NOT_USE
    +# define u_fgetfile_4_0 u_fgetfile_DRAFT_API_DO_NOT_USE
    +# define u_fgetlocale_4_0 u_fgetlocale_DRAFT_API_DO_NOT_USE
    +# define u_fgets_4_0 u_fgets_DRAFT_API_DO_NOT_USE
    +# define u_file_read_4_0 u_file_read_DRAFT_API_DO_NOT_USE
    +# define u_file_write_4_0 u_file_write_DRAFT_API_DO_NOT_USE
    +# define u_finit_4_0 u_finit_DRAFT_API_DO_NOT_USE
    +# define u_fopen_4_0 u_fopen_DRAFT_API_DO_NOT_USE
    +# define u_fprintf_4_0 u_fprintf_DRAFT_API_DO_NOT_USE
    +# define u_fprintf_u_4_0 u_fprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_fputc_4_0 u_fputc_DRAFT_API_DO_NOT_USE
    +# define u_fputs_4_0 u_fputs_DRAFT_API_DO_NOT_USE
    +# define u_frewind_4_0 u_frewind_DRAFT_API_DO_NOT_USE
    +# define u_fscanf_4_0 u_fscanf_DRAFT_API_DO_NOT_USE
    +# define u_fscanf_u_4_0 u_fscanf_u_DRAFT_API_DO_NOT_USE
    +# define u_fsetcodepage_4_0 u_fsetcodepage_DRAFT_API_DO_NOT_USE
    +# define u_fsetlocale_4_0 u_fsetlocale_DRAFT_API_DO_NOT_USE
    +# define u_fsettransliterator_4_0 u_fsettransliterator_DRAFT_API_DO_NOT_USE
    +# define u_fstropen_4_0 u_fstropen_DRAFT_API_DO_NOT_USE
    +# define u_fungetc_4_0 u_fungetc_DRAFT_API_DO_NOT_USE
    +# define u_snprintf_4_0 u_snprintf_DRAFT_API_DO_NOT_USE
    +# define u_snprintf_u_4_0 u_snprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_sprintf_4_0 u_sprintf_DRAFT_API_DO_NOT_USE
    +# define u_sprintf_u_4_0 u_sprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_sscanf_4_0 u_sscanf_DRAFT_API_DO_NOT_USE
    +# define u_sscanf_u_4_0 u_sscanf_u_DRAFT_API_DO_NOT_USE
    +# define u_vfprintf_4_0 u_vfprintf_DRAFT_API_DO_NOT_USE
    +# define u_vfprintf_u_4_0 u_vfprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_vfscanf_4_0 u_vfscanf_DRAFT_API_DO_NOT_USE
    +# define u_vfscanf_u_4_0 u_vfscanf_u_DRAFT_API_DO_NOT_USE
    +# define u_vsnprintf_4_0 u_vsnprintf_DRAFT_API_DO_NOT_USE
    +# define u_vsnprintf_u_4_0 u_vsnprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_vsprintf_4_0 u_vsprintf_DRAFT_API_DO_NOT_USE
    +# define u_vsprintf_u_4_0 u_vsprintf_u_DRAFT_API_DO_NOT_USE
    +# define u_vsscanf_4_0 u_vsscanf_DRAFT_API_DO_NOT_USE
    +# define u_vsscanf_u_4_0 u_vsscanf_u_DRAFT_API_DO_NOT_USE
    +# define ucal_clone_4_0 ucal_clone_DRAFT_API_DO_NOT_USE
    +# define ucal_getCanonicalTimeZoneID_4_0 ucal_getCanonicalTimeZoneID_DRAFT_API_DO_NOT_USE
    +# define ucurr_countCurrencies_4_0 ucurr_countCurrencies_DRAFT_API_DO_NOT_USE
    +# define ucurr_forLocaleAndDate_4_0 ucurr_forLocaleAndDate_DRAFT_API_DO_NOT_USE
    +# define uloc_addLikelySubtags_4_0 uloc_addLikelySubtags_DRAFT_API_DO_NOT_USE
    +# define uloc_getCharacterOrientation_4_0 uloc_getCharacterOrientation_DRAFT_API_DO_NOT_USE
    +# define uloc_getLineOrientation_4_0 uloc_getLineOrientation_DRAFT_API_DO_NOT_USE
    +# define uloc_minimizeSubtags_4_0 uloc_minimizeSubtags_DRAFT_API_DO_NOT_USE
    +# define uregex_getMatchCallback_4_0 uregex_getMatchCallback_DRAFT_API_DO_NOT_USE
    +# define uregex_getStackLimit_4_0 uregex_getStackLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_getTimeLimit_4_0 uregex_getTimeLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_hasAnchoringBounds_4_0 uregex_hasAnchoringBounds_DRAFT_API_DO_NOT_USE
    +# define uregex_hasTransparentBounds_4_0 uregex_hasTransparentBounds_DRAFT_API_DO_NOT_USE
    +# define uregex_hitEnd_4_0 uregex_hitEnd_DRAFT_API_DO_NOT_USE
    +# define uregex_regionEnd_4_0 uregex_regionEnd_DRAFT_API_DO_NOT_USE
    +# define uregex_regionStart_4_0 uregex_regionStart_DRAFT_API_DO_NOT_USE
    +# define uregex_requireEnd_4_0 uregex_requireEnd_DRAFT_API_DO_NOT_USE
    +# define uregex_setMatchCallback_4_0 uregex_setMatchCallback_DRAFT_API_DO_NOT_USE
    +# define uregex_setRegion_4_0 uregex_setRegion_DRAFT_API_DO_NOT_USE
    +# define uregex_setStackLimit_4_0 uregex_setStackLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_setTimeLimit_4_0 uregex_setTimeLimit_DRAFT_API_DO_NOT_USE
    +# define uregex_useAnchoringBounds_4_0 uregex_useAnchoringBounds_DRAFT_API_DO_NOT_USE
    +# define uregex_useTransparentBounds_4_0 uregex_useTransparentBounds_DRAFT_API_DO_NOT_USE
    +# endif /* U_DISABLE_RENAMING */
    +
    +#endif /* U_HIDE_DRAFT_API */
    +#endif /* UDRAFT_H */
    +

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/uenum.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/uenum.h b/platform/osx/icu/unicode/uenum.h
    new file mode 100644
    index 0000000..ff9b299
    --- /dev/null
    +++ b/platform/osx/icu/unicode/uenum.h
    @@ -0,0 +1,134 @@
    +/*
    +*******************************************************************************
    +*
    +* Copyright (C) 2002-2005, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +*******************************************************************************
    +* file name: uenum.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:2
    +*
    +* created on: 2002jul08
    +* created by: Vladimir Weinstein
    +*/
    +
    +#ifndef __UENUM_H
    +#define __UENUM_H
    +
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C API: String Enumeration
    + */
    +
    +/**
    + * An enumeration object.
    + * For usage in C programs.
    + * @stable ICU 2.2
    + */
    +struct UEnumeration;
    +/** structure representing an enumeration object instance @stable ICU 2.2 */
    +typedef struct UEnumeration UEnumeration;
    +
    +/**
    + * Disposes of resources in use by the iterator. If en is NULL,
    + * does nothing. After this call, any char* or UChar* pointer
    + * returned by uenum_unext() or uenum_next() is invalid.
    + * @param en UEnumeration structure pointer
    + * @stable ICU 2.2
    + */
    +U_STABLE void U_EXPORT2
    +uenum_close(UEnumeration* en);
    +
    +/**
    + * Returns the number of elements that the iterator traverses. If
    + * the iterator is out-of-sync with its service, status is set to
    + * U_ENUM_OUT_OF_SYNC_ERROR.
    + * This is a convenience function. It can end up being very
    + * expensive as all the items might have to be pre-fetched (depending
    + * on the type of data being traversed). Use with caution and only
    + * when necessary.
    + * @param en UEnumeration structure pointer
    + * @param status error code, can be U_ENUM_OUT_OF_SYNC_ERROR if the
    + * iterator is out of sync.
    + * @return number of elements in the iterator
    + * @stable ICU 2.2
    + */
    +U_STABLE int32_t U_EXPORT2
    +uenum_count(UEnumeration* en, UErrorCode* status);
    +
    +/**
    + * Returns the next element in the iterator's list. If there are
    + * no more elements, returns NULL. If the iterator is out-of-sync
    + * with its service, status is set to U_ENUM_OUT_OF_SYNC_ERROR and
    + * NULL is returned. If the native service string is a char* string,
    + * it is converted to UChar* with the invariant converter.
    + * The result is terminated by (UChar)0.
    + * @param en the iterator object
    + * @param resultLength pointer to receive the length of the result
    + * (not including the terminating \\0).
    + * If the pointer is NULL it is ignored.
    + * @param status the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if
    + * the iterator is out of sync with its service.
    + * @return a pointer to the string. The string will be
    + * zero-terminated. The return pointer is owned by this iterator
    + * and must not be deleted by the caller. The pointer is valid
    + * until the next call to any uenum_... method, including
    + * uenum_next() or uenum_unext(). When all strings have been
    + * traversed, returns NULL.
    + * @stable ICU 2.2
    + */
    +U_STABLE const UChar* U_EXPORT2
    +uenum_unext(UEnumeration* en,
    + int32_t* resultLength,
    + UErrorCode* status);
    +
    +/**
    + * Returns the next element in the iterator's list. If there are
    + * no more elements, returns NULL. If the iterator is out-of-sync
    + * with its service, status is set to U_ENUM_OUT_OF_SYNC_ERROR and
    + * NULL is returned. If the native service string is a UChar*
    + * string, it is converted to char* with the invariant converter.
    + * The result is terminated by (char)0. If the conversion fails
    + * (because a character cannot be converted) then status is set to
    + * U_INVARIANT_CONVERSION_ERROR and the return value is undefined
    + * (but non-NULL).
    + * @param en the iterator object
    + * @param resultLength pointer to receive the length of the result
    + * (not including the terminating \\0).
    + * If the pointer is NULL it is ignored.
    + * @param status the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if
    + * the iterator is out of sync with its service. Set to
    + * U_INVARIANT_CONVERSION_ERROR if the underlying native string is
    + * UChar* and conversion to char* with the invariant converter
    + * fails. This error pertains only to current string, so iteration
    + * might be able to continue successfully.
    + * @return a pointer to the string. The string will be
    + * zero-terminated. The return pointer is owned by this iterator
    + * and must not be deleted by the caller. The pointer is valid
    + * until the next call to any uenum_... method, including
    + * uenum_next() or uenum_unext(). When all strings have been
    + * traversed, returns NULL.
    + * @stable ICU 2.2
    + */
    +U_STABLE const char* U_EXPORT2
    +uenum_next(UEnumeration* en,
    + int32_t* resultLength,
    + UErrorCode* status);
    +
    +/**
    + * Resets the iterator to the current list of service IDs. This
    + * re-establishes sync with the service and rewinds the iterator
    + * to start at the first element.
    + * @param en the iterator object
    + * @param status the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if
    + * the iterator is out of sync with its service.
    + * @stable ICU 2.2
    + */
    +U_STABLE void U_EXPORT2
    +uenum_reset(UEnumeration* en, UErrorCode* status);
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/uidna.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/uidna.h b/platform/osx/icu/unicode/uidna.h
    new file mode 100644
    index 0000000..52aa6e9
    --- /dev/null
    +++ b/platform/osx/icu/unicode/uidna.h
    @@ -0,0 +1,312 @@
    +/*
    + *******************************************************************************
    + *
    + * Copyright (C) 2003-2007, International Business Machines
    + * Corporation and others. All Rights Reserved.
    + *
    + *******************************************************************************
    + * file name: uidna.h
    + * encoding: US-ASCII
    + * tab size: 8 (not used)
    + * indentation:4
    + *
    + * created on: 2003feb1
    + * created by: Ram Viswanadha
    + */
    +
    +#ifndef __UIDNA_H__
    +#define __UIDNA_H__
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_IDNA
    +
    +#include "unicode/parseerr.h"
    +
    +/**
    + * \file
    + * \brief C API: Internationalized Domain Names in Applications Tranformation
    + *
    + * UIDNA API implements the IDNA protocol as defined in the IDNA RFC
    + * (http://www.ietf.org/rfc/rfc3490.txt).
    + * The RFC defines 2 operations: ToASCII and ToUnicode. Domain labels
    + * containing non-ASCII code points are required to be processed by
    + * ToASCII operation before passing it to resolver libraries. Domain names
    + * that are obtained from resolver libraries are required to be processed by
    + * ToUnicode operation before displaying the domain name to the user.
    + * IDNA requires that implementations process input strings with Nameprep
    + * (http://www.ietf.org/rfc/rfc3491.txt),
    + * which is a profile of Stringprep (http://www.ietf.org/rfc/rfc3454.txt),
    + * and then with Punycode (http://www.ietf.org/rfc/rfc3492.txt).
    + * Implementations of IDNA MUST fully implement Nameprep and Punycode;
    + * neither Nameprep nor Punycode are optional.
    + * The input and output of ToASCII and ToUnicode operations are Unicode
    + * and are designed to be chainable, i.e., applying ToASCII or ToUnicode operations
    + * multiple times to an input string will yield the same result as applying the operation
    + * once.
    + * ToUnicode(ToUnicode(ToUnicode...(ToUnicode(string)))) == ToUnicode(string)
    + * ToASCII(ToASCII(ToASCII...(ToASCII(string))) == ToASCII(string).
    + *
    + */
    +
    +/**
    + * Option to prohibit processing of unassigned codepoints in the input and
    + * do not check if the input conforms to STD-3 ASCII rules.
    + *
    + * @see uidna_toASCII uidna_toUnicode
    + * @stable ICU 2.6
    + */
    +#define UIDNA_DEFAULT 0x0000
    +/**
    + * Option to allow processing of unassigned codepoints in the input
    + *
    + * @see uidna_toASCII uidna_toUnicode
    + * @stable ICU 2.6
    + */
    +#define UIDNA_ALLOW_UNASSIGNED 0x0001
    +/**
    + * Option to check if input conforms to STD-3 ASCII rules
    + *
    + * @see uidna_toASCII uidna_toUnicode
    + * @stable ICU 2.6
    + */
    +#define UIDNA_USE_STD3_RULES 0x0002
    +
    +/**
    + * This function implements the ToASCII operation as defined in the IDNA RFC.
    + * This operation is done on <b>single labels</b> before sending it to something that expects
    + * ASCII names. A label is an individual part of a domain name. Labels are usually
    + * separated by dots; e.g." "www.example.com" is composed of 3 labels
    + * "www","example", and "com".
    + *
    + *
    + * @param src Input UChar array containing label in Unicode.
    + * @param srcLength Number of UChars in src, or -1 if NUL-terminated.
    + * @param dest Output UChar array with ASCII (ACE encoded) label.
    + * @param destCapacity Size of dest.
    + * @param options A bit set of options:
    + *
    + * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points
    + * and do not use STD3 ASCII rules
    + * If unassigned code points are found the operation fails with
    + * U_UNASSIGNED_ERROR error code.
    + *
    + * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
    + * If this option is set, the unassigned code points are in the input
    + * are treated as normal Unicode code points.
    + *
    + * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
    + * If this option is set and the input does not satisfy STD3 rules,
    + * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR
    + *
    + * @param parseError Pointer to UParseError struct to receive information on position
    + * of error if an error is encountered. Can be NULL.
    + * @param status ICU in/out error code parameter.
    + * U_INVALID_CHAR_FOUND if src contains
    + * unmatched single surrogates.
    + * U_INDEX_OUTOFBOUNDS_ERROR if src contains
    + * too many code points.
    + * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
    + * @return The length of the result string, if successful - or in case of a buffer overflow,
    + * in which case it will be greater than destCapacity.
    + * @stable ICU 2.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +uidna_toASCII(const UChar* src, int32_t srcLength,
    + UChar* dest, int32_t destCapacity,
    + int32_t options,
    + UParseError* parseError,
    + UErrorCode* status);
    +
    +
    +/**
    + * This function implements the ToUnicode operation as defined in the IDNA RFC.
    + * This operation is done on <b>single labels</b> before sending it to something that expects
    + * Unicode names. A label is an individual part of a domain name. Labels are usually
    + * separated by dots; for e.g." "www.example.com" is composed of 3 labels
    + * "www","example", and "com".
    + *
    + * @param src Input UChar array containing ASCII (ACE encoded) label.
    + * @param srcLength Number of UChars in src, or -1 if NUL-terminated.
    + * @param dest Output Converted UChar array containing Unicode equivalent of label.
    + * @param destCapacity Size of dest.
    + * @param options A bit set of options:
    + *
    + * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points
    + * and do not use STD3 ASCII rules
    + * If unassigned code points are found the operation fails with
    + * U_UNASSIGNED_ERROR error code.
    + *
    + * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
    + * If this option is set, the unassigned code points are in the input
    + * are treated as normal Unicode code points. <b> Note: </b> This option is
    + * required on toUnicode operation because the RFC mandates
    + * verification of decoded ACE input by applying toASCII and comparing
    + * its output with source
    + *
    + *
    + *
    + * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
    + * If this option is set and the input does not satisfy STD3 rules,
    + * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR
    + *
    + * @param parseError Pointer to UParseError struct to receive information on position
    + * of error if an error is encountered. Can be NULL.
    + * @param status ICU in/out error code parameter.
    + * U_INVALID_CHAR_FOUND if src contains
    + * unmatched single surrogates.
    + * U_INDEX_OUTOFBOUNDS_ERROR if src contains
    + * too many code points.
    + * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
    + * @return The length of the result string, if successful - or in case of a buffer overflow,
    + * in which case it will be greater than destCapacity.
    + * @stable ICU 2.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +uidna_toUnicode(const UChar* src, int32_t srcLength,
    + UChar* dest, int32_t destCapacity,
    + int32_t options,
    + UParseError* parseError,
    + UErrorCode* status);
    +
    +
    +/**
    + * Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
    + * This operation is done on complete domain names, e.g: "www.example.com".
    + * It is important to note that this operation can fail. If it fails, then the input
    + * domain name cannot be used as an Internationalized Domain Name and the application
    + * should have methods defined to deal with the failure.
    + *
    + * <b>Note:</b> IDNA RFC specifies that a conformant application should divide a domain name
    + * into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each,
    + * and then convert. This function does not offer that level of granularity. The options once
    + * set will apply to all labels in the domain name
    + *
    + * @param src Input UChar array containing IDN in Unicode.
    + * @param srcLength Number of UChars in src, or -1 if NUL-terminated.
    + * @param dest Output UChar array with ASCII (ACE encoded) IDN.
    + * @param destCapacity Size of dest.
    + * @param options A bit set of options:
    + *
    + * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points
    + * and do not use STD3 ASCII rules
    + * If unassigned code points are found the operation fails with
    + * U_UNASSIGNED_CODE_POINT_FOUND error code.
    + *
    + * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
    + * If this option is set, the unassigned code points are in the input
    + * are treated as normal Unicode code points.
    + *
    + * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
    + * If this option is set and the input does not satisfy STD3 rules,
    + * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR
    + *
    + * @param parseError Pointer to UParseError struct to receive information on position
    + * of error if an error is encountered. Can be NULL.
    + * @param status ICU in/out error code parameter.
    + * U_INVALID_CHAR_FOUND if src contains
    + * unmatched single surrogates.
    + * U_INDEX_OUTOFBOUNDS_ERROR if src contains
    + * too many code points.
    + * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
    + * @return The length of the result string, if successful - or in case of a buffer overflow,
    + * in which case it will be greater than destCapacity.
    + * @stable ICU 2.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +uidna_IDNToASCII( const UChar* src, int32_t srcLength,
    + UChar* dest, int32_t destCapacity,
    + int32_t options,
    + UParseError* parseError,
    + UErrorCode* status);
    +
    +/**
    + * Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
    + * This operation is done on complete domain names, e.g: "www.example.com".
    + *
    + * <b>Note:</b> IDNA RFC specifies that a conformant application should divide a domain name
    + * into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each,
    + * and then convert. This function does not offer that level of granularity. The options once
    + * set will apply to all labels in the domain name
    + *
    + * @param src Input UChar array containing IDN in ASCII (ACE encoded) form.
    + * @param srcLength Number of UChars in src, or -1 if NUL-terminated.
    + * @param dest Output UChar array containing Unicode equivalent of source IDN.
    + * @param destCapacity Size of dest.
    + * @param options A bit set of options:
    + *
    + * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points
    + * and do not use STD3 ASCII rules
    + * If unassigned code points are found the operation fails with
    + * U_UNASSIGNED_CODE_POINT_FOUND error code.
    + *
    + * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
    + * If this option is set, the unassigned code points are in the input
    + * are treated as normal Unicode code points.
    + *
    + * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
    + * If this option is set and the input does not satisfy STD3 rules,
    + * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR
    + *
    + * @param parseError Pointer to UParseError struct to receive information on position
    + * of error if an error is encountered. Can be NULL.
    + * @param status ICU in/out error code parameter.
    + * U_INVALID_CHAR_FOUND if src contains
    + * unmatched single surrogates.
    + * U_INDEX_OUTOFBOUNDS_ERROR if src contains
    + * too many code points.
    + * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
    + * @return The length of the result string, if successful - or in case of a buffer overflow,
    + * in which case it will be greater than destCapacity.
    + * @stable ICU 2.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
    + UChar* dest, int32_t destCapacity,
    + int32_t options,
    + UParseError* parseError,
    + UErrorCode* status);
    +
    +/**
    + * Compare two IDN strings for equivalence.
    + * This function splits the domain names into labels and compares them.
    + * According to IDN RFC, whenever two labels are compared, they are
    + * considered equal if and only if their ASCII forms (obtained by
    + * applying toASCII) match using an case-insensitive ASCII comparison.
    + * Two domain names are considered a match if and only if all labels
    + * match regardless of whether label separators match.
    + *
    + * @param s1 First source string.
    + * @param length1 Length of first source string, or -1 if NUL-terminated.
    + *
    + * @param s2 Second source string.
    + * @param length2 Length of second source string, or -1 if NUL-terminated.
    + * @param options A bit set of options:
    + *
    + * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points
    + * and do not use STD3 ASCII rules
    + * If unassigned code points are found the operation fails with
    + * U_UNASSIGNED_CODE_POINT_FOUND error code.
    + *
    + * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
    + * If this option is set, the unassigned code points are in the input
    + * are treated as normal Unicode code points.
    + *
    + * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
    + * If this option is set and the input does not satisfy STD3 rules,
    + * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR
    + *
    + * @param status ICU error code in/out parameter.
    + * Must fulfill U_SUCCESS before the function call.
    + * @return <0 or 0 or >0 as usual for string comparisons
    + * @stable ICU 2.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +uidna_compare( const UChar *s1, int32_t length1,
    + const UChar *s2, int32_t length2,
    + int32_t options,
    + UErrorCode* status);
    +
    +#endif /* #if !UCONFIG_NO_IDNA */
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/uintrnal.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/uintrnal.h b/platform/osx/icu/unicode/uintrnal.h
    new file mode 100644
    index 0000000..6a01f6b
    --- /dev/null
    +++ b/platform/osx/icu/unicode/uintrnal.h
    @@ -0,0 +1,180 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2004-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*******************************************************************************
    +*
    +* file name:
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* Created by: genheaders.pl, a perl script written by Ram Viswanadha
    +*
    +* Contains data for commenting out APIs.
    +* Gets included by umachine.h
    +*
    +* THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHAT
    +* YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN!
    +*/
    +
    +#ifndef UINTRNAL_H
    +#define UINTRNAL_H
    +
    +#ifdef U_HIDE_INTERNAL_API
    +
    +# if U_DISABLE_RENAMING
    +# define RegexPatternDump RegexPatternDump_INTERNAL_API_DO_NOT_USE
    +# define pl_addFontRun pl_addFontRun_INTERNAL_API_DO_NOT_USE
    +# define pl_addLocaleRun pl_addLocaleRun_INTERNAL_API_DO_NOT_USE
    +# define pl_addValueRun pl_addValueRun_INTERNAL_API_DO_NOT_USE
    +# define pl_close pl_close_INTERNAL_API_DO_NOT_USE
    +# define pl_closeFontRuns pl_closeFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_closeLine pl_closeLine_INTERNAL_API_DO_NOT_USE
    +# define pl_closeLocaleRuns pl_closeLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_closeValueRuns pl_closeValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_countLineRuns pl_countLineRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_create pl_create_INTERNAL_API_DO_NOT_USE
    +# define pl_getAscent pl_getAscent_INTERNAL_API_DO_NOT_USE
    +# define pl_getDescent pl_getDescent_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunCount pl_getFontRunCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunFont pl_getFontRunFont_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunLastLimit pl_getFontRunLastLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunLimit pl_getFontRunLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getLeading pl_getLeading_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineAscent pl_getLineAscent_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineDescent pl_getLineDescent_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineLeading pl_getLineLeading_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineVisualRun pl_getLineVisualRun_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineWidth pl_getLineWidth_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunCount pl_getLocaleRunCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunLastLimit pl_getLocaleRunLastLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunLimit pl_getLocaleRunLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunLocale pl_getLocaleRunLocale_INTERNAL_API_DO_NOT_USE
    +# define pl_getParagraphLevel pl_getParagraphLevel_INTERNAL_API_DO_NOT_USE
    +# define pl_getTextDirection pl_getTextDirection_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunCount pl_getValueRunCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunLastLimit pl_getValueRunLastLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunLimit pl_getValueRunLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunValue pl_getValueRunValue_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunAscent pl_getVisualRunAscent_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunDescent pl_getVisualRunDescent_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunDirection pl_getVisualRunDirection_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunFont pl_getVisualRunFont_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunGlyphCount pl_getVisualRunGlyphCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunGlyphToCharMap pl_getVisualRunGlyphToCharMap_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunGlyphs pl_getVisualRunGlyphs_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunLeading pl_getVisualRunLeading_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunPositions pl_getVisualRunPositions_INTERNAL_API_DO_NOT_USE
    +# define pl_isComplex pl_isComplex_INTERNAL_API_DO_NOT_USE
    +# define pl_line pl_line_INTERNAL_API_DO_NOT_USE
    +# define pl_nextLine pl_nextLine_INTERNAL_API_DO_NOT_USE
    +# define pl_openEmptyFontRuns pl_openEmptyFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openEmptyLocaleRuns pl_openEmptyLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openEmptyValueRuns pl_openEmptyValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openFontRuns pl_openFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openLocaleRuns pl_openLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openValueRuns pl_openValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_paragraph pl_paragraph_INTERNAL_API_DO_NOT_USE
    +# define pl_reflow pl_reflow_INTERNAL_API_DO_NOT_USE
    +# define pl_resetFontRuns pl_resetFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_resetLocaleRuns pl_resetLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_resetValueRuns pl_resetValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_visualRun pl_visualRun_INTERNAL_API_DO_NOT_USE
    +# define ucol_equals ucol_equals_INTERNAL_API_DO_NOT_USE
    +# define ucol_forgetUCA ucol_forgetUCA_INTERNAL_API_DO_NOT_USE
    +# define ucol_getAttributeOrDefault ucol_getAttributeOrDefault_INTERNAL_API_DO_NOT_USE
    +# define ucol_getUnsafeSet ucol_getUnsafeSet_INTERNAL_API_DO_NOT_USE
    +# define ucol_nextProcessed ucol_nextProcessed_INTERNAL_API_DO_NOT_USE
    +# define ucol_prepareShortStringOpen ucol_prepareShortStringOpen_INTERNAL_API_DO_NOT_USE
    +# define ucol_previousProcessed ucol_previousProcessed_INTERNAL_API_DO_NOT_USE
    +# define uprv_getDefaultCodepage uprv_getDefaultCodepage_INTERNAL_API_DO_NOT_USE
    +# define uprv_getDefaultLocaleID uprv_getDefaultLocaleID_INTERNAL_API_DO_NOT_USE
    +# define ures_openFillIn ures_openFillIn_INTERNAL_API_DO_NOT_USE
    +# define usearch_search usearch_search_INTERNAL_API_DO_NOT_USE
    +# define usearch_searchBackwards usearch_searchBackwards_INTERNAL_API_DO_NOT_USE
    +# define utf8_appendCharSafeBody utf8_appendCharSafeBody_INTERNAL_API_DO_NOT_USE
    +# define utf8_back1SafeBody utf8_back1SafeBody_INTERNAL_API_DO_NOT_USE
    +# define utf8_countTrailBytes utf8_countTrailBytes_INTERNAL_API_DO_NOT_USE
    +# define utf8_nextCharSafeBody utf8_nextCharSafeBody_INTERNAL_API_DO_NOT_USE
    +# define utf8_prevCharSafeBody utf8_prevCharSafeBody_INTERNAL_API_DO_NOT_USE
    +# else
    +# define RegexPatternDump_4_0 RegexPatternDump_INTERNAL_API_DO_NOT_USE
    +# define pl_addFontRun_4_0 pl_addFontRun_INTERNAL_API_DO_NOT_USE
    +# define pl_addLocaleRun_4_0 pl_addLocaleRun_INTERNAL_API_DO_NOT_USE
    +# define pl_addValueRun_4_0 pl_addValueRun_INTERNAL_API_DO_NOT_USE
    +# define pl_closeFontRuns_4_0 pl_closeFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_closeLine_4_0 pl_closeLine_INTERNAL_API_DO_NOT_USE
    +# define pl_closeLocaleRuns_4_0 pl_closeLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_closeValueRuns_4_0 pl_closeValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_close_4_0 pl_close_INTERNAL_API_DO_NOT_USE
    +# define pl_countLineRuns_4_0 pl_countLineRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_create_4_0 pl_create_INTERNAL_API_DO_NOT_USE
    +# define pl_getAscent_4_0 pl_getAscent_INTERNAL_API_DO_NOT_USE
    +# define pl_getDescent_4_0 pl_getDescent_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunCount_4_0 pl_getFontRunCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunFont_4_0 pl_getFontRunFont_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunLastLimit_4_0 pl_getFontRunLastLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getFontRunLimit_4_0 pl_getFontRunLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getLeading_4_0 pl_getLeading_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineAscent_4_0 pl_getLineAscent_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineDescent_4_0 pl_getLineDescent_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineLeading_4_0 pl_getLineLeading_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineVisualRun_4_0 pl_getLineVisualRun_INTERNAL_API_DO_NOT_USE
    +# define pl_getLineWidth_4_0 pl_getLineWidth_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunCount_4_0 pl_getLocaleRunCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunLastLimit_4_0 pl_getLocaleRunLastLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunLimit_4_0 pl_getLocaleRunLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getLocaleRunLocale_4_0 pl_getLocaleRunLocale_INTERNAL_API_DO_NOT_USE
    +# define pl_getParagraphLevel_4_0 pl_getParagraphLevel_INTERNAL_API_DO_NOT_USE
    +# define pl_getTextDirection_4_0 pl_getTextDirection_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunCount_4_0 pl_getValueRunCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunLastLimit_4_0 pl_getValueRunLastLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunLimit_4_0 pl_getValueRunLimit_INTERNAL_API_DO_NOT_USE
    +# define pl_getValueRunValue_4_0 pl_getValueRunValue_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunAscent_4_0 pl_getVisualRunAscent_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunDescent_4_0 pl_getVisualRunDescent_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunDirection_4_0 pl_getVisualRunDirection_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunFont_4_0 pl_getVisualRunFont_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunGlyphCount_4_0 pl_getVisualRunGlyphCount_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunGlyphToCharMap_4_0 pl_getVisualRunGlyphToCharMap_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunGlyphs_4_0 pl_getVisualRunGlyphs_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunLeading_4_0 pl_getVisualRunLeading_INTERNAL_API_DO_NOT_USE
    +# define pl_getVisualRunPositions_4_0 pl_getVisualRunPositions_INTERNAL_API_DO_NOT_USE
    +# define pl_isComplex_4_0 pl_isComplex_INTERNAL_API_DO_NOT_USE
    +# define pl_line_4_0 pl_line_INTERNAL_API_DO_NOT_USE
    +# define pl_nextLine_4_0 pl_nextLine_INTERNAL_API_DO_NOT_USE
    +# define pl_openEmptyFontRuns_4_0 pl_openEmptyFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openEmptyLocaleRuns_4_0 pl_openEmptyLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openEmptyValueRuns_4_0 pl_openEmptyValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openFontRuns_4_0 pl_openFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openLocaleRuns_4_0 pl_openLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_openValueRuns_4_0 pl_openValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_paragraph_4_0 pl_paragraph_INTERNAL_API_DO_NOT_USE
    +# define pl_reflow_4_0 pl_reflow_INTERNAL_API_DO_NOT_USE
    +# define pl_resetFontRuns_4_0 pl_resetFontRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_resetLocaleRuns_4_0 pl_resetLocaleRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_resetValueRuns_4_0 pl_resetValueRuns_INTERNAL_API_DO_NOT_USE
    +# define pl_visualRun_4_0 pl_visualRun_INTERNAL_API_DO_NOT_USE
    +# define ucol_equals_4_0 ucol_equals_INTERNAL_API_DO_NOT_USE
    +# define ucol_forgetUCA_4_0 ucol_forgetUCA_INTERNAL_API_DO_NOT_USE
    +# define ucol_getAttributeOrDefault_4_0 ucol_getAttributeOrDefault_INTERNAL_API_DO_NOT_USE
    +# define ucol_getUnsafeSet_4_0 ucol_getUnsafeSet_INTERNAL_API_DO_NOT_USE
    +# define ucol_nextProcessed_4_0 ucol_nextProcessed_INTERNAL_API_DO_NOT_USE
    +# define ucol_prepareShortStringOpen_4_0 ucol_prepareShortStringOpen_INTERNAL_API_DO_NOT_USE
    +# define ucol_previousProcessed_4_0 ucol_previousProcessed_INTERNAL_API_DO_NOT_USE
    +# define uprv_getDefaultCodepage_4_0 uprv_getDefaultCodepage_INTERNAL_API_DO_NOT_USE
    +# define uprv_getDefaultLocaleID_4_0 uprv_getDefaultLocaleID_INTERNAL_API_DO_NOT_USE
    +# define ures_openFillIn_4_0 ures_openFillIn_INTERNAL_API_DO_NOT_USE
    +# define usearch_searchBackwards_4_0 usearch_searchBackwards_INTERNAL_API_DO_NOT_USE
    +# define usearch_search_4_0 usearch_search_INTERNAL_API_DO_NOT_USE
    +# define utf8_appendCharSafeBody_4_0 utf8_appendCharSafeBody_INTERNAL_API_DO_NOT_USE
    +# define utf8_back1SafeBody_4_0 utf8_back1SafeBody_INTERNAL_API_DO_NOT_USE
    +# define utf8_countTrailBytes_4_0 utf8_countTrailBytes_INTERNAL_API_DO_NOT_USE
    +# define utf8_nextCharSafeBody_4_0 utf8_nextCharSafeBody_INTERNAL_API_DO_NOT_USE
    +# define utf8_prevCharSafeBody_4_0 utf8_prevCharSafeBody_INTERNAL_API_DO_NOT_USE
    +# endif /* U_DISABLE_RENAMING */
    +
    +#endif /* U_HIDE_INTERNAL_API */
    +#endif /* UINTRNAL_H */
    +
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/decimfmt.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/decimfmt.h b/platform/osx/icu/unicode/decimfmt.h
    new file mode 100644
    index 0000000..a584a9c
    --- /dev/null
    +++ b/platform/osx/icu/unicode/decimfmt.h
    @@ -0,0 +1,1901 @@
    +/*
    +********************************************************************************
    +* Copyright (C) 1997-2009, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +********************************************************************************
    +*
    +* File DECIMFMT.H
    +*
    +* Modification History:
    +*
    +* Date Name Description
    +* 02/19/97 aliu Converted from java.
    +* 03/20/97 clhuang Updated per C++ implementation.
    +* 04/03/97 aliu Rewrote parsing and formatting completely, and
    +* cleaned up and debugged. Actually works now.
    +* 04/17/97 aliu Changed DigitCount to int per code review.
    +* 07/10/97 helena Made ParsePosition a class and get rid of the function
    +* hiding problems.
    +* 09/09/97 aliu Ported over support for exponential formats.
    +* 07/20/98 stephen Changed documentation
    +********************************************************************************
    +*/
    +
    +#ifndef DECIMFMT_H
    +#define DECIMFMT_H
    +
    +#include "unicode/utypes.h"
    +/**
    + * \file
    + * \brief C++ API: Formats decimal numbers.
    + */
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/dcfmtsym.h"
    +#include "unicode/numfmt.h"
    +#include "unicode/locid.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +class DigitList;
    +class ChoiceFormat;
    +class UnicodeSet;
    +
    +/**
    + * DecimalFormat is a concrete subclass of NumberFormat that formats decimal
    + * numbers. It has a variety of features designed to make it possible to parse
    + * and format numbers in any locale, including support for Western, Arabic, or
    + * Indic digits. It also supports different flavors of numbers, including
    + * integers ("123"), fixed-point numbers ("123.4"), scientific notation
    + * ("1.23E4"), percentages ("12%"), and currency amounts ("$123"). All of these
    + * flavors can be easily localized.
    + *
    + * <p>To obtain a NumberFormat for a specific locale (including the default
    + * locale) call one of NumberFormat's factory methods such as
    + * createInstance(). Do not call the DecimalFormat constructors directly, unless
    + * you know what you are doing, since the NumberFormat factory methods may
    + * return subclasses other than DecimalFormat.
    + *
    + * <p><strong>Example Usage</strong>
    + *
    + * \code
    + * // Normally we would have a GUI with a menu for this
    + * int32_t locCount;
    + * const Locale* locales = NumberFormat::getAvailableLocales(locCount);
    + *
    + * double myNumber = -1234.56;
    + * UErrorCode success = U_ZERO_ERROR;
    + * NumberFormat* form;
    + *
    + * // Print out a number with the localized number, currency and percent
    + * // format for each locale.
    + * UnicodeString countryName;
    + * UnicodeString displayName;
    + * UnicodeString str;
    + * UnicodeString pattern;
    + * Formattable fmtable;
    + * for (int32_t j = 0; j < 3; ++j) {
    + * cout << endl << "FORMAT " << j << endl;
    + * for (int32_t i = 0; i < locCount; ++i) {
    + * if (locales[i].getCountry(countryName).size() == 0) {
    + * // skip language-only
    + * continue;
    + * }
    + * switch (j) {
    + * case 0:
    + * form = NumberFormat::createInstance(locales[i], success ); break;
    + * case 1:
    + * form = NumberFormat::createCurrencyInstance(locales[i], success ); break;
    + * default:
    + * form = NumberFormat::createPercentInstance(locales[i], success ); break;
    + * }
    + * if (form) {
    + * str.remove();
    + * pattern = ((DecimalFormat*)form)->toPattern(pattern);
    + * cout << locales[i].getDisplayName(displayName) << ": " << pattern;
    + * cout << " -> " << form->format(myNumber,str) << endl;
    + * form->parse(form->format(myNumber,str), fmtable, success);
    + * delete form;
    + * }
    + * }
    + * }
    + * \endcode
    + *
    + * <p><strong>Patterns</strong>
    + *
    + * <p>A DecimalFormat consists of a <em>pattern</em> and a set of
    + * <em>symbols</em>. The pattern may be set directly using
    + * applyPattern(), or indirectly using other API methods which
    + * manipulate aspects of the pattern, such as the minimum number of integer
    + * digits. The symbols are stored in a DecimalFormatSymbols
    + * object. When using the NumberFormat factory methods, the
    + * pattern and symbols are read from ICU's locale data.
    + *
    + * <p><strong>Special Pattern Characters</strong>
    + *
    + * <p>Many characters in a pattern are taken literally; they are matched during
    + * parsing and output unchanged during formatting. Special characters, on the
    + * other hand, stand for other characters, strings, or classes of characters.
    + * For example, the '#' character is replaced by a localized digit. Often the
    + * replacement character is the same as the pattern character; in the U.S. locale,
    + * the ',' grouping character is replaced by ','. However, the replacement is
    + * still happening, and if the symbols are modified, the grouping character
    + * changes. Some special characters affect the behavior of the formatter by
    + * their presence; for example, if the percent character is seen, then the
    + * value is multiplied by 100 before being displayed.
    + *
    + * <p>To insert a special character in a pattern as a literal, that is, without
    + * any special meaning, the character must be quoted. There are some exceptions to
    + * this which are noted below.
    + *
    + * <p>The characters listed here are used in non-localized patterns. Localized
    + * patterns use the corresponding characters taken from this formatter's
    + * DecimalFormatSymbols object instead, and these characters lose
    + * their special status. Two exceptions are the currency sign and quote, which
    + * are not localized.
    + *
    + * <table border=0 cellspacing=3 cellpadding=0>
    + * <tr bgcolor="#ccccff">
    + * <td align=left><strong>Symbol</strong>
    + * <td align=left><strong>Location</strong>
    + * <td align=left><strong>Localized?</strong>
    + * <td align=left><strong>Meaning</strong>
    + * <tr valign=top>
    + * <td><code>0</code>
    + * <td>Number
    + * <td>Yes
    + * <td>Digit
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>1-9</code>
    + * <td>Number
    + * <td>Yes
    + * <td>'1' through '9' indicate rounding.
    + * <tr valign=top>
    + * <td><code>\htmlonly&#x40;\endhtmlonly</code> <!--doxygen doesn't like @-->
    + * <td>Number
    + * <td>No
    + * <td>Significant digit
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>#</code>
    + * <td>Number
    + * <td>Yes
    + * <td>Digit, zero shows as absent
    + * <tr valign=top>
    + * <td><code>.</code>
    + * <td>Number
    + * <td>Yes
    + * <td>Decimal separator or monetary decimal separator
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>-</code>
    + * <td>Number
    + * <td>Yes
    + * <td>Minus sign
    + * <tr valign=top>
    + * <td><code>,</code>
    + * <td>Number
    + * <td>Yes
    + * <td>Grouping separator
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>E</code>
    + * <td>Number
    + * <td>Yes
    + * <td>Separates mantissa and exponent in scientific notation.
    + * <em>Need not be quoted in prefix or suffix.</em>
    + * <tr valign=top>
    + * <td><code>+</code>
    + * <td>Exponent
    + * <td>Yes
    + * <td>Prefix positive exponents with localized plus sign.
    + * <em>Need not be quoted in prefix or suffix.</em>
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>;</code>
    + * <td>Subpattern boundary
    + * <td>Yes
    + * <td>Separates positive and negative subpatterns
    + * <tr valign=top>
    + * <td><code>\%</code>
    + * <td>Prefix or suffix
    + * <td>Yes
    + * <td>Multiply by 100 and show as percentage
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>\\u2030</code>
    + * <td>Prefix or suffix
    + * <td>Yes
    + * <td>Multiply by 1000 and show as per mille
    + * <tr valign=top>
    + * <td><code>\htmlonly&curren;\endhtmlonly</code> (<code>\\u00A4</code>)
    + * <td>Prefix or suffix
    + * <td>No
    + * <td>Currency sign, replaced by currency symbol. If
    + * doubled, replaced by international currency symbol.
    + * If present in a pattern, the monetary decimal separator
    + * is used instead of the decimal separator.
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>'</code>
    + * <td>Prefix or suffix
    + * <td>No
    + * <td>Used to quote special characters in a prefix or suffix,
    + * for example, <code>"'#'#"</code> formats 123 to
    + * <code>"#123"</code>. To create a single quote
    + * itself, use two in a row: <code>"# o''clock"</code>.
    + * <tr valign=top>
    + * <td><code>*</code>
    + * <td>Prefix or suffix boundary
    + * <td>Yes
    + * <td>Pad escape, precedes pad character
    + * </table>
    + *
    + * <p>A DecimalFormat pattern contains a postive and negative
    + * subpattern, for example, "#,##0.00;(#,##0.00)". Each subpattern has a
    + * prefix, a numeric part, and a suffix. If there is no explicit negative
    + * subpattern, the negative subpattern is the localized minus sign prefixed to the
    + * positive subpattern. That is, "0.00" alone is equivalent to "0.00;-0.00". If there
    + * is an explicit negative subpattern, it serves only to specify the negative
    + * prefix and suffix; the number of digits, minimal digits, and other
    + * characteristics are ignored in the negative subpattern. That means that
    + * "#,##0.0#;(#)" has precisely the same result as "#,##0.0#;(#,##0.0#)".
    + *
    + * <p>The prefixes, suffixes, and various symbols used for infinity, digits,
    + * thousands separators, decimal separators, etc. may be set to arbitrary
    + * values, and they will appear properly during formatting. However, care must
    + * be taken that the symbols and strings do not conflict, or parsing will be
    + * unreliable. For example, either the positive and negative prefixes or the
    + * suffixes must be distinct for parse() to be able
    + * to distinguish positive from negative values. Another example is that the
    + * decimal separator and thousands separator should be distinct characters, or
    + * parsing will be impossible.
    + *
    + * <p>The <em>grouping separator</em> is a character that separates clusters of
    + * integer digits to make large numbers more legible. It commonly used for
    + * thousands, but in some locales it separates ten-thousands. The <em>grouping
    + * size</em> is the number of digits between the grouping separators, such as 3
    + * for "100,000,000" or 4 for "1 0000 0000". There are actually two different
    + * grouping sizes: One used for the least significant integer digits, the
    + * <em>primary grouping size</em>, and one used for all others, the
    + * <em>secondary grouping size</em>. In most locales these are the same, but
    + * sometimes they are different. For example, if the primary grouping interval
    + * is 3, and the secondary is 2, then this corresponds to the pattern
    + * "#,##,##0", and the number 123456789 is formatted as "12,34,56,789". If a
    + * pattern contains multiple grouping separators, the interval between the last
    + * one and the end of the integer defines the primary grouping size, and the
    + * interval between the last two defines the secondary grouping size. All others
    + * are ignored, so "#,##,###,####" == "###,###,####" == "##,#,###,####".
    + *
    + * <p>Illegal patterns, such as "#.#.#" or "#.###,###", will cause
    + * DecimalFormat to set a failing UErrorCode.
    + *
    + * <p><strong>Pattern BNF</strong>
    + *
    + * <pre>
    + * pattern := subpattern (';' subpattern)?
    + * subpattern := prefix? number exponent? suffix?
    + * number := (integer ('.' fraction)?) | sigDigits
    + * prefix := '\\u0000'..'\\uFFFD' - specialCharacters
    + * suffix := '\\u0000'..'\\uFFFD' - specialCharacters
    + * integer := '#'* '0'* '0'
    + * fraction := '0'* '#'*
    + * sigDigits := '#'* '@' '@'* '#'*
    + * exponent := 'E' '+'? '0'* '0'
    + * padSpec := '*' padChar
    + * padChar := '\\u0000'..'\\uFFFD' - quote
    + * &nbsp;
    + * Notation:
    + * X* 0 or more instances of X
    + * X? 0 or 1 instances of X
    + * X|Y either X or Y
    + * C..D any character from C up to D, inclusive
    + * S-T characters in S, except those in T
    + * </pre>
    + * The first subpattern is for positive numbers. The second (optional)
    + * subpattern is for negative numbers.
    + *
    + * <p>Not indicated in the BNF syntax above:
    + *
    + * <ul><li>The grouping separator ',' can occur inside the integer and
    + * sigDigits elements, between any two pattern characters of that
    + * element, as long as the integer or sigDigits element is not
    + * followed by the exponent element.
    + *
    + * <li>Two grouping intervals are recognized: That between the
    + * decimal point and the first grouping symbol, and that
    + * between the first and second grouping symbols. These
    + * intervals are identical in most locales, but in some
    + * locales they differ. For example, the pattern
    + * &quot;#,##,###&quot; formats the number 123456789 as
    + * &quot;12,34,56,789&quot;.</li>
    + *
    + * <li>The pad specifier <code>padSpec</code> may appear before the prefix,
    + * after the prefix, before the suffix, after the suffix, or not at all.
    + *
    + * <li>In place of '0', the digits '1' through '9' may be used to
    + * indicate a rounding increment.
    + * </ul>
    + *
    + * <p><strong>Parsing</strong>
    + *
    + * <p>DecimalFormat parses all Unicode characters that represent
    + * decimal digits, as defined by u_charDigitValue(). In addition,
    + * DecimalFormat also recognizes as digits the ten consecutive
    + * characters starting with the localized zero digit defined in the
    + * DecimalFormatSymbols object. During formatting, the
    + * DecimalFormatSymbols-based digits are output.
    + *
    + * <p>During parsing, grouping separators are ignored.
    + *
    + * <p>If parse(UnicodeString&,Formattable&,ParsePosition&)
    + * fails to parse a string, it leaves the parse position unchanged.
    + * The convenience method parse(UnicodeString&,Formattable&,UErrorCode&)
    + * indicates parse failure by setting a failing
    + * UErrorCode.
    + *
    + * <p><strong>Formatting</strong>
    + *
    + * <p>Formatting is guided by several parameters, all of which can be
    + * specified either using a pattern or using the API. The following
    + * description applies to formats that do not use <a href="#sci">scientific
    + * notation</a> or <a href="#sigdig">significant digits</a>.
    + *
    + * <ul><li>If the number of actual integer digits exceeds the
    + * <em>maximum integer digits</em>, then only the least significant
    + * digits are shown. For example, 1997 is formatted as "97" if the
    + * maximum integer digits is set to 2.
    + *
    + * <li>If the number of actual integer digits is less than the
    + * <em>minimum integer digits</em>, then leading zeros are added. For
    + * example, 1997 is formatted as "01997" if the minimum integer digits
    + * is set to 5.
    + *
    + * <li>If the number of actual fraction digits exceeds the <em>maximum
    + * fraction digits</em>, then half-even rounding it performed to the
    + * maximum fraction digits. For example, 0.125 is formatted as "0.12"
    + * if the maximum fraction digits is 2. This behavior can be changed
    + * by specifying a rounding increment and a rounding mode.
    + *
    + * <li>If the number of actual fraction digits is less than the
    + * <em>minimum fraction digits</em>, then trailing zeros are added.
    + * For example, 0.125 is formatted as "0.1250" if the mimimum fraction
    + * digits is set to 4.
    + *
    + * <li>Trailing fractional zeros are not displayed if they occur
    + * <em>j</em> positions after the decimal, where <em>j</em> is less
    + * than the maximum fraction digits. For example, 0.10004 is
    + * formatted as "0.1" if the maximum fraction digits is four or less.
    + * </ul>
    + *
    + * <p><strong>Special Values</strong>
    + *
    + * <p><code>NaN</code> is represented as a single character, typically
    + * <code>\\uFFFD</code>. This character is determined by the
    + * DecimalFormatSymbols object. This is the only value for which
    + * the prefixes and suffixes are not used.
    + *
    + * <p>Infinity is represented as a single character, typically
    + * <code>\\u221E</code>, with the positive or negative prefixes and suffixes
    + * applied. The infinity character is determined by the
    + * DecimalFormatSymbols object.
    + *
    + * <a name="sci"><strong>Scientific Notation</strong></a>
    + *
    + * <p>Numbers in scientific notation are expressed as the product of a mantissa
    + * and a power of ten, for example, 1234 can be expressed as 1.234 x 10<sup>3</sup>. The
    + * mantissa is typically in the half-open interval [1.0, 10.0) or sometimes [0.0, 1.0),
    + * but it need not be. DecimalFormat supports arbitrary mantissas.
    + * DecimalFormat can be instructed to use scientific
    + * notation through the API or through the pattern. In a pattern, the exponent
    + * character immediately followed by one or more digit characters indicates
    + * scientific notation. Example: "0.###E0" formats the number 1234 as
    + * "1.234E3".
    + *
    + * <ul>
    + * <li>The number of digit characters after the exponent character gives the
    + * minimum exponent digit count. There is no maximum. Negative exponents are
    + * formatted using the localized minus sign, <em>not</em> the prefix and suffix
    + * from the pattern. This allows patterns such as "0.###E0 m/s". To prefix
    + * positive exponents with a localized plus sign, specify '+' between the
    + * exponent and the digits: "0.###E+0" will produce formats "1E+1", "1E+0",
    + * "1E-1", etc. (In localized patterns, use the localized plus sign rather than
    + * '+'.)
    + *
    + * <li>The minimum number of integer digits is achieved by adjusting the
    + * exponent. Example: 0.00123 formatted with "00.###E0" yields "12.3E-4". This
    + * only happens if there is no maximum number of integer digits. If there is a
    + * maximum, then the minimum number of integer digits is fixed at one.
    + *
    + * <li>The maximum number of integer digits, if present, specifies the exponent
    + * grouping. The most common use of this is to generate <em>engineering
    + * notation</em>, in which the exponent is a multiple of three, e.g.,
    + * "##0.###E0". The number 12345 is formatted using "##0.####E0" as "12.345E3".
    + *
    + * <li>When using scientific notation, the formatter controls the
    + * digit counts using significant digits logic. The maximum number of
    + * significant digits limits the total number of integer and fraction
    + * digits that will be shown in the mantissa; it does not affect
    + * parsing. For example, 12345 formatted with "##0.##E0" is "12.3E3".
    + * See the section on significant digits for more details.
    + *
    + * <li>The number of significant digits shown is determined as
    + * follows: If areSignificantDigitsUsed() returns false, then the
    + * minimum number of significant digits shown is one, and the maximum
    + * number of significant digits shown is the sum of the <em>minimum
    + * integer</em> and <em>maximum fraction</em> digits, and is
    + * unaffected by the maximum integer digits. If this sum is zero,
    + * then all significant digits are shown. If
    + * areSignificantDigitsUsed() returns true, then the significant digit
    + * counts are specified by getMinimumSignificantDigits() and
    + * getMaximumSignificantDigits(). In this case, the number of
    + * integer digits is fixed at one, and there is no exponent grouping.
    + *
    + * <li>Exponential patterns may not contain grouping separators.
    + * </ul>
    + *
    + * <a name="sigdig"><strong>Significant Digits</strong></a>
    + *
    + * <code>DecimalFormat</code> has two ways of controlling how many
    + * digits are shows: (a) significant digits counts, or (b) integer and
    + * fraction digit counts. Integer and fraction digit counts are
    + * described above. When a formatter is using significant digits
    + * counts, the number of integer and fraction digits is not specified
    + * directly, and the formatter settings for these counts are ignored.
    + * Instead, the formatter uses however many integer and fraction
    + * digits are required to display the specified number of significant
    + * digits. Examples:
    + *
    + * <table border=0 cellspacing=3 cellpadding=0>
    + * <tr bgcolor="#ccccff">
    + * <td align=left>Pattern
    + * <td align=left>Minimum significant digits
    + * <td align=left>Maximum significant digits
    + * <td align=left>Number
    + * <td align=left>Output of format()
    + * <tr valign=top>
    + * <td><code>\@\@\@</code>
    + * <td>3
    + * <td>3
    + * <td>12345
    + * <td><code>12300</code>
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>\@\@\@</code>
    + * <td>3
    + * <td>3
    + * <td>0.12345
    + * <td><code>0.123</code>
    + * <tr valign=top>
    + * <td><code>\@\@##</code>
    + * <td>2
    + * <td>4
    + * <td>3.14159
    + * <td><code>3.142</code>
    + * <tr valign=top bgcolor="#eeeeff">
    + * <td><code>\@\@##</code>
    + * <td>2
    + * <td>4
    + * <td>1.23004
    + * <td><code>1.23</code>
    + * </table>
    + *
    + * <ul>
    + * <li>Significant digit counts may be expressed using patterns that
    + * specify a minimum and maximum number of significant digits. These
    + * are indicated by the <code>'@'</code> and <code>'#'</code>
    + * characters. The minimum number of significant digits is the number
    + * of <code>'@'</code> characters. The maximum number of significant
    + * digits is the number of <code>'@'</code> characters plus the number
    + * of <code>'#'</code> characters following on the right. For
    + * example, the pattern <code>"@@@"</code> indicates exactly 3
    + * significant digits. The pattern <code>"@##"</code> indicates from
    + * 1 to 3 significant digits. Trailing zero digits to the right of
    + * the decimal separator are suppressed after the minimum number of
    + * significant digits have been shown. For example, the pattern
    + * <code>"@##"</code> formats the number 0.1203 as
    + * <code>"0.12"</code>.
    + *
    + * <li>If a pattern uses significant digits, it may not contain a
    + * decimal separator, nor the <code>'0'</code> pattern character.
    + * Patterns such as <code>"@00"</code> or <code>"@.###"</code> are
    + * disallowed.
    + *
    + * <li>Any number of <code>'#'</code> characters may be prepended to
    + * the left of the leftmost <code>'@'</code> character. These have no
    + * effect on the minimum and maximum significant digits counts, but
    + * may be used to position grouping separators. For example,
    + * <code>"#,#@#"</code> indicates a minimum of one significant digits,
    + * a maximum of two significant digits, and a grouping size of three.
    + *
    + * <li>In order to enable significant digits formatting, use a pattern
    + * containing the <code>'@'</code> pattern character. Alternatively,
    + * call setSignificantDigitsUsed(TRUE).
    + *
    + * <li>In order to disable significant digits formatting, use a
    + * pattern that does not contain the <code>'@'</code> pattern
    + * character. Alternatively, call setSignificantDigitsUsed(FALSE).
    + *
    + * <li>The number of significant digits has no effect on parsing.
    + *
    + * <li>Significant digits may be used together with exponential notation. Such
    + * patterns are equivalent to a normal exponential pattern with a minimum and
    + * maximum integer digit count of one, a minimum fraction digit count of
    + * <code>getMinimumSignificantDigits() - 1</code>, and a maximum fraction digit
    + * count of <code>getMaximumSignificantDigits() - 1</code>. For example, the
    + * pattern <code>"@@###E0"</code> is equivalent to <code>"0.0###E0"</code>.
    + *
    + * <li>If signficant digits are in use, then the integer and fraction
    + * digit counts, as set via the API, are ignored. If significant
    + * digits are not in use, then the signficant digit counts, as set via
    + * the API, are ignored.
    + *
    + * </ul>
    + *
    + * <p><strong>Padding</strong>
    + *
    + * <p>DecimalFormat supports padding the result of
    + * format() to a specific width. Padding may be specified either
    + * through the API or through the pattern syntax. In a pattern the pad escape
    + * character, followed by a single pad character, causes padding to be parsed
    + * and formatted. The pad escape character is '*' in unlocalized patterns, and
    + * can be localized using DecimalFormatSymbols::setSymbol() with a
    + * DecimalFormatSymbols::kPadEscapeSymbol
    + * selector. For example, <code>"$*x#,##0.00"</code> formats 123 to
    + * <code>"$xx123.00"</code>, and 1234 to <code>"$1,234.00"</code>.
    + *
    + * <ul>
    + * <li>When padding is in effect, the width of the positive subpattern,
    + * including prefix and suffix, determines the format width. For example, in
    + * the pattern <code>"* #0 o''clock"</code>, the format width is 10.
    + *
    + * <li>The width is counted in 16-bit code units (UChars).
    + *
    + * <li>Some parameters which usually do not matter have meaning when padding is
    + * used, because the pattern width is significant with padding. In the pattern
    + * "* ##,##,#,##0.##", the format width is 14. The initial characters "##,##,"
    + * do not affect the grouping size or maximum integer digits, but they do affect
    + * the format width.
    + *
    + * <li>Padding may be inserted at one of four locations: before the prefix,
    + * after the prefix, before the suffix, or after the suffix. If padding is
    + * specified in any other location, applyPattern()
    + * sets a failing UErrorCode. If there is no prefix,
    + * before the prefix and after the prefix are equivalent, likewise for the
    + * suffix.
    + *
    + * <li>When specified in a pattern, the 32-bit code point immediately
    + * following the pad escape is the pad character. This may be any character,
    + * including a special pattern character. That is, the pad escape
    + * <em>escapes</em> the following character. If there is no character after
    + * the pad escape, then the pattern is illegal.
    + *
    + * </ul>
    + *
    + * <p><strong>Rounding</strong>
    + *
    + * <p>DecimalFormat supports rounding to a specific increment. For
    + * example, 1230 rounded to the nearest 50 is 1250. 1.234 rounded to the
    + * nearest 0.65 is 1.3. The rounding increment may be specified through the API
    + * or in a pattern. To specify a rounding increment in a pattern, include the
    + * increment in the pattern itself. "#,#50" specifies a rounding increment of
    + * 50. "#,##0.05" specifies a rounding increment of 0.05.
    + *
    + * <ul>
    + * <li>Rounding only affects the string produced by formatting. It does
    + * not affect parsing or change any numerical values.
    + *
    + * <li>A <em>rounding mode</em> determines how values are rounded; see
    + * DecimalFormat::ERoundingMode. Rounding increments specified in
    + * patterns use the default mode, DecimalFormat::kRoundHalfEven.
    + *
    + * <li>Some locales use rounding in their currency formats to reflect the
    + * smallest currency denomination.
    + *
    + * <li>In a pattern, digits '1' through '9' specify rounding, but otherwise
    + * behave identically to digit '0'.
    + * </ul>
    + *
    + * <p><strong>Synchronization</strong>
    + *
    + * <p>DecimalFormat objects are not synchronized. Multiple
    + * threads should not access one formatter concurrently.
    + *
    + * <p><strong>Subclassing</strong>
    + *
    + * <p><em>User subclasses are not supported.</em> While clients may write
    + * subclasses, such code will not necessarily work and will not be
    + * guaranteed to work stably from release to release.
    + */
    +class U_I18N_API DecimalFormat: public NumberFormat {
    +public:
    + /**
    + * Rounding mode.
    + * @stable ICU 2.4
    + */
    + enum ERoundingMode {
    + kRoundCeiling, /**< Round towards positive infinity */
    + kRoundFloor, /**< Round towards negative infinity */
    + kRoundDown, /**< Round towards zero */
    + kRoundUp, /**< Round away from zero */
    + kRoundHalfEven, /**< Round towards the nearest integer, or
    + towards the nearest even integer if equidistant */
    + kRoundHalfDown, /**< Round towards the nearest integer, or
    + towards zero if equidistant */
    + kRoundHalfUp /**< Round towards the nearest integer, or
    + away from zero if equidistant */
    + // We don't support ROUND_UNNECESSARY
    + };
    +
    + /**
    + * Pad position.
    + * @stable ICU 2.4
    + */
    + enum EPadPosition {
    + kPadBeforePrefix,
    + kPadAfterPrefix,
    + kPadBeforeSuffix,
    + kPadAfterSuffix
    + };
    +
    + /**
    + * Create a DecimalFormat using the default pattern and symbols
    + * for the default locale. This is a convenient way to obtain a
    + * DecimalFormat when internationalization is not the main concern.
    + * <P>
    + * To obtain standard formats for a given locale, use the factory methods
    + * on NumberFormat such as createInstance. These factories will
    + * return the most appropriate sub-class of NumberFormat for a given
    + * locale.
    + * @param status Output param set to success/failure code. If the
    + * pattern is invalid this will be set to a failure code.
    + * @stable ICU 2.0
    + */
    + DecimalFormat(UErrorCode& status);
    +
    + /**
    + * Create a DecimalFormat from the given pattern and the symbols
    + * for the default locale. This is a convenient way to obtain a
    + * DecimalFormat when internationalization is not the main concern.
    + * <P>
    + * To obtain standard formats for a given locale, use the factory methods
    + * on NumberFormat such as createInstance. These factories will
    + * return the most appropriate sub-class of NumberFormat for a given
    + * locale.
    + * @param pattern A non-localized pattern string.
    + * @param status Output param set to success/failure code. If the
    + * pattern is invalid this will be set to a failure code.
    + * @stable ICU 2.0
    + */
    + DecimalFormat(const UnicodeString& pattern,
    + UErrorCode& status);
    +
    + /**
    + * Create a DecimalFormat from the given pattern and symbols.
    + * Use this constructor when you need to completely customize the
    + * behavior of the format.
    + * <P>
    + * To obtain standard formats for a given
    + * locale, use the factory methods on NumberFormat such as
    + * createInstance or createCurrencyInstance. If you need only minor adjustments
    + * to a standard format, you can modify the format returned by
    + * a NumberFormat factory method.
    + *
    + * @param pattern a non-localized pattern string
    + * @param symbolsToAdopt the set of symbols to be used. The caller should not
    + * delete this object after making this call.
    + * @param status Output param set to success/failure code. If the
    + * pattern is invalid this will be set to a failure code.
    + * @stable ICU 2.0
    + */
    + DecimalFormat( const UnicodeString& pattern,
    + DecimalFormatSymbols* symbolsToAdopt,
    + UErrorCode& status);
    +
    + /**
    + * Create a DecimalFormat from the given pattern and symbols.
    + * Use this constructor when you need to completely customize the
    + * behavior of the format.
    + * <P>
    + * To obtain standard formats for a given
    + * locale, use the factory methods on NumberFormat such as
    + * createInstance or createCurrencyInstance. If you need only minor adjustments
    + * to a standard format, you can modify the format returned by
    + * a NumberFormat factory method.
    + *
    + * @param pattern a non-localized pattern string
    + * @param symbolsToAdopt the set of symbols to be used. The caller should not
    + * delete this object after making this call.
    + * @param parseError Output param to receive errors occured during parsing
    + * @param status Output param set to success/failure code. If the
    + * pattern is invalid this will be set to a failure code.
    + * @stable ICU 2.0
    + */
    + DecimalFormat( const UnicodeString& pattern,
    + DecimalFormatSymbols* symbolsToAdopt,
    + UParseError& parseError,
    + UErrorCode& status);
    + /**
    + * Create a DecimalFormat from the given pattern and symbols.
    + * Use this constructor when you need to completely customize the
    + * behavior of the format.
    + * <P>
    + * To obtain standard formats for a given
    + * locale, use the factory methods on NumberFormat such as
    + * createInstance or createCurrencyInstance. If you need only minor adjustments
    + * to a standard format, you can modify the format returned by
    + * a NumberFormat factory method.
    + *
    + * @param pattern a non-localized pattern string
    + * @param symbols the set of symbols to be used
    + * @param status Output param set to success/failure code. If the
    + * pattern is invalid this will be set to a failure code.
    + * @stable ICU 2.0
    + */
    + DecimalFormat( const UnicodeString& pattern,
    + const DecimalFormatSymbols& symbols,
    + UErrorCode& status);
    +
    + /**
    + * Copy constructor.
    + *
    + * @param source the DecimalFormat object to be copied from.
    + * @stable ICU 2.0
    + */
    + DecimalFormat(const DecimalFormat& source);
    +
    + /**
    + * Assignment operator.
    + *
    + * @param rhs the DecimalFormat object to be copied.
    + * @stable ICU 2.0
    + */
    + DecimalFormat& operator=(const DecimalFormat& rhs);
    +
    + /**
    + * Destructor.
    + * @stable ICU 2.0
    + */
    + virtual ~DecimalFormat();
    +
    + /**
    + * Clone this Format object polymorphically. The caller owns the
    + * result and should delete it when done.
    + *
    + * @return a polymorphic copy of this DecimalFormat.
    + * @stable ICU 2.0
    + */
    + virtual Format* clone(void) const;
    +
    + /**
    + * Return true if the given Format objects are semantically equal.
    + * Objects of different subclasses are considered unequal.
    + *
    + * @param other the object to be compared with.
    + * @return true if the given Format objects are semantically equal.
    + * @stable ICU 2.0
    + */
    + virtual UBool operator==(const Format& other) const;
    +
    + /**
    + * Format a double or long number using base-10 representation.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(double number,
    + UnicodeString& appendTo,
    + FieldPosition& pos) const;
    + /**
    + * Format a long number using base-10 representation.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(int32_t number,
    + UnicodeString& appendTo,
    + FieldPosition& pos) const;
    + /**
    + * Format an int64 number using base-10 representation.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.8
    + */
    + virtual UnicodeString& format(int64_t number,
    + UnicodeString& appendTo,
    + FieldPosition& pos) const;
    +
    + /**
    + * Format a Formattable using base-10 representation.
    + *
    + * @param obj The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param status Error code indicating success or failure.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(const Formattable& obj,
    + UnicodeString& appendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * Formats an object to produce a string.
    + *
    + * @param obj The object to format.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param status Output parameter filled in with success or failure status.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(const Formattable& obj,
    + UnicodeString& appendTo,
    + UErrorCode& status) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * Format a double number.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(double number,
    + UnicodeString& appendTo) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * Format a long number. These methods call the NumberFormat
    + * pure virtual format() methods with the default FieldPosition.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(int32_t number,
    + UnicodeString& appendTo) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * Format an int64 number. These methods call the NumberFormat
    + * pure virtual format() methods with the default FieldPosition.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.8
    + */
    + UnicodeString& format(int64_t number,
    + UnicodeString& appendTo) const;
    + /**
    + * Parse the given string using this object's choices. The method
    + * does string comparisons to try to find an optimal match.
    + * If no object can be parsed, index is unchanged, and NULL is
    + * returned. The result is returned as the most parsimonious
    + * type of Formattable that will accomodate all of the
    + * necessary precision. For example, if the result is exactly 12,
    + * it will be returned as a long. However, if it is 1.5, it will
    + * be returned as a double.
    + *
    + * @param text The text to be parsed.
    + * @param result Formattable to be set to the parse result.
    + * If parse fails, return contents are undefined.
    + * @param parsePosition The position to start parsing at on input.
    + * On output, moved to after the last successfully
    + * parse character. On parse failure, does not change.
    + * @see Formattable
    + * @stable ICU 2.0
    + */
    + virtual void parse(const UnicodeString& text,
    + Formattable& result,
    + ParsePosition& parsePosition) const;
    +
    + // Declare here again to get rid of function hiding problems.
    + /**
    + * Parse the given string using this object's choices.
    + *
    + * @param text The text to be parsed.
    + * @param result Formattable to be set to the parse result.
    + * @param status Output parameter filled in with success or failure status.
    + * @stable ICU 2.0
    + */
    + virtual void parse(const UnicodeString& text,
    + Formattable& result,
    + UErrorCode& status) const;
    +
    + /**
    + * Parses text from the given string as a currency amount. Unlike
    + * the parse() method, this method will attempt to parse a generic
    + * currency name, searching for a match of this object's locale's
    + * currency display names, or for a 3-letter ISO currency code.
    + * This method will fail if this format is not a currency format,
    + * that is, if it does not contain the currency pattern symbol
    + * (U+00A4) in its prefix or suffix.
    + *
    + * @param text the string to parse
    + * @param result output parameter to receive result. This will have
    + * its currency set to the parsed ISO currency code.
    + * @param pos input-output position; on input, the position within
    + * text to match; must have 0 <= pos.getIndex() < text.length();
    + * on output, the position after the last matched character. If
    + * the parse fails, the position in unchanged upon output.
    + * @return a reference to result
    + * @internal
    + */
    + virtual Formattable& parseCurrency(const UnicodeString& text,
    + Formattable& result,
    + ParsePosition& pos) const;
    +
    + /**
    + * Returns the decimal format symbols, which is generally not changed
    + * by the programmer or user.
    + * @return desired DecimalFormatSymbols
    + * @see DecimalFormatSymbols
    + * @stable ICU 2.0
    + */
    + virtual const DecimalFormatSymbols* getDecimalFormatSymbols(void) const;
    +
    + /**
    + * Sets the decimal format symbols, which is generally not changed
    + * by the programmer or user.
    + * @param symbolsToAdopt DecimalFormatSymbols to be adopted.
    + * @stable ICU 2.0
    + */
    + virtual void adoptDecimalFormatSymbols(DecimalFormatSymbols* symbolsToAdopt);
    +
    + /**
    + * Sets the decimal format symbols, which is generally not changed
    + * by the programmer or user.
    + * @param symbols DecimalFormatSymbols.
    + * @stable ICU 2.0
    + */
    + virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbols);
    +
    +
    + /**
    + * Get the positive prefix.
    + *
    + * @param result Output param which will receive the positive prefix.
    + * @return A reference to 'result'.
    + * Examples: +123, $123, sFr123
    + * @stable ICU 2.0
    + */
    + UnicodeString& getPositivePrefix(UnicodeString& result) const;
    +
    + /**
    + * Set the positive prefix.
    + *
    + * @param newValue the new value of the the positive prefix to be set.
    + * Examples: +123, $123, sFr123
    + * @stable ICU 2.0
    + */
    + virtual void setPositivePrefix(const UnicodeString& newValue);
    +
    + /**
    + * Get the negative prefix.
    + *
    + * @param result Output param which will receive the negative prefix.
    + * @return A reference to 'result'.
    + * Examples: -123, ($123) (with negative suffix), sFr-123
    + * @stable ICU 2.0
    + */
    + UnicodeString& getNegativePrefix(UnicodeString& result) const;
    +
    + /**
    + * Set the negative prefix.
    + *
    + * @param newValue the new value of the the negative prefix to be set.
    + * Examples: -123, ($123) (with negative suffix), sFr-123
    + * @stable ICU 2.0
    + */
    + virtual void setNegativePrefix(const UnicodeString& newValue);
    +
    + /**
    + * Get the positive suffix.
    + *
    + * @param result Output param which will receive the positive suffix.
    + * @return A reference to 'result'.
    + * Example: 123%
    + * @stable ICU 2.0
    + */
    + UnicodeString& getPositiveSuffix(UnicodeString& result) const;
    +
    + /**
    + * Set the positive suffix.
    + *
    + * @param newValue the new value of the positive suffix to be set.
    + * Example: 123%
    + * @stable ICU 2.0
    + */
    + virtual void setPositiveSuffix(const UnicodeString& newValue);
    +
    + /**
    + * Get the negative suffix.
    + *
    + * @param result Output param which will receive the negative suffix.
    + * @return A reference to 'result'.
    + * Examples: -123%, ($123) (with positive suffixes)
    + * @stable ICU 2.0
    + */
    + UnicodeString& getNegativeSuffix(UnicodeString& result) const;
    +
    + /**
    + * Set the negative suffix.
    + *
    + * @param newValue the new value of the negative suffix to be set.
    + * Examples: 123%
    + * @stable ICU 2.0
    + */
    + virtual void setNegativeSuffix(const UnicodeString& newValue);
    +
    + /**
    + * Get the multiplier for use in percent, permill, etc.
    + * For a percentage, set the suffixes to have "%" and the multiplier to be 100.
    + * (For Arabic, use arabic percent symbol).
    + * For a permill, set the suffixes to have "\\u2031" and the multiplier to be 1000.
    + *
    + * @return the multiplier for use in percent, permill, etc.
    + * Examples: with 100, 1.23 -> "123", and "123" -> 1.23
    + * @stable ICU 2.0
    + */
    + int32_t getMultiplier(void) const;
    +
    + /**
    + * Set the multiplier for use in percent, permill, etc.
    + * For a percentage, set the suffixes to have "%" and the multiplier to be 100.
    + * (For Arabic, use arabic percent symbol).
    + * For a permill, set the suffixes to have "\\u2031" and the multiplier to be 1000.
    + *
    + * @param newValue the new value of the multiplier for use in percent, permill, etc.
    + * Examples: with 100, 1.23 -> "123", and "123" -> 1.23
    + * @stable ICU 2.0
    + */
    + virtual void setMultiplier(int32_t newValue);
    +
    + /**
    + * Get the rounding increment.
    + * @return A positive rounding increment, or 0.0 if rounding
    + * is not in effect.
    + * @see #setRoundingIncrement
    + * @see #getRoundingMode
    + * @see #setRoundingMode
    + * @stable ICU 2.0
    + */
    + virtual double getRoundingIncrement(void) const;
    +
    + /**
    + * Set the rounding increment. This method also controls whether
    + * rounding is enabled.
    + * @param newValue A positive rounding increment, or 0.0 to disable rounding.
    + * Negative increments are equivalent to 0.0.
    + * @see #getRoundingIncrement
    + * @see #getRoundingMode
    + * @see #setRoundingMode
    + * @stable ICU 2.0
    + */
    + virtual void setRoundingIncrement(double newValue);
    +
    + /**
    + * Get the rounding mode.
    + * @return A rounding mode
    + * @see #setRoundingIncrement
    + * @see #getRoundingIncrement
    + * @see #setRoundingMode
    + * @stable ICU 2.0
    + */
    + virtual ERoundingMode getRoundingMode(void) const;
    +
    + /**
    + * Set the rounding mode. This has no effect unless the rounding
    + * increment is greater than zero.
    + * @param roundingMode A rounding mode
    + * @see #setRoundingIncrement
    + * @see #getRoundingIncrement
    + * @see #getRoundingMode
    + * @stable ICU 2.0
    + */
    + virtual void setRoundingMode(ERoundingMode roundingMode);
    +
    + /**
    + * Get the width to which the output of format() is padded.
    + * The width is counted in 16-bit code units.
    + * @return the format width, or zero if no padding is in effect
    + * @see #setFormatWidth
    + * @see #getPadCharacterString
    + * @see #setPadCharacter
    + * @see #getPadPosition
    + * @see #setPadPosition
    + * @stable ICU 2.0
    + */
    + virtual int32_t getFormatWidth(void) const;
    +
    + /**
    + * Set the width to which the output of format() is padded.
    + * The width is counted in 16-bit code units.
    + * This method also controls whether padding is enabled.
    + * @param width the width to which to pad the result of
    + * format(), or zero to disable padding. A negative
    + * width is equivalent to 0.
    + * @see #getFormatWidth
    + * @see #getPadCharacterString
    + * @see #setPadCharacter
    + * @see #getPadPosition
    + * @see #setPadPosition
    + * @stable ICU 2.0
    + */
    + virtual void setFormatWidth(int32_t width);
    +
    + /**
    + * Get the pad character used to pad to the format width. The
    + * default is ' '.
    + * @return a string containing the pad character. This will always
    + * have a length of one 32-bit code point.
    + * @see #setFormatWidth
    + * @see #getFormatWidth
    + * @see #setPadCharacter
    + * @see #getPadPosition
    + * @see #setPadPosition
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString getPadCharacterString() const;
    +
    + /**
    + * Set the character used to pad to the format width. If padding
    + * is not enabled, then this will take effect if padding is later
    + * enabled.
    + * @param padChar a string containing the pad charcter. If the string
    + * has length 0, then the pad characer is set to ' '. Otherwise
    + * padChar.char32At(0) will be used as the pad character.
    + * @see #setFormatWidth
    + * @see #getFormatWidth
    + * @see #getPadCharacterString
    + * @see #getPadPosition
    + * @see #setPadPosition
    + * @stable ICU 2.0
    + */
    + virtual void setPadCharacter(const UnicodeString &padChar);
    +
    + /**
    + * Get the position at which padding will take place. This is the location
    + * at which padding will be inserted if the result of format()
    + * is shorter than the format width.
    + * @return the pad position, one of kPadBeforePrefix,
    + * kPadAfterPrefix, kPadBeforeSuffix, or
    + * kPadAfterSuffix.
    + * @see #setFormatWidth
    + * @see #getFormatWidth
    + * @see #setPadCharacter
    + * @see #getPadCharacterString
    + * @see #setPadPosition
    + * @see #EPadPosition
    + * @stable ICU 2.0
    + */
    + virtual EPadPosition getPadPosition(void) const;
    +
    + /**
    + * Set the position at which padding will take place. This is the location
    + * at which padding will be inserted if the result of format()
    + * is shorter than the format width. This has no effect unless padding is
    + * enabled.
    + * @param padPos the pad position, one of kPadBeforePrefix,
    + * kPadAfterPrefix, kPadBeforeSuffix, or
    + * kPadAfterSuffix.
    + * @see #setFormatWidth
    + * @see #getFormatWidth
    + * @see #setPadCharacter
    + * @see #getPadCharacterString
    + * @see #getPadPosition
    + * @see #EPadPosition
    + * @stable ICU 2.0
    + */
    + virtual void setPadPosition(EPadPosition padPos);
    +
    + /**
    + * Return whether or not scientific notation is used.
    + * @return TRUE if this object formats and parses scientific notation
    + * @see #setScientificNotation
    + * @see #getMinimumExponentDigits
    + * @see #setMinimumExponentDigits
    + * @see #isExponentSignAlwaysShown
    + * @see #setExponentSignAlwaysShown
    + * @stable ICU 2.0
    + */
    + virtual UBool isScientificNotation(void);
    +
    + /**
    + * Set whether or not scientific notation is used. When scientific notation
    + * is used, the effective maximum number of integer digits is <= 8. If the
    + * maximum number of integer digits is set to more than 8, the effective
    + * maximum will be 1. This allows this call to generate a 'default' scientific
    + * number format without additional changes.
    + * @param useScientific TRUE if this object formats and parses scientific
    + * notation
    + * @see #isScientificNotation
    + * @see #getMinimumExponentDigits
    + * @see #setMinimumExponentDigits
    + * @see #isExponentSignAlwaysShown
    + * @see #setExponentSignAlwaysShown
    + * @stable ICU 2.0
    + */
    + virtual void setScientificNotation(UBool useScientific);
    +
    + /**
    + * Return the minimum exponent digits that will be shown.
    + * @return the minimum exponent digits that will be shown
    + * @see #setScientificNotation
    + * @see #isScientificNotation
    + * @see #setMinimumExponentDigits
    + * @see #isExponentSignAlwaysShown
    + * @see #setExponentSignAlwaysShown
    + * @stable ICU 2.0
    + */
    + virtual int8_t getMinimumExponentDigits(void) const;
    +
    + /**
    + * Set the minimum exponent digits that will be shown. This has no
    + * effect unless scientific notation is in use.
    + * @param minExpDig a value >= 1 indicating the fewest exponent digits
    + * that will be shown. Values less than 1 will be treated as 1.
    + * @see #setScientificNotation
    + * @see #isScientificNotation
    + * @see #getMinimumExponentDigits
    + * @see #isExponentSignAlwaysShown
    + * @see #setExponentSignAlwaysShown
    + * @stable ICU 2.0
    + */
    + virtual void setMinimumExponentDigits(int8_t minExpDig);
    +
    + /**
    + * Return whether the exponent sign is always shown.
    + * @return TRUE if the exponent is always prefixed with either the
    + * localized minus sign or the localized plus sign, false if only negative
    + * exponents are prefixed with the localized minus sign.
    + * @see #setScientificNotation
    + * @see #isScientificNotation
    + * @see #setMinimumExponentDigits
    + * @see #getMinimumExponentDigits
    + * @see #setExponentSignAlwaysShown
    + * @stable ICU 2.0
    + */
    + virtual UBool isExponentSignAlwaysShown(void);
    +
    + /**
    + * Set whether the exponent sign is always shown. This has no effect
    + * unless scientific notation is in use.
    + * @param expSignAlways TRUE if the exponent is always prefixed with either
    + * the localized minus sign or the localized plus sign, false if only
    + * negative exponents are prefixed with the localized minus sign.
    + * @see #setScientificNotation
    + * @see #isScientificNotation
    + * @see #setMinimumExponentDigits
    + * @see #getMinimumExponentDigits
    + * @see #isExponentSignAlwaysShown
    + * @stable ICU 2.0
    + */
    + virtual void setExponentSignAlwaysShown(UBool expSignAlways);
    +
    + /**
    + * Return the grouping size. Grouping size is the number of digits between
    + * grouping separators in the integer portion of a number. For example,
    + * in the number "123,456.78", the grouping size is 3.
    + *
    + * @return the grouping size.
    + * @see setGroupingSize
    + * @see NumberFormat::isGroupingUsed
    + * @see DecimalFormatSymbols::getGroupingSeparator
    + * @stable ICU 2.0
    + */
    + int32_t getGroupingSize(void) const;
    +
    + /**
    + * Set the grouping size. Grouping size is the number of digits between
    + * grouping separators in the integer portion of a number. For example,
    + * in the number "123,456.78", the grouping size is 3.
    + *
    + * @param newValue the new value of the grouping size.
    + * @see getGroupingSize
    + * @see NumberFormat::setGroupingUsed
    + * @see DecimalFormatSymbols::setGroupingSeparator
    + * @stable ICU 2.0
    + */
    + virtual void setGroupingSize(int32_t newValue);
    +
    + /**
    + * Return the secondary grouping size. In some locales one
    + * grouping interval is used for the least significant integer
    + * digits (the primary grouping size), and another is used for all
    + * others (the secondary grouping size). A formatter supporting a
    + * secondary grouping size will return a positive integer unequal
    + * to the primary grouping size returned by
    + * getGroupingSize(). For example, if the primary
    + * grouping size is 4, and the secondary grouping size is 2, then
    + * the number 123456789 formats as "1,23,45,6789", and the pattern
    + * appears as "#,##,###0".
    + * @return the secondary grouping size, or a value less than
    + * one if there is none
    + * @see setSecondaryGroupingSize
    + * @see NumberFormat::isGroupingUsed
    + * @see DecimalFormatSymbols::getGroupingSeparator
    + * @stable ICU 2.4
    + */
    + int32_t getSecondaryGroupingSize(void) const;
    +
    + /**
    + * Set the secondary grouping size. If set to a value less than 1,
    + * then secondary grouping is turned off, and the primary grouping
    + * size is used for all intervals, not just the least significant.
    + *
    + * @param newValue the new value of the secondary grouping size.
    + * @see getSecondaryGroupingSize
    + * @see NumberFormat#setGroupingUsed
    + * @see DecimalFormatSymbols::setGroupingSeparator
    + * @stable ICU 2.4
    + */
    + virtual void setSecondaryGroupingSize(int32_t newValue);
    +
    + /**
    + * Allows you to get the behavior of the decimal separator with integers.
    + * (The decimal separator will always appear with decimals.)
    + *
    + * @return TRUE if the decimal separator always appear with decimals.
    + * Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
    + * @stable ICU 2.0
    + */
    + UBool isDecimalSeparatorAlwaysShown(void) const;
    +
    + /**
    + * Allows you to set the behavior of the decimal separator with integers.
    + * (The decimal separator will always appear with decimals.)
    + *
    + * @param newValue set TRUE if the decimal separator will always appear with decimals.
    + * Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
    + * @stable ICU 2.0
    + */
    + virtual void setDecimalSeparatorAlwaysShown(UBool newValue);
    +
    + /**
    + * Synthesizes a pattern string that represents the current state
    + * of this Format object.
    + *
    + * @param result Output param which will receive the pattern.
    + * Previous contents are deleted.
    + * @return A reference to 'result'.
    + * @see applyPattern
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& toPattern(UnicodeString& result) const;
    +
    + /**
    + * Synthesizes a localized pattern string that represents the current
    + * state of this Format object.
    + *
    + * @param result Output param which will receive the localized pattern.
    + * Previous contents are deleted.
    + * @return A reference to 'result'.
    + * @see applyPattern
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& toLocalizedPattern(UnicodeString& result) const;
    +
    + /**
    + * Apply the given pattern to this Format object. A pattern is a
    + * short-hand specification for the various formatting properties.
    + * These properties can also be changed individually through the
    + * various setter methods.
    + * <P>
    + * There is no limit to integer digits are set
    + * by this routine, since that is the typical end-user desire;
    + * use setMaximumInteger if you want to set a real value.
    + * For negative numbers, use a second pattern, separated by a semicolon
    + * <pre>
    + * . Example "#,#00.0#" -> 1,234.56
    + * </pre>
    + * This means a minimum of 2 integer digits, 1 fraction digit, and
    + * a maximum of 2 fraction digits.
    + * <pre>
    + * . Example: "#,#00.0#;(#,#00.0#)" for negatives in parantheses.
    + * </pre>
    + * In negative patterns, the minimum and maximum counts are ignored;
    + * these are presumed to be set in the positive pattern.
    + *
    + * @param pattern The pattern to be applied.
    + * @param parseError Struct to recieve information on position
    + * of error if an error is encountered
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + * @stable ICU 2.0
    + */
    + virtual void applyPattern(const UnicodeString& pattern,
    + UParseError& parseError,
    + UErrorCode& status);
    + /**
    + * Sets the pattern.
    + * @param pattern The pattern to be applied.
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + * @stable ICU 2.0
    + */
    + virtual void applyPattern(const UnicodeString& pattern,
    + UErrorCode& status);
    +
    + /**
    + * Apply the given pattern to this Format object. The pattern
    + * is assumed to be in a localized notation. A pattern is a
    + * short-hand specification for the various formatting properties.
    + * These properties can also be changed individually through the
    + * various setter methods.
    + * <P>
    + * There is no limit to integer digits are set
    + * by this routine, since that is the typical end-user desire;
    + * use setMaximumInteger if you want to set a real value.
    + * For negative numbers, use a second pattern, separated by a semicolon
    + * <pre>
    + * . Example "#,#00.0#" -> 1,234.56
    + * </pre>
    + * This means a minimum of 2 integer digits, 1 fraction digit, and
    + * a maximum of 2 fraction digits.
    + *
    + * Example: "#,#00.0#;(#,#00.0#)" for negatives in parantheses.
    + *
    + * In negative patterns, the minimum and maximum counts are ignored;
    + * these are presumed to be set in the positive pattern.
    + *
    + * @param pattern The localized pattern to be applied.
    + * @param parseError Struct to recieve information on position
    + * of error if an error is encountered
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + * @stable ICU 2.0
    + */
    + virtual void applyLocalizedPattern(const UnicodeString& pattern,
    + UParseError& parseError,
    + UErrorCode& status);
    +
    + /**
    + * Apply the given pattern to this Format object.
    + *
    + * @param pattern The localized pattern to be applied.
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + * @stable ICU 2.0
    + */
    + virtual void applyLocalizedPattern(const UnicodeString& pattern,
    + UErrorCode& status);
    +
    +
    + /**
    + * Sets the maximum number of digits allowed in the integer portion of a
    + * number. This override limits the integer digit count to 309.
    + *
    + * @param newValue the new value of the maximum number of digits
    + * allowed in the integer portion of a number.
    + * @see NumberFormat#setMaximumIntegerDigits
    + * @stable ICU 2.0
    + */
    + virtual void setMaximumIntegerDigits(int32_t newValue);
    +
    + /**
    + * Sets the minimum number of digits allowed in the integer portion of a
    + * number. This override limits the integer digit count to 309.
    + *
    + * @param newValue the new value of the minimum number of digits
    + * allowed in the integer portion of a number.
    + * @see NumberFormat#setMinimumIntegerDigits
    + * @stable ICU 2.0
    + */
    + virtual void setMinimumIntegerDigits(int32_t newValue);
    +
    + /**
    + * Sets the maximum number of digits allowed in the fraction portion of a
    + * number. This override limits the fraction digit count to 340.
    + *
    + * @param newValue the new value of the maximum number of digits
    + * allowed in the fraction portion of a number.
    + * @see NumberFormat#setMaximumFractionDigits
    + * @stable ICU 2.0
    + */
    + virtual void setMaximumFractionDigits(int32_t newValue);
    +
    + /**
    + * Sets the minimum number of digits allowed in the fraction portion of a
    + * number. This override limits the fraction digit count to 340.
    + *
    + * @param newValue the new value of the minimum number of digits
    + * allowed in the fraction portion of a number.
    + * @see NumberFormat#setMinimumFractionDigits
    + * @stable ICU 2.0
    + */
    + virtual void setMinimumFractionDigits(int32_t newValue);
    +
    + /**
    + * Returns the minimum number of significant digits that will be
    + * displayed. This value has no effect unless areSignificantDigitsUsed()
    + * returns true.
    + * @return the fewest significant digits that will be shown
    + * @stable ICU 3.0
    + */
    + int32_t getMinimumSignificantDigits() const;
    +
    + /**
    + * Returns the maximum number of significant digits that will be
    + * displayed. This value has no effect unless areSignificantDigitsUsed()
    + * returns true.
    + * @return the most significant digits that will be shown
    + * @stable ICU 3.0
    + */
    + int32_t getMaximumSignificantDigits() const;
    +
    + /**
    + * Sets the minimum number of significant digits that will be
    + * displayed. If <code>min</code> is less than one then it is set
    + * to one. If the maximum significant digits count is less than
    + * <code>min</code>, then it is set to <code>min</code>. This
    + * value has no effect unless areSignificantDigits() returns true.
    + * @param min the fewest significant digits to be shown
    + * @stable ICU 3.0
    + */
    + void setMinimumSignificantDigits(int32_t min);
    +
    + /**
    + * Sets the maximum number of significant digits that will be
    + * displayed. If <code>max</code> is less than one then it is set
    + * to one. If the minimum significant digits count is greater
    + * than <code>max</code>, then it is set to <code>max</code>.
    + * This value has no effect unless areSignificantDigits() returns
    + * true.
    + * @param max the most significant digits to be shown
    + * @stable ICU 3.0
    + */
    + void setMaximumSignificantDigits(int32_t max);
    +
    + /**
    + * Returns true if significant digits are in use, or false if
    + * integer and fraction digit counts are in use.
    + * @return true if significant digits are in use
    + * @stable ICU 3.0
    + */
    + UBool areSignificantDigitsUsed() const;
    +
    + /**
    + * Sets whether significant digits are in use, or integer and
    + * fraction digit counts are in use.
    + * @param useSignificantDigits true to use significant digits, or
    + * false to use integer and fraction digit counts
    + * @stable ICU 3.0
    + */
    + void setSignificantDigitsUsed(UBool useSignificantDigits);
    +
    + public:
    + /**
    + * Sets the currency used to display currency
    + * amounts. This takes effect immediately, if this format is a
    + * currency format. If this format is not a currency format, then
    + * the currency is used if and when this object becomes a
    + * currency format through the application of a new pattern.
    + * @param theCurrency a 3-letter ISO code indicating new currency
    + * to use. It need not be null-terminated. May be the empty
    + * string or NULL to indicate no currency.
    + * @param ec input-output error code
    + * @stable ICU 3.0
    + */
    + virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec);
    +
    + /**
    + * Sets the currency used to display currency amounts. See
    + * setCurrency(const UChar*, UErrorCode&).
    + * @deprecated ICU 3.0. Use setCurrency(const UChar*, UErrorCode&).
    + */
    + virtual void setCurrency(const UChar* theCurrency);
    +
    + /**
    + * The resource tags we use to retrieve decimal format data from
    + * locale resource bundles.
    + * @deprecated ICU 3.4. This string has no public purpose. Please don't use it.
    + */
    + static const char fgNumberPatterns[];
    +
    +public:
    +
    + /**
    + * Return the class ID for this class. This is useful only for
    + * comparing to a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . Derived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 2.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
    + * This method is to implement a simple version of RTTI, since not all
    + * C++ compilers support genuine RTTI. Polymorphic operator==() and
    + * clone() methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 2.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +
    +private:
    + DecimalFormat(); // default constructor not implemented
    +
    + int32_t precision(UBool isIntegral) const;
    +
    + /**
    + * Do real work of constructing a new DecimalFormat.
    + */
    + void construct(UErrorCode& status,
    + UParseError& parseErr,
    + const UnicodeString* pattern = 0,
    + DecimalFormatSymbols* symbolsToAdopt = 0
    + );
    +
    + /**
    + * Does the real work of generating a pattern.
    + *
    + * @param result Output param which will receive the pattern.
    + * Previous contents are deleted.
    + * @param localized TRUE return localized pattern.
    + * @return A reference to 'result'.
    + */
    + UnicodeString& toPattern(UnicodeString& result, UBool localized) const;
    +
    + /**
    + * Does the real work of applying a pattern.
    + * @param pattern The pattern to be applied.
    + * @param localized If true, the pattern is localized; else false.
    + * @param parseError Struct to recieve information on position
    + * of error if an error is encountered
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + */
    + void applyPattern(const UnicodeString& pattern,
    + UBool localized,
    + UParseError& parseError,
    + UErrorCode& status);
    + /**
    + * Do the work of formatting a number, either a double or a long.
    + *
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param fieldPosition On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param digits the digits to be formatted.
    + * @param isInteger if TRUE format the digits as Integer.
    + * @return Reference to 'appendTo' parameter.
    + */
    + UnicodeString& subformat(UnicodeString& appendTo,
    + FieldPosition& fieldPosition,
    + DigitList& digits,
    + UBool isInteger) const;
    +
    + void parse(const UnicodeString& text,
    + Formattable& result,
    + ParsePosition& pos,
    + UBool parseCurrency) const;
    +
    + enum {
    + fgStatusInfinite,
    + fgStatusLength // Leave last in list.
    + } StatusFlags;
    +
    + UBool subparse(const UnicodeString& text, ParsePosition& parsePosition,
    + DigitList& digits, UBool* status,
    + UChar* currency) const;
    +
    + int32_t skipPadding(const UnicodeString& text, int32_t position) const;
    +
    + int32_t compareAffix(const UnicodeString& input,
    + int32_t pos,
    + UBool isNegative,
    + UBool isPrefix,
    + UChar* currency) const;
    +
    + static int32_t compareSimpleAffix(const UnicodeString& affix,
    + const UnicodeString& input,
    + int32_t pos,
    + UBool strict);
    +
    + static int32_t skipRuleWhiteSpace(const UnicodeString& text, int32_t pos);
    +
    + static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos);
    +
    + int32_t compareComplexAffix(const UnicodeString& affixPat,
    + const UnicodeString& input,
    + int32_t pos,
    + UChar* currency) const;
    +
    + static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
    +
    + static int32_t match(const UnicodeString& text, int32_t pos, const UnicodeString& str);
    +
    + static UBool matchSymbol(const UnicodeString &text, int32_t position, int32_t length, const UnicodeString &symbol,
    + UnicodeSet *sset, UChar32 schar);
    +
    + /**
    + * Get a decimal format symbol.
    + * Returns a const reference to the symbol string.
    + * @internal
    + */
    + inline const UnicodeString &getConstSymbol(DecimalFormatSymbols::ENumberFormatSymbol symbol) const;
    +
    + int32_t appendAffix(UnicodeString& buf, double number,
    + UBool isNegative, UBool isPrefix) const;
    +
    + /**
    + * Append an affix to the given UnicodeString, using quotes if
    + * there are special characters. Single quotes themselves must be
    + * escaped in either case.
    + */
    + void appendAffixPattern(UnicodeString& appendTo, const UnicodeString& affix,
    + UBool localized) const;
    +
    + void appendAffixPattern(UnicodeString& appendTo,
    + const UnicodeString* affixPattern,
    + const UnicodeString& expAffix, UBool localized) const;
    +
    + void expandAffix(const UnicodeString& pattern,
    + UnicodeString& affix,
    + double number,
    + UBool doFormat) const;
    +
    + void expandAffixes();
    +
    + static double round(double a, ERoundingMode mode, UBool isNegative);
    +
    + void addPadding(UnicodeString& appendTo,
    + FieldPosition& fieldPosition,
    + int32_t prefixLen, int32_t suffixLen) const;
    +
    + UBool isGroupingPosition(int32_t pos) const;
    +
    + void setCurrencyForSymbols();
    +
    + /**
    + * Constants.
    + */
    + //static const int8_t fgMaxDigit; // The largest digit, in this case 9
    +
    + /*transient*/ //DigitList* fDigitList;
    +
    + UnicodeString fPositivePrefix;
    + UnicodeString fPositiveSuffix;
    + UnicodeString fNegativePrefix;
    + UnicodeString fNegativeSuffix;
    + UnicodeString* fPosPrefixPattern;
    + UnicodeString* fPosSuffixPattern;
    + UnicodeString* fNegPrefixPattern;
    + UnicodeString* fNegSuffixPattern;
    +
    + /**
    + * Formatter for ChoiceFormat-based currency names. If this field
    + * is not null, then delegate to it to format currency symbols.
    + * @since ICU 2.6
    + */
    + ChoiceFormat* fCurrencyChoice;
    +
    + int32_t fMultiplier;
    + int32_t fGroupingSize;
    + int32_t fGroupingSize2;
    + UBool fDecimalSeparatorAlwaysShown;
    + /*transient*/ UBool fIsCurrencyFormat;
    + DecimalFormatSymbols* fSymbols;
    +
    + UBool fUseSignificantDigits;
    + int32_t fMinSignificantDigits;
    + int32_t fMaxSignificantDigits;
    +
    + UBool fUseExponentialNotation;
    + int8_t fMinExponentDigits;
    + UBool fExponentSignAlwaysShown;
    +
    + /* If fRoundingIncrement is NULL, there is no rounding. Otherwise, round to
    + * fRoundingIncrement.getDouble(). Since this operation may be expensive,
    + * we cache the result in fRoundingDouble. All methods that update
    + * fRoundingIncrement also update fRoundingDouble. */
    + DigitList* fRoundingIncrement;
    + /*transient*/ double fRoundingDouble;
    + ERoundingMode fRoundingMode;
    +
    + UChar32 fPad;
    + int32_t fFormatWidth;
    + EPadPosition fPadPosition;
    +
    +protected:
    +
    + /**
    + * Returns the currency in effect for this formatter. Subclasses
    + * should override this method as needed. Unlike getCurrency(),
    + * this method should never return "".
    + * @result output parameter for null-terminated result, which must
    + * have a capacity of at least 4
    + * @internal
    + */
    + virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const;
    +
    + /** number of integer digits
    + * @stable ICU 2.4
    + */
    + static const int32_t kDoubleIntegerDigits;
    + /** number of fraction digits
    + * @stable ICU 2.4
    + */
    + static const int32_t kDoubleFractionDigits;
    +
    + /**
    + * When someone turns on scientific mode, we assume that more than this
    + * number of digits is due to flipping from some other mode that didn't
    + * restrict the maximum, and so we force 1 integer digit. We don't bother
    + * to track and see if someone is using exponential notation with more than
    + * this number, it wouldn't make sense anyway, and this is just to make sure
    + * that someone turning on scientific mode with default settings doesn't
    + * end up with lots of zeroes.
    + * @stable ICU 2.8
    + */
    + static const int32_t kMaxScientificIntegerDigits;
    +};
    +
    +inline UnicodeString&
    +DecimalFormat::format(const Formattable& obj,
    + UnicodeString& appendTo,
    + UErrorCode& status) const {
    + // Don't use Format:: - use immediate base class only,
    + // in case immediate base modifies behavior later.
    + return NumberFormat::format(obj, appendTo, status);
    +}
    +
    +inline UnicodeString&
    +DecimalFormat::format(double number,
    + UnicodeString& appendTo) const {
    + FieldPosition pos(0);
    + return format(number, appendTo, pos);
    +}
    +
    +inline UnicodeString&
    +DecimalFormat::format(int32_t number,
    + UnicodeString& appendTo) const {
    + FieldPosition pos(0);
    + return format((int64_t)number, appendTo, pos);
    +}
    +
    +inline const UnicodeString &
    +DecimalFormat::getConstSymbol(DecimalFormatSymbols::ENumberFormatSymbol symbol) const {
    + return fSymbols->getConstSymbol(symbol);
    +}
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // _DECIMFMT
    +//eof

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/docmain.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/docmain.h b/platform/osx/icu/unicode/docmain.h
    new file mode 100644
    index 0000000..973ebea
    --- /dev/null
    +++ b/platform/osx/icu/unicode/docmain.h
    @@ -0,0 +1,202 @@
    +/********************************************************************
    + * COPYRIGHT:
    + * Copyright (c) 1997-2007, International Business Machines Corporation and
    + * others. All Rights Reserved.
    + *
    + * FILE NAME: DOCMAIN.h
    + *
    + * Date Name Description
    + * 12/11/2000 Ram Creation.
    + */
    +
    +/* This file contains documentation for Doxygen and doesnot have
    + * any significance with respect to C or C++ API
    + */
    +
    +/*! \mainpage
    + *
    + * \section API API Reference Usage
    + *
    + * <h3>C++ Programmers:</h3>
    + * <p>Use <a href="hierarchy.html">Class Hierarchy</a> or <a href="classes.html"> Alphabetical List </a>
    + * or <a href="annotated.html"> Compound List</a>
    + * to find the class you are interested in. For example, to find BreakIterator,
    + * you can go to the <a href="classes.html"> Alphabetical List</a>, then click on
    + * "BreakIterator". Once you are at the class, you will find an inheritance
    + * chart, a list of the public members, a detailed description of the class,
    + * then detailed member descriptions.</p>
    + *
    + * <h3>C Programmers:</h3>
    + * <p>Use <a href="#Module">Module List</a> or <a href="globals.html">File Members</a>
    + * to find a list of all the functions and constants.
    + * For example, to find BreakIterator functions you would click on
    + * <a href="files.html"> File List</a>,
    + * then find "ubrk.h" and click on it. You will find descriptions of Defines,
    + * Typedefs, Enumerations, and Functions, with detailed descriptions below.
    + * If you want to find a specific function, such as ubrk_next(), then click
    + * first on <a href="globals.html"> File Members</a>, then use your browser
    + * Find dialog to search for "ubrk_next()".</p>
    + *
    + *
    + * <h3>API References for Previous Releases</h3>
    + * <p>The API References for each release of ICU are also available as
    + * a zip file from the ICU
    + * <a href="http://icu-project.org/download/">download page</a>.</p>
    + *
    + * <hr>
    + *
    + * <h2>Architecture (User's Guide)</h2>
    + * <ul>
    + * <li><a href="http://icu-project.org/userguide/">Introduction</a></li>
    + * <li><a href="http://icu-project.org/userguide/i18n.html">Internationalization</a></li>
    + * <li><a href="http://icu-project.org/userguide/design.html">Locale Model</a></li>
    + * <li><a href="http://icu-project.org/userguide/design.html">Multithreading</a></li>
    + * <li><a href="http://icu-project.org/userguide/conversion.html">Conversion</a></li>
    + * <li><a href="http://icu-project.org/userguide/design.html">Error Handling</a></li>
    + * </ul>
    + *
    + * <hr>
    + *\htmlonly <h2><a NAME="Module">Module List</a></h2> \endhtmlonly
    + * <table border="1" cols="3" align="center">
    + * <tr>
    + * <td><strong>Module Name</strong></td>
    + * <td><strong>C</strong></td>
    + * <td><strong>C++</strong></td>
    + * </tr>
    + * <tr>
    + * <td>Basic Types and Constants</td>
    + * <td>utypes.h</td>
    + * <td>utypes.h</td>
    + * </tr>
    + * <tr>
    + * <td>Strings and Character Iteration</td>
    + * <td>ustring.h, utf.h</td>
    + * <td>UnicodeString, CharacterIterator</td>
    + * </tr>
    + * <tr>
    + * <td>Unicode Character<br>Properties and Names</td>
    + * <td>uchar.h</td>
    + * <td>uchar.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Codepage Conversion</td>
    + * <td>ucnv.h</td>
    + * <td>ucnv.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Unicode Text Compression</td>
    + * <td>ucnv.h <br> (encoding name "SCSU" or "BOCU-1")</td>
    + * <td>ucnv.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Locales </td>
    + * <td>uloc.h</a></td>
    + * <td>Locale</td>
    + * </tr>
    + * <tr>
    + * <td>Resource Bundles</td>
    + * <td>ures.h</td>
    + * <td>ResourceBundle</td>
    + * </tr>
    + * <tr>
    + * <td>Normalization</td>
    + * <td>unorm.h</td>
    + * <td>Normalizer</td>
    + * </tr>
    + * <tr>
    + * <td>Calendars</td>
    + * <td>ucal.h</td>
    + * <td>Calendar</td>
    + * </tr>
    + * <tr>
    + * <td>Date and Time Formatting</td>
    + * <td>udat.h</td>
    + * <td>DateFormat</td>
    + * </tr>
    + * <tr>
    + * <td>Message Formatting</td>
    + * <td>umsg.h</td>
    + * <td>MessageFormat</td>
    + * </tr>
    + * <tr>
    + * <td>Number Formatting</td>
    + * <td>unum.h</td>
    + * <td>NumberFormat</td>
    + * </tr>
    + * <tr>
    + * <td>Number Spellout <br> (Rule Based Number Formatting)</td>
    + * <td>unum.h <br> (use UNUM_SPELLOUT)</td>
    + * <td>RuleBasedNumberFormat</td>
    + * </tr>
    + * <tr>
    + * <td>Text Transformation <br> (Transliteration)</td>
    + * <td>utrans.h</td>
    + * <td>Transliterator</td>
    + * </tr>
    + * <tr>
    + * <td>Bidirectional Algorithm</td>
    + * <td>ubidi.h</td>
    + * <td>ubidi.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Arabic Shaping</td>
    + * <td>ushape.h</td>
    + * <td>ushape.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Collation</td>
    + * <td>ucol.h</td>
    + * <td>Collator</td>
    + * </tr>
    + * <tr>
    + * <td>String Searching</td>
    + * <td>usearch.h</td>
    + * <td>StringSearch</td>
    + * </tr>
    + * <tr>
    + * <td>Text Boundary Analysis <br> (Break Iteration)</td>
    + * <td>ubrk.h</td>
    + * <td>BreakIterator</td>
    + * </tr>
    + * <tr>
    + * <td>Unicode Set</td>
    + * <td>uset.h</td>
    + * <td>UnicodeSet</td>
    + * </tr>
    + * <tr>
    + * <td>Regular Expressions</td>
    + * <td>uregex.h</td>
    + * <td>RegexPattern, RegexMatcher</td>
    + * </tr>
    + * <tr>
    + * <td>StringPrep</td>
    + * <td>usprep.h</td>
    + * <td>usprep.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>International Domain Names in Applications</td>
    + * <td>uidna.h</td>
    + * <td>uidna.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Universal Time Scale</td>
    + * <td>utmscale.h</td>
    + * <td>utmscale.h C API</td>
    + * </tr>
    + * <tr>
    + * <td>Basic Layout Engine Types and Constants</td>
    + * <td>(no C API)</td>
    + * <td>LETypes.h</td>
    + * </tr>
    + * <tr>
    + * <td>Complex Text Layout</td>
    + * <td>(no C API)</td>
    + * <td>LayoutEngine, ParagraphLayout</td>
    + * </tr>
    + * <tr>
    + * <td>ICU I/O</td>
    + * <td>ustdio.h</td>
    + * <td>ustream.h</td>
    + * </tr>
    + * </table>
    + */
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/ubidi.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/ubidi.h b/platform/osx/icu/unicode/ubidi.h
    new file mode 100644
    index 0000000..25f22b9
    --- /dev/null
    +++ b/platform/osx/icu/unicode/ubidi.h
    @@ -0,0 +1,2013 @@
    +/*
    +******************************************************************************
    +*
    +* Copyright (C) 1999-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +******************************************************************************
    +* file name: ubidi.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* created on: 1999jul27
    +* created by: Markus W. Scherer, updated by Matitiahu Allouche
    +*/
    +
    +#ifndef UBIDI_H
    +#define UBIDI_H
    +
    +#include "unicode/utypes.h"
    +#include "unicode/uchar.h"
    +
    +/**
    + *\file
    + * \brief C API: Bidi algorithm
    + *
    + * <h2>Bidi algorithm for ICU</h2>
    + *
    + * This is an implementation of the Unicode Bidirectional algorithm.
    + * The algorithm is defined in the
    + * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>,
    + * version 13, also described in The Unicode Standard, Version 4.0 .<p>
    + *
    + * Note: Libraries that perform a bidirectional algorithm and
    + * reorder strings accordingly are sometimes called "Storage Layout Engines".
    + * ICU's Bidi and shaping (u_shapeArabic()) APIs can be used at the core of such
    + * "Storage Layout Engines".
    + *
    + * <h3>General remarks about the API:</h3>
    + *
    + * In functions with an error code parameter,
    + * the <code>pErrorCode</code> pointer must be valid
    + * and the value that it points to must not indicate a failure before
    + * the function call. Otherwise, the function returns immediately.
    + * After the function call, the value indicates success or failure.<p>
    + *
    + * The &quot;limit&quot; of a sequence of characters is the position just after their
    + * last character, i.e., one more than that position.<p>
    + *
    + * Some of the API functions provide access to &quot;runs&quot;.
    + * Such a &quot;run&quot; is defined as a sequence of characters
    + * that are at the same embedding level
    + * after performing the Bidi algorithm.<p>
    + *
    + * @author Markus W. Scherer
    + * @version 1.0
    + *
    + *
    + * <h4> Sample code for the ICU Bidi API </h4>
    + *
    + * <h5>Rendering a paragraph with the ICU Bidi API</h5>
    + *
    + * This is (hypothetical) sample code that illustrates
    + * how the ICU Bidi API could be used to render a paragraph of text.
    + * Rendering code depends highly on the graphics system,
    + * therefore this sample code must make a lot of assumptions,
    + * which may or may not match any existing graphics system's properties.
    + *
    + * <p>The basic assumptions are:</p>
    + * <ul>
    + * <li>Rendering is done from left to right on a horizontal line.</li>
    + * <li>A run of single-style, unidirectional text can be rendered at once.</li>
    + * <li>Such a run of text is passed to the graphics system with
    + * characters (code units) in logical order.</li>
    + * <li>The line-breaking algorithm is very complicated
    + * and Locale-dependent -
    + * and therefore its implementation omitted from this sample code.</li>
    + * </ul>
    + *
    + * <pre>
    + * \code
    + *#include "unicode/ubidi.h"
    + *
    + *typedef enum {
    + * styleNormal=0, styleSelected=1,
    + * styleBold=2, styleItalics=4,
    + * styleSuper=8, styleSub=16
    + *} Style;
    + *
    + *typedef struct { int32_t limit; Style style; } StyleRun;
    + *
    + *int getTextWidth(const UChar *text, int32_t start, int32_t limit,
    + * const StyleRun *styleRuns, int styleRunCount);
    + *
    + * // set *pLimit and *pStyleRunLimit for a line
    + * // from text[start] and from styleRuns[styleRunStart]
    + * // using ubidi_getLogicalRun(para, ...)
    + *void getLineBreak(const UChar *text, int32_t start, int32_t *pLimit,
    + * UBiDi *para,
    + * const StyleRun *styleRuns, int styleRunStart, int *pStyleRunLimit,
    + * int *pLineWidth);
    + *
    + * // render runs on a line sequentially, always from left to right
    + *
    + * // prepare rendering a new line
    + * void startLine(UBiDiDirection textDirection, int lineWidth);
    + *
    + * // render a run of text and advance to the right by the run width
    + * // the text[start..limit-1] is always in logical order
    + * void renderRun(const UChar *text, int32_t start, int32_t limit,
    + * UBiDiDirection textDirection, Style style);
    + *
    + * // We could compute a cross-product
    + * // from the style runs with the directional runs
    + * // and then reorder it.
    + * // Instead, here we iterate over each run type
    + * // and render the intersections -
    + * // with shortcuts in simple (and common) cases.
    + * // renderParagraph() is the main function.
    + *
    + * // render a directional run with
    + * // (possibly) multiple style runs intersecting with it
    + * void renderDirectionalRun(const UChar *text,
    + * int32_t start, int32_t limit,
    + * UBiDiDirection direction,
    + * const StyleRun *styleRuns, int styleRunCount) {
    + * int i;
    + *
    + * // iterate over style runs
    + * if(direction==UBIDI_LTR) {
    + * int styleLimit;
    + *
    + * for(i=0; i<styleRunCount; ++i) {
    + * styleLimit=styleRun[i].limit;
    + * if(start<styleLimit) {
    + * if(styleLimit>limit) { styleLimit=limit; }
    + * renderRun(text, start, styleLimit,
    + * direction, styleRun[i].style);
    + * if(styleLimit==limit) { break; }
    + * start=styleLimit;
    + * }
    + * }
    + * } else {
    + * int styleStart;
    + *
    + * for(i=styleRunCount-1; i>=0; --i) {
    + * if(i>0) {
    + * styleStart=styleRun[i-1].limit;
    + * } else {
    + * styleStart=0;
    + * }
    + * if(limit>=styleStart) {
    + * if(styleStart<start) { styleStart=start; }
    + * renderRun(text, styleStart, limit,
    + * direction, styleRun[i].style);
    + * if(styleStart==start) { break; }
    + * limit=styleStart;
    + * }
    + * }
    + * }
    + * }
    + *
    + * // the line object represents text[start..limit-1]
    + * void renderLine(UBiDi *line, const UChar *text,
    + * int32_t start, int32_t limit,
    + * const StyleRun *styleRuns, int styleRunCount) {
    + * UBiDiDirection direction=ubidi_getDirection(line);
    + * if(direction!=UBIDI_MIXED) {
    + * // unidirectional
    + * if(styleRunCount<=1) {
    + * renderRun(text, start, limit, direction, styleRuns[0].style);
    + * } else {
    + * renderDirectionalRun(text, start, limit,
    + * direction, styleRuns, styleRunCount);
    + * }
    + * } else {
    + * // mixed-directional
    + * int32_t count, i, length;
    + * UBiDiLevel level;
    + *
    + * count=ubidi_countRuns(para, pErrorCode);
    + * if(U_SUCCESS(*pErrorCode)) {
    + * if(styleRunCount<=1) {
    + * Style style=styleRuns[0].style;
    + *
    + * // iterate over directional runs
    + * for(i=0; i<count; ++i) {
    + * direction=ubidi_getVisualRun(para, i, &start, &length);
    + * renderRun(text, start, start+length, direction, style);
    + * }
    + * } else {
    + * int32_t j;
    + *
    + * // iterate over both directional and style runs
    + * for(i=0; i<count; ++i) {
    + * direction=ubidi_getVisualRun(line, i, &start, &length);
    + * renderDirectionalRun(text, start, start+length,
    + * direction, styleRuns, styleRunCount);
    + * }
    + * }
    + * }
    + * }
    + * }
    + *
    + *void renderParagraph(const UChar *text, int32_t length,
    + * UBiDiDirection textDirection,
    + * const StyleRun *styleRuns, int styleRunCount,
    + * int lineWidth,
    + * UErrorCode *pErrorCode) {
    + * UBiDi *para;
    + *
    + * if(pErrorCode==NULL || U_FAILURE(*pErrorCode) || length<=0) {
    + * return;
    + * }
    + *
    + * para=ubidi_openSized(length, 0, pErrorCode);
    + * if(para==NULL) { return; }
    + *
    + * ubidi_setPara(para, text, length,
    + * textDirection ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR,
    + * NULL, pErrorCode);
    + * if(U_SUCCESS(*pErrorCode)) {
    + * UBiDiLevel paraLevel=1&ubidi_getParaLevel(para);
    + * StyleRun styleRun={ length, styleNormal };
    + * int width;
    + *
    + * if(styleRuns==NULL || styleRunCount<=0) {
    + * styleRunCount=1;
    + * styleRuns=&styleRun;
    + * }
    + *
    + * // assume styleRuns[styleRunCount-1].limit>=length
    + *
    + * width=getTextWidth(text, 0, length, styleRuns, styleRunCount);
    + * if(width<=lineWidth) {
    + * // everything fits onto one line
    + *
    + * // prepare rendering a new line from either left or right
    + * startLine(paraLevel, width);
    + *
    + * renderLine(para, text, 0, length,
    + * styleRuns, styleRunCount);
    + * } else {
    + * UBiDi *line;
    + *
    + * // we need to render several lines
    + * line=ubidi_openSized(length, 0, pErrorCode);
    + * if(line!=NULL) {
    + * int32_t start=0, limit;
    + * int styleRunStart=0, styleRunLimit;
    + *
    + * for(;;) {
    + * limit=length;
    + * styleRunLimit=styleRunCount;
    + * getLineBreak(text, start, &limit, para,
    + * styleRuns, styleRunStart, &styleRunLimit,
    + * &width);
    + * ubidi_setLine(para, start, limit, line, pErrorCode);
    + * if(U_SUCCESS(*pErrorCode)) {
    + * // prepare rendering a new line
    + * // from either left or right
    + * startLine(paraLevel, width);
    + *
    + * renderLine(line, text, start, limit,
    + * styleRuns+styleRunStart,
    + * styleRunLimit-styleRunStart);
    + * }
    + * if(limit==length) { break; }
    + * start=limit;
    + * styleRunStart=styleRunLimit-1;
    + * if(start>=styleRuns[styleRunStart].limit) {
    + * ++styleRunStart;
    + * }
    + * }
    + *
    + * ubidi_close(line);
    + * }
    + * }
    + * }
    + *
    + * ubidi_close(para);
    + *}
    + *\endcode
    + * </pre>
    + */
    +
    +/*DOCXX_TAG*/
    +/*@{*/
    +
    +/**
    + * UBiDiLevel is the type of the level values in this
    + * Bidi implementation.
    + * It holds an embedding level and indicates the visual direction
    + * by its bit&nbsp;0 (even/odd value).<p>
    + *
    + * It can also hold non-level values for the
    + * <code>paraLevel</code> and <code>embeddingLevels</code>
    + * arguments of <code>ubidi_setPara()</code>; there:
    + * <ul>
    + * <li>bit&nbsp;7 of an <code>embeddingLevels[]</code>
    + * value indicates whether the using application is
    + * specifying the level of a character to <i>override</i> whatever the
    + * Bidi implementation would resolve it to.</li>
    + * <li><code>paraLevel</code> can be set to the
    + * pseudo-level values <code>UBIDI_DEFAULT_LTR</code>
    + * and <code>UBIDI_DEFAULT_RTL</code>.</li>
    + * </ul>
    + *
    + * @see ubidi_setPara
    + *
    + * <p>The related constants are not real, valid level values.
    + * <code>UBIDI_DEFAULT_XXX</code> can be used to specify
    + * a default for the paragraph level for
    + * when the <code>ubidi_setPara()</code> function
    + * shall determine it but there is no
    + * strongly typed character in the input.<p>
    + *
    + * Note that the value for <code>UBIDI_DEFAULT_LTR</code> is even
    + * and the one for <code>UBIDI_DEFAULT_RTL</code> is odd,
    + * just like with normal LTR and RTL level values -
    + * these special values are designed that way. Also, the implementation
    + * assumes that UBIDI_MAX_EXPLICIT_LEVEL is odd.
    + *
    + * @see UBIDI_DEFAULT_LTR
    + * @see UBIDI_DEFAULT_RTL
    + * @see UBIDI_LEVEL_OVERRIDE
    + * @see UBIDI_MAX_EXPLICIT_LEVEL
    + * @stable ICU 2.0
    + */
    +typedef uint8_t UBiDiLevel;
    +
    +/** Paragraph level setting.<p>
    + *
    + * Constant indicating that the base direction depends on the first strong
    + * directional character in the text according to the Unicode Bidirectional
    + * Algorithm. If no strong directional character is present,
    + * then set the paragraph level to 0 (left-to-right).<p>
    + *
    + * If this value is used in conjunction with reordering modes
    + * <code>UBIDI_REORDER_INVERSE_LIKE_DIRECT</code> or
    + * <code>UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the text to reorder
    + * is assumed to be visual LTR, and the text after reordering is required
    + * to be the corresponding logical string with appropriate contextual
    + * direction. The direction of the result string will be RTL if either
    + * the righmost or leftmost strong character of the source text is RTL
    + * or Arabic Letter, the direction will be LTR otherwise.<p>
    + *
    + * If reordering option <code>UBIDI_OPTION_INSERT_MARKS</code> is set, an RLM may
    + * be added at the beginning of the result string to ensure round trip
    + * (that the result string, when reordered back to visual, will produce
    + * the original source text).
    + * @see UBIDI_REORDER_INVERSE_LIKE_DIRECT
    + * @see UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL
    + * @stable ICU 2.0
    + */
    +#define UBIDI_DEFAULT_LTR 0xfe
    +
    +/** Paragraph level setting.<p>
    + *
    + * Constant indicating that the base direction depends on the first strong
    + * directional character in the text according to the Unicode Bidirectional
    + * Algorithm. If no strong directional character is present,
    + * then set the paragraph level to 1 (right-to-left).<p>
    + *
    + * If this value is used in conjunction with reordering modes
    + * <code>UBIDI_REORDER_INVERSE_LIKE_DIRECT</code> or
    + * <code>UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the text to reorder
    + * is assumed to be visual LTR, and the text after reordering is required
    + * to be the corresponding logical string with appropriate contextual
    + * direction. The direction of the result string will be RTL if either
    + * the righmost or leftmost strong character of the source text is RTL
    + * or Arabic Letter, or if the text contains no strong character;
    + * the direction will be LTR otherwise.<p>
    + *
    + * If reordering option <code>UBIDI_OPTION_INSERT_MARKS</code> is set, an RLM may
    + * be added at the beginning of the result string to ensure round trip
    + * (that the result string, when reordered back to visual, will produce
    + * the original source text).
    + * @see UBIDI_REORDER_INVERSE_LIKE_DIRECT
    + * @see UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL
    + * @stable ICU 2.0
    + */
    +#define UBIDI_DEFAULT_RTL 0xff
    +
    +/**
    + * Maximum explicit embedding level.
    + * (The maximum resolved level can be up to <code>UBIDI_MAX_EXPLICIT_LEVEL+1</code>).
    + * @stable ICU 2.0
    + */
    +#define UBIDI_MAX_EXPLICIT_LEVEL 61
    +
    +/** Bit flag for level input.
    + * Overrides directional properties.
    + * @stable ICU 2.0
    + */
    +#define UBIDI_LEVEL_OVERRIDE 0x80
    +
    +/**
    + * Special value which can be returned by the mapping functions when a logical
    + * index has no corresponding visual index or vice-versa. This may happen
    + * for the logical-to-visual mapping of a Bidi control when option
    + * <code>#UBIDI_OPTION_REMOVE_CONTROLS</code> is specified. This can also happen
    + * for the visual-to-logical mapping of a Bidi mark (LRM or RLM) inserted
    + * by option <code>#UBIDI_OPTION_INSERT_MARKS</code>.
    + * @see ubidi_getVisualIndex
    + * @see ubidi_getVisualMap
    + * @see ubidi_getLogicalIndex
    + * @see ubidi_getLogicalMap
    + * @stable ICU 3.6
    + */
    +#define UBIDI_MAP_NOWHERE (-1)
    +
    +/**
    + * <code>UBiDiDirection</code> values indicate the text direction.
    + * @stable ICU 2.0
    + */
    +enum UBiDiDirection {
    + /** All left-to-right text. This is a 0 value. @stable ICU 2.0 */
    + UBIDI_LTR,
    + /** All right-to-left text. This is a 1 value. @stable ICU 2.0 */
    + UBIDI_RTL,
    + /** Mixed-directional text. @stable ICU 2.0 */
    + UBIDI_MIXED
    +};
    +
    +/** @stable ICU 2.0 */
    +typedef enum UBiDiDirection UBiDiDirection;
    +
    +/**
    + * Forward declaration of the <code>UBiDi</code> structure for the declaration of
    + * the API functions. Its fields are implementation-specific.<p>
    + * This structure holds information about a paragraph (or multiple paragraphs)
    + * of text with Bidi-algorithm-related details, or about one line of
    + * such a paragraph.<p>
    + * Reordering can be done on a line, or on one or more paragraphs which are
    + * then interpreted each as one single line.
    + * @stable ICU 2.0
    + */
    +struct UBiDi;
    +
    +/** @stable ICU 2.0 */
    +typedef struct UBiDi UBiDi;
    +
    +/**
    + * Allocate a <code>UBiDi</code> structure.
    + * Such an object is initially empty. It is assigned
    + * the Bidi properties of a piece of text containing one or more paragraphs
    + * by <code>ubidi_setPara()</code>
    + * or the Bidi properties of a line within a paragraph by
    + * <code>ubidi_setLine()</code>.<p>
    + * This object can be reused for as long as it is not deallocated
    + * by calling <code>ubidi_close()</code>.<p>
    + * <code>ubidi_setPara()</code> and <code>ubidi_setLine()</code> will allocate
    + * additional memory for internal structures as necessary.
    + *
    + * @return An empty <code>UBiDi</code> object.
    + * @stable ICU 2.0
    + */
    +U_STABLE UBiDi * U_EXPORT2
    +ubidi_open(void);
    +
    +/**
    + * Allocate a <code>UBiDi</code> structure with preallocated memory
    + * for internal structures.
    + * This function provides a <code>UBiDi</code> object like <code>ubidi_open()</code>
    + * with no arguments, but it also preallocates memory for internal structures
    + * according to the sizings supplied by the caller.<p>
    + * Subsequent functions will not allocate any more memory, and are thus
    + * guaranteed not to fail because of lack of memory.<p>
    + * The preallocation can be limited to some of the internal memory
    + * by setting some values to 0 here. That means that if, e.g.,
    + * <code>maxRunCount</code> cannot be reasonably predetermined and should not
    + * be set to <code>maxLength</code> (the only failproof value) to avoid
    + * wasting memory, then <code>maxRunCount</code> could be set to 0 here
    + * and the internal structures that are associated with it will be allocated
    + * on demand, just like with <code>ubidi_open()</code>.
    + *
    + * @param maxLength is the maximum text or line length that internal memory
    + * will be preallocated for. An attempt to associate this object with a
    + * longer text will fail, unless this value is 0, which leaves the allocation
    + * up to the implementation.
    + *
    + * @param maxRunCount is the maximum anticipated number of same-level runs
    + * that internal memory will be preallocated for. An attempt to access
    + * visual runs on an object that was not preallocated for as many runs
    + * as the text was actually resolved to will fail,
    + * unless this value is 0, which leaves the allocation up to the implementation.<br><br>
    + * The number of runs depends on the actual text and maybe anywhere between
    + * 1 and <code>maxLength</code>. It is typically small.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return An empty <code>UBiDi</code> object with preallocated memory.
    + * @stable ICU 2.0
    + */
    +U_STABLE UBiDi * U_EXPORT2
    +ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode);
    +
    +/**
    + * <code>ubidi_close()</code> must be called to free the memory
    + * associated with a UBiDi object.<p>
    + *
    + * <strong>Important: </strong>
    + * A parent <code>UBiDi</code> object must not be destroyed or reused if
    + * it still has children.
    + * If a <code>UBiDi</code> object has become the <i>child</i>
    + * of another one (its <i>parent</i>) by calling
    + * <code>ubidi_setLine()</code>, then the child object must
    + * be destroyed (closed) or reused (by calling
    + * <code>ubidi_setPara()</code> or <code>ubidi_setLine()</code>)
    + * before the parent object.
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + *
    + * @see ubidi_setPara
    + * @see ubidi_setLine
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_close(UBiDi *pBiDi);
    +
    +/**
    + * Modify the operation of the Bidi algorithm such that it
    + * approximates an "inverse Bidi" algorithm. This function
    + * must be called before <code>ubidi_setPara()</code>.
    + *
    + * <p>The normal operation of the Bidi algorithm as described
    + * in the Unicode Technical Report is to take text stored in logical
    + * (keyboard, typing) order and to determine the reordering of it for visual
    + * rendering.
    + * Some legacy systems store text in visual order, and for operations
    + * with standard, Unicode-based algorithms, the text needs to be transformed
    + * to logical order. This is effectively the inverse algorithm of the
    + * described Bidi algorithm. Note that there is no standard algorithm for
    + * this "inverse Bidi" and that the current implementation provides only an
    + * approximation of "inverse Bidi".</p>
    + *
    + * <p>With <code>isInverse</code> set to <code>TRUE</code>,
    + * this function changes the behavior of some of the subsequent functions
    + * in a way that they can be used for the inverse Bidi algorithm.
    + * Specifically, runs of text with numeric characters will be treated in a
    + * special way and may need to be surrounded with LRM characters when they are
    + * written in reordered sequence.</p>
    + *
    + * <p>Output runs should be retrieved using <code>ubidi_getVisualRun()</code>.
    + * Since the actual input for "inverse Bidi" is visually ordered text and
    + * <code>ubidi_getVisualRun()</code> gets the reordered runs, these are actually
    + * the runs of the logically ordered output.</p>
    + *
    + * <p>Calling this function with argument <code>isInverse</code> set to
    + * <code>TRUE</code> is equivalent to calling
    + * <code>ubidi_setReorderingMode</code> with argument
    + * <code>reorderingMode</code>
    + * set to <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
    + * Calling this function with argument <code>isInverse</code> set to
    + * <code>FALSE</code> is equivalent to calling
    + * <code>ubidi_setReorderingMode</code> with argument
    + * <code>reorderingMode</code>
    + * set to <code>#UBIDI_REORDER_DEFAULT</code>.
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + *
    + * @param isInverse specifies "forward" or "inverse" Bidi operation.
    + *
    + * @see ubidi_setPara
    + * @see ubidi_writeReordered
    + * @see ubidi_setReorderingMode
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_setInverse(UBiDi *pBiDi, UBool isInverse);
    +
    +/**
    + * Is this Bidi object set to perform the inverse Bidi algorithm?
    + * <p>Note: calling this function after setting the reordering mode with
    + * <code>ubidi_setReorderingMode</code> will return <code>TRUE</code> if the
    + * reordering mode was set to <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>,
    + * <code>FALSE</code> for all other values.</p>
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + * @return TRUE if the Bidi object is set to perform the inverse Bidi algorithm
    + * by handling numbers as L.
    + *
    + * @see ubidi_setInverse
    + * @see ubidi_setReorderingMode
    + * @stable ICU 2.0
    + */
    +
    +U_STABLE UBool U_EXPORT2
    +ubidi_isInverse(UBiDi *pBiDi);
    +
    +/**
    + * Specify whether block separators must be allocated level zero,
    + * so that successive paragraphs will progress from left to right.
    + * This function must be called before <code>ubidi_setPara()</code>.
    + * Paragraph separators (B) may appear in the text. Setting them to level zero
    + * means that all paragraph separators (including one possibly appearing
    + * in the last text position) are kept in the reordered text after the text
    + * that they follow in the source text.
    + * When this feature is not enabled, a paragraph separator at the last
    + * position of the text before reordering will go to the first position
    + * of the reordered text when the paragraph level is odd.
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + *
    + * @param orderParagraphsLTR specifies whether paragraph separators (B) must
    + * receive level 0, so that successive paragraphs progress from left to right.
    + *
    + * @see ubidi_setPara
    + * @stable ICU 3.4
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_orderParagraphsLTR(UBiDi *pBiDi, UBool orderParagraphsLTR);
    +
    +/**
    + * Is this Bidi object set to allocate level 0 to block separators so that
    + * successive paragraphs progress from left to right?
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + * @return TRUE if the Bidi object is set to allocate level 0 to block
    + * separators.
    + *
    + * @see ubidi_orderParagraphsLTR
    + * @stable ICU 3.4
    + */
    +U_STABLE UBool U_EXPORT2
    +ubidi_isOrderParagraphsLTR(UBiDi *pBiDi);
    +
    +/**
    + * <code>UBiDiReorderingMode</code> values indicate which variant of the Bidi
    + * algorithm to use.
    + *
    + * @see ubidi_setReorderingMode
    + * @stable ICU 3.6
    + */
    +typedef enum UBiDiReorderingMode {
    + /** Regular Logical to Visual Bidi algorithm according to Unicode.
    + * This is a 0 value.
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_DEFAULT = 0,
    + /** Logical to Visual algorithm which handles numbers in a way which
    + * mimicks the behavior of Windows XP.
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_NUMBERS_SPECIAL,
    + /** Logical to Visual algorithm grouping numbers with adjacent R characters
    + * (reversible algorithm).
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_GROUP_NUMBERS_WITH_R,
    + /** Reorder runs only to transform a Logical LTR string to the Logical RTL
    + * string with the same display, or vice-versa.<br>
    + * If this mode is set together with option
    + * <code>#UBIDI_OPTION_INSERT_MARKS</code>, some Bidi controls in the source
    + * text may be removed and other controls may be added to produce the
    + * minimum combination which has the required display.
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_RUNS_ONLY,
    + /** Visual to Logical algorithm which handles numbers like L
    + * (same algorithm as selected by <code>ubidi_setInverse(TRUE)</code>.
    + * @see ubidi_setInverse
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_INVERSE_NUMBERS_AS_L,
    + /** Visual to Logical algorithm equivalent to the regular Logical to Visual
    + * algorithm.
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_INVERSE_LIKE_DIRECT,
    + /** Inverse Bidi (Visual to Logical) algorithm for the
    + * <code>UBIDI_REORDER_NUMBERS_SPECIAL</code> Bidi algorithm.
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL,
    + /** Number of values for reordering mode.
    + * @stable ICU 3.6 */
    + UBIDI_REORDER_COUNT
    +} UBiDiReorderingMode;
    +
    +/**
    + * Modify the operation of the Bidi algorithm such that it implements some
    + * variant to the basic Bidi algorithm or approximates an "inverse Bidi"
    + * algorithm, depending on different values of the "reordering mode".
    + * This function must be called before <code>ubidi_setPara()</code>, and stays
    + * in effect until called again with a different argument.
    + *
    + * <p>The normal operation of the Bidi algorithm as described
    + * in the Unicode Standard Annex #9 is to take text stored in logical
    + * (keyboard, typing) order and to determine how to reorder it for visual
    + * rendering.</p>
    + *
    + * <p>With the reordering mode set to a value other than
    + * <code>#UBIDI_REORDER_DEFAULT</code>, this function changes the behavior of
    + * some of the subsequent functions in a way such that they implement an
    + * inverse Bidi algorithm or some other algorithm variants.</p>
    + *
    + * <p>Some legacy systems store text in visual order, and for operations
    + * with standard, Unicode-based algorithms, the text needs to be transformed
    + * into logical order. This is effectively the inverse algorithm of the
    + * described Bidi algorithm. Note that there is no standard algorithm for
    + * this "inverse Bidi", so a number of variants are implemented here.</p>
    + *
    + * <p>In other cases, it may be desirable to emulate some variant of the
    + * Logical to Visual algorithm (e.g. one used in MS Windows), or perform a
    + * Logical to Logical transformation.</p>
    + *
    + * <ul>
    + * <li>When the reordering mode is set to <code>#UBIDI_REORDER_DEFAULT</code>,
    + * the standard Bidi Logical to Visual algorithm is applied.</li>
    + *
    + * <li>When the reordering mode is set to
    + * <code>#UBIDI_REORDER_NUMBERS_SPECIAL</code>,
    + * the algorithm used to perform Bidi transformations when calling
    + * <code>ubidi_setPara</code> should approximate the algorithm used in
    + * Microsoft Windows XP rather than strictly conform to the Unicode Bidi
    + * algorithm.
    + * <br>
    + * The differences between the basic algorithm and the algorithm addressed
    + * by this option are as follows:
    + * <ul>
    + * <li>Within text at an even embedding level, the sequence "123AB"
    + * (where AB represent R or AL letters) is transformed to "123BA" by the
    + * Unicode algorithm and to "BA123" by the Windows algorithm.</li>
    + * <li>Arabic-Indic numbers (AN) are handled by the Windows algorithm just
    + * like regular numbers (EN).</li>
    + * </ul></li>
    + *
    + * <li>When the reordering mode is set to
    + * <code>#UBIDI_REORDER_GROUP_NUMBERS_WITH_R</code>,
    + * numbers located between LTR text and RTL text are associated with the RTL
    + * text. For instance, an LTR paragraph with content "abc 123 DEF" (where
    + * upper case letters represent RTL characters) will be transformed to
    + * "abc FED 123" (and not "abc 123 FED"), "DEF 123 abc" will be transformed
    + * to "123 FED abc" and "123 FED abc" will be transformed to "DEF 123 abc".
    + * This makes the algorithm reversible and makes it useful when round trip
    + * (from visual to logical and back to visual) must be achieved without
    + * adding LRM characters. However, this is a variation from the standard
    + * Unicode Bidi algorithm.<br>
    + * The source text should not contain Bidi control characters other than LRM
    + * or RLM.</li>
    + *
    + * <li>When the reordering mode is set to
    + * <code>#UBIDI_REORDER_RUNS_ONLY</code>,
    + * a "Logical to Logical" transformation must be performed:
    + * <ul>
    + * <li>If the default text level of the source text (argument <code>paraLevel</code>
    + * in <code>ubidi_setPara</code>) is even, the source text will be handled as
    + * LTR logical text and will be transformed to the RTL logical text which has
    + * the same LTR visual display.</li>
    + * <li>If the default level of the source text is odd, the source text
    + * will be handled as RTL logical text and will be transformed to the
    + * LTR logical text which has the same LTR visual display.</li>
    + * </ul>
    + * This mode may be needed when logical text which is basically Arabic or
    + * Hebrew, with possible included numbers or phrases in English, has to be
    + * displayed as if it had an even embedding level (this can happen if the
    + * displaying application treats all text as if it was basically LTR).
    + * <br>
    + * This mode may also be needed in the reverse case, when logical text which is
    + * basically English, with possible included phrases in Arabic or Hebrew, has to
    + * be displayed as if it had an odd embedding level.
    + * <br>
    + * Both cases could be handled by adding LRE or RLE at the head of the text,
    + * if the display subsystem supports these formatting controls. If it does not,
    + * the problem may be handled by transforming the source text in this mode
    + * before displaying it, so that it will be displayed properly.<br>
    + * The source text should not contain Bidi control characters other than LRM
    + * or RLM.</li>
    + *
    + * <li>When the reordering mode is set to
    + * <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>, an "inverse Bidi" algorithm
    + * is applied.
    + * Runs of text with numeric characters will be treated like LTR letters and
    + * may need to be surrounded with LRM characters when they are written in
    + * reordered sequence (the option <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code> can
    + * be used with function <code>ubidi_writeReordered</code> to this end. This
    + * mode is equivalent to calling <code>ubidi_setInverse()</code> with
    + * argument <code>isInverse</code> set to <code>TRUE</code>.</li>
    + *
    + * <li>When the reordering mode is set to
    + * <code>#UBIDI_REORDER_INVERSE_LIKE_DIRECT</code>, the "direct" Logical to Visual
    + * Bidi algorithm is used as an approximation of an "inverse Bidi" algorithm.
    + * This mode is similar to mode <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>
    + * but is closer to the regular Bidi algorithm.
    + * <br>
    + * For example, an LTR paragraph with the content "FED 123 456 CBA" (where
    + * upper case represents RTL characters) will be transformed to
    + * "ABC 456 123 DEF", as opposed to "DEF 123 456 ABC"
    + * with mode <code>UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
    + * When used in conjunction with option
    + * <code>#UBIDI_OPTION_INSERT_MARKS</code>, this mode generally
    + * adds Bidi marks to the output significantly more sparingly than mode
    + * <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code> with option
    + * <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code> in calls to
    + * <code>ubidi_writeReordered</code>.</li>
    + *
    + * <li>When the reordering mode is set to
    + * <code>#UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the Logical to Visual
    + * Bidi algorithm used in Windows XP is used as an approximation of an
    + * "inverse Bidi" algorithm.
    + * <br>
    + * For example, an LTR paragraph with the content "abc FED123" (where
    + * upper case represents RTL characters) will be transformed to
    + * "abc 123DEF.</li>
    + * </ul>
    + *
    + * <p>In all the reordering modes specifying an "inverse Bidi" algorithm
    + * (i.e. those with a name starting with <code>UBIDI_REORDER_INVERSE</code>),
    + * output runs should be retrieved using
    + * <code>ubidi_getVisualRun()</code>, and the output text with
    + * <code>ubidi_writeReordered()</code>. The caller should keep in mind that in
    + * "inverse Bidi" modes the input is actually visually ordered text and
    + * reordered output returned by <code>ubidi_getVisualRun()</code> or
    + * <code>ubidi_writeReordered()</code> are actually runs or character string
    + * of logically ordered output.<br>
    + * For all the "inverse Bidi" modes, the source text should not contain
    + * Bidi control characters other than LRM or RLM.</p>
    + *
    + * <p>Note that option <code>#UBIDI_OUTPUT_REVERSE</code> of
    + * <code>ubidi_writeReordered</code> has no useful meaning and should not be
    + * used in conjunction with any value of the reordering mode specifying
    + * "inverse Bidi" or with value <code>UBIDI_REORDER_RUNS_ONLY</code>.
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + * @param reorderingMode specifies the required variant of the Bidi algorithm.
    + *
    + * @see UBiDiReorderingMode
    + * @see ubidi_setInverse
    + * @see ubidi_setPara
    + * @see ubidi_writeReordered
    + * @stable ICU 3.6
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_setReorderingMode(UBiDi *pBiDi, UBiDiReorderingMode reorderingMode);
    +
    +/**
    + * What is the requested reordering mode for a given Bidi object?
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + * @return the current reordering mode of the Bidi object
    + * @see ubidi_setReorderingMode
    + * @stable ICU 3.6
    + */
    +U_STABLE UBiDiReorderingMode U_EXPORT2
    +ubidi_getReorderingMode(UBiDi *pBiDi);
    +
    +/**
    + * <code>UBiDiReorderingOption</code> values indicate which options are
    + * specified to affect the Bidi algorithm.
    + *
    + * @see ubidi_setReorderingOptions
    + * @stable ICU 3.6
    + */
    +typedef enum UBiDiReorderingOption {
    + /**
    + * option value for <code>ubidi_setReorderingOptions</code>:
    + * disable all the options which can be set with this function
    + * @see ubidi_setReorderingOptions
    + * @stable ICU 3.6
    + */
    + UBIDI_OPTION_DEFAULT = 0,
    +
    + /**
    + * option bit for <code>ubidi_setReorderingOptions</code>:
    + * insert Bidi marks (LRM or RLM) when needed to ensure correct result of
    + * a reordering to a Logical order
    + *
    + * <p>This option must be set or reset before calling
    + * <code>ubidi_setPara</code>.</p>
    + *
    + * <p>This option is significant only with reordering modes which generate
    + * a result with Logical order, specifically:</p>
    + * <ul>
    + * <li><code>#UBIDI_REORDER_RUNS_ONLY</code></li>
    + * <li><code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code></li>
    + * <li><code>#UBIDI_REORDER_INVERSE_LIKE_DIRECT</code></li>
    + * <li><code>#UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code></li>
    + * </ul>
    + *
    + * <p>If this option is set in conjunction with reordering mode
    + * <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code> or with calling
    + * <code>ubidi_setInverse(TRUE)</code>, it implies
    + * option <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code>
    + * in calls to function <code>ubidi_writeReordered()</code>.</p>
    + *
    + * <p>For other reordering modes, a minimum number of LRM or RLM characters
    + * will be added to the source text after reordering it so as to ensure
    + * round trip, i.e. when applying the inverse reordering mode on the
    + * resulting logical text with removal of Bidi marks
    + * (option <code>#UBIDI_OPTION_REMOVE_CONTROLS</code> set before calling
    + * <code>ubidi_setPara()</code> or option <code>#UBIDI_REMOVE_BIDI_CONTROLS</code>
    + * in <code>ubidi_writeReordered</code>), the result will be identical to the
    + * source text in the first transformation.
    + *
    + * <p>This option will be ignored if specified together with option
    + * <code>#UBIDI_OPTION_REMOVE_CONTROLS</code>. It inhibits option
    + * <code>UBIDI_REMOVE_BIDI_CONTROLS</code> in calls to function
    + * <code>ubidi_writeReordered()</code> and it implies option
    + * <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code> in calls to function
    + * <code>ubidi_writeReordered()</code> if the reordering mode is
    + * <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>.</p>
    + *
    + * @see ubidi_setReorderingMode
    + * @see ubidi_setReorderingOptions
    + * @stable ICU 3.6
    + */
    + UBIDI_OPTION_INSERT_MARKS = 1,
    +
    + /**
    + * option bit for <code>ubidi_setReorderingOptions</code>:
    + * remove Bidi control characters
    + *
    + * <p>This option must be set or reset before calling
    + * <code>ubidi_setPara</code>.</p>
    + *
    + * <p>This option nullifies option <code>#UBIDI_OPTION_INSERT_MARKS</code>.
    + * It inhibits option <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code> in calls
    + * to function <code>ubidi_writeReordered()</code> and it implies option
    + * <code>#UBIDI_REMOVE_BIDI_CONTROLS</code> in calls to that function.</p>
    + *
    + * @see ubidi_setReorderingMode
    + * @see ubidi_setReorderingOptions
    + * @stable ICU 3.6
    + */
    + UBIDI_OPTION_REMOVE_CONTROLS = 2,
    +
    + /**
    + * option bit for <code>ubidi_setReorderingOptions</code>:
    + * process the output as part of a stream to be continued
    + *
    + * <p>This option must be set or reset before calling
    + * <code>ubidi_setPara</code>.</p>
    + *
    + * <p>This option specifies that the caller is interested in processing large
    + * text object in parts.
    + * The results of the successive calls are expected to be concatenated by the
    + * caller. Only the call for the last part will have this option bit off.</p>
    + *
    + * <p>When this option bit is on, <code>ubidi_setPara()</code> may process
    + * less than the full source text in order to truncate the text at a meaningful
    + * boundary. The caller should call <code>ubidi_getProcessedLength()</code>
    + * immediately after calling <code>ubidi_setPara()</code> in order to
    + * determine how much of the source text has been processed.
    + * Source text beyond that length should be resubmitted in following calls to
    + * <code>ubidi_setPara</code>. The processed length may be less than
    + * the length of the source text if a character preceding the last character of
    + * the source text constitutes a reasonable boundary (like a block separator)
    + * for text to be continued.<br>
    + * If the last character of the source text constitutes a reasonable
    + * boundary, the whole text will be processed at once.<br>
    + * If nowhere in the source text there exists
    + * such a reasonable boundary, the processed length will be zero.<br>
    + * The caller should check for such an occurrence and do one of the following:
    + * <ul><li>submit a larger amount of text with a better chance to include
    + * a reasonable boundary.</li>
    + * <li>resubmit the same text after turning off option
    + * <code>UBIDI_OPTION_STREAMING</code>.</li></ul>
    + * In all cases, this option should be turned off before processing the last
    + * part of the text.</p>
    + *
    + * <p>When the <code>UBIDI_OPTION_STREAMING</code> option is used,
    + * it is recommended to call <code>ubidi_orderParagraphsLTR()</code> with
    + * argument <code>orderParagraphsLTR</code> set to <code>TRUE</code> before
    + * calling <code>ubidi_setPara</code> so that later paragraphs may be
    + * concatenated to previous paragraphs on the right.</p>
    + *
    + * @see ubidi_setReorderingMode
    + * @see ubidi_setReorderingOptions
    + * @see ubidi_getProcessedLength
    + * @see ubidi_orderParagraphsLTR
    + * @stable ICU 3.6
    + */
    + UBIDI_OPTION_STREAMING = 4
    +} UBiDiReorderingOption;
    +
    +/**
    + * Specify which of the reordering options
    + * should be applied during Bidi transformations.
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + * @param reorderingOptions is a combination of zero or more of the following
    + * options:
    + * <code>#UBIDI_OPTION_DEFAULT</code>, <code>#UBIDI_OPTION_INSERT_MARKS</code>,
    + * <code>#UBIDI_OPTION_REMOVE_CONTROLS</code>, <code>#UBIDI_OPTION_STREAMING</code>.
    + *
    + * @see ubidi_getReorderingOptions
    + * @stable ICU 3.6
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_setReorderingOptions(UBiDi *pBiDi, uint32_t reorderingOptions);
    +
    +/**
    + * What are the reordering options applied to a given Bidi object?
    + *
    + * @param pBiDi is a <code>UBiDi</code> object.
    + * @return the current reordering options of the Bidi object
    + * @see ubidi_setReorderingOptions
    + * @stable ICU 3.6
    + */
    +U_STABLE uint32_t U_EXPORT2
    +ubidi_getReorderingOptions(UBiDi *pBiDi);
    +
    +/**
    + * Perform the Unicode Bidi algorithm. It is defined in the
    + * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Anned #9</a>,
    + * version 13,
    + * also described in The Unicode Standard, Version 4.0 .<p>
    + *
    + * This function takes a piece of plain text containing one or more paragraphs,
    + * with or without externally specified embedding levels from <i>styled</i>
    + * text and computes the left-right-directionality of each character.<p>
    + *
    + * If the entire text is all of the same directionality, then
    + * the function may not perform all the steps described by the algorithm,
    + * i.e., some levels may not be the same as if all steps were performed.
    + * This is not relevant for unidirectional text.<br>
    + * For example, in pure LTR text with numbers the numbers would get
    + * a resolved level of 2 higher than the surrounding text according to
    + * the algorithm. This implementation may set all resolved levels to
    + * the same value in such a case.<p>
    + *
    + * The text can be composed of multiple paragraphs. Occurrence of a block
    + * separator in the text terminates a paragraph, and whatever comes next starts
    + * a new paragraph. The exception to this rule is when a Carriage Return (CR)
    + * is followed by a Line Feed (LF). Both CR and LF are block separators, but
    + * in that case, the pair of characters is considered as terminating the
    + * preceding paragraph, and a new paragraph will be started by a character
    + * coming after the LF.
    + *
    + * @param pBiDi A <code>UBiDi</code> object allocated with <code>ubidi_open()</code>
    + * which will be set to contain the reordering information,
    + * especially the resolved levels for all the characters in <code>text</code>.
    + *
    + * @param text is a pointer to the text that the Bidi algorithm will be performed on.
    + * This pointer is stored in the UBiDi object and can be retrieved
    + * with <code>ubidi_getText()</code>.<br>
    + * <strong>Note:</strong> the text must be (at least) <code>length</code> long.
    + *
    + * @param length is the length of the text; if <code>length==-1</code> then
    + * the text must be zero-terminated.
    + *
    + * @param paraLevel specifies the default level for the text;
    + * it is typically 0 (LTR) or 1 (RTL).
    + * If the function shall determine the paragraph level from the text,
    + * then <code>paraLevel</code> can be set to
    + * either <code>#UBIDI_DEFAULT_LTR</code>
    + * or <code>#UBIDI_DEFAULT_RTL</code>; if the text contains multiple
    + * paragraphs, the paragraph level shall be determined separately for
    + * each paragraph; if a paragraph does not include any strongly typed
    + * character, then the desired default is used (0 for LTR or 1 for RTL).
    + * Any other value between 0 and <code>#UBIDI_MAX_EXPLICIT_LEVEL</code>
    + * is also valid, with odd levels indicating RTL.
    + *
    + * @param embeddingLevels (in) may be used to preset the embedding and override levels,
    + * ignoring characters like LRE and PDF in the text.
    + * A level overrides the directional property of its corresponding
    + * (same index) character if the level has the
    + * <code>#UBIDI_LEVEL_OVERRIDE</code> bit set.<br><br>
    + * Except for that bit, it must be
    + * <code>paraLevel<=embeddingLevels[]<=UBIDI_MAX_EXPLICIT_LEVEL</code>,
    + * with one exception: a level of zero may be specified for a paragraph
    + * separator even if <code>paraLevel>0</code> when multiple paragraphs
    + * are submitted in the same call to <code>ubidi_setPara()</code>.<br><br>
    + * <strong>Caution: </strong>A copy of this pointer, not of the levels,
    + * will be stored in the <code>UBiDi</code> object;
    + * the <code>embeddingLevels</code> array must not be
    + * deallocated before the <code>UBiDi</code> structure is destroyed or reused,
    + * and the <code>embeddingLevels</code>
    + * should not be modified to avoid unexpected results on subsequent Bidi operations.
    + * However, the <code>ubidi_setPara()</code> and
    + * <code>ubidi_setLine()</code> functions may modify some or all of the levels.<br><br>
    + * After the <code>UBiDi</code> object is reused or destroyed, the caller
    + * must take care of the deallocation of the <code>embeddingLevels</code> array.<br><br>
    + * <strong>Note:</strong> the <code>embeddingLevels</code> array must be
    + * at least <code>length</code> long.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
    + UBiDiLevel paraLevel, UBiDiLevel *embeddingLevels,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * <code>ubidi_setLine()</code> sets a <code>UBiDi</code> to
    + * contain the reordering information, especially the resolved levels,
    + * for all the characters in a line of text. This line of text is
    + * specified by referring to a <code>UBiDi</code> object representing
    + * this information for a piece of text containing one or more paragraphs,
    + * and by specifying a range of indexes in this text.<p>
    + * In the new line object, the indexes will range from 0 to <code>limit-start-1</code>.<p>
    + *
    + * This is used after calling <code>ubidi_setPara()</code>
    + * for a piece of text, and after line-breaking on that text.
    + * It is not necessary if each paragraph is treated as a single line.<p>
    + *
    + * After line-breaking, rules (L1) and (L2) for the treatment of
    + * trailing WS and for reordering are performed on
    + * a <code>UBiDi</code> object that represents a line.<p>
    + *
    + * <strong>Important: </strong><code>pLineBiDi</code> shares data with
    + * <code>pParaBiDi</code>.
    + * You must destroy or reuse <code>pLineBiDi</code> before <code>pParaBiDi</code>.
    + * In other words, you must destroy or reuse the <code>UBiDi</code> object for a line
    + * before the object for its parent paragraph.<p>
    + *
    + * The text pointer that was stored in <code>pParaBiDi</code> is also copied,
    + * and <code>start</code> is added to it so that it points to the beginning of the
    + * line for this object.
    + *
    + * @param pParaBiDi is the parent paragraph object. It must have been set
    + * by a successful call to ubidi_setPara.
    + *
    + * @param start is the line's first index into the text.
    + *
    + * @param limit is just behind the line's last index into the text
    + * (its last index +1).<br>
    + * It must be <code>0<=start<limit<=</code>containing paragraph limit.
    + * If the specified line crosses a paragraph boundary, the function
    + * will terminate with error code U_ILLEGAL_ARGUMENT_ERROR.
    + *
    + * @param pLineBiDi is the object that will now represent a line of the text.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @see ubidi_setPara
    + * @see ubidi_getProcessedLength
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_setLine(const UBiDi *pParaBiDi,
    + int32_t start, int32_t limit,
    + UBiDi *pLineBiDi,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Get the directionality of the text.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @return a value of <code>UBIDI_LTR</code>, <code>UBIDI_RTL</code>
    + * or <code>UBIDI_MIXED</code>
    + * that indicates if the entire text
    + * represented by this object is unidirectional,
    + * and which direction, or if it is mixed-directional.
    + *
    + * @see UBiDiDirection
    + * @stable ICU 2.0
    + */
    +U_STABLE UBiDiDirection U_EXPORT2
    +ubidi_getDirection(const UBiDi *pBiDi);
    +
    +/**
    + * Get the pointer to the text.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @return The pointer to the text that the UBiDi object was created for.
    + *
    + * @see ubidi_setPara
    + * @see ubidi_setLine
    + * @stable ICU 2.0
    + */
    +U_STABLE const UChar * U_EXPORT2
    +ubidi_getText(const UBiDi *pBiDi);
    +
    +/**
    + * Get the length of the text.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @return The length of the text that the UBiDi object was created for.
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_getLength(const UBiDi *pBiDi);
    +
    +/**
    + * Get the paragraph level of the text.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @return The paragraph level. If there are multiple paragraphs, their
    + * level may vary if the required paraLevel is UBIDI_DEFAULT_LTR or
    + * UBIDI_DEFAULT_RTL. In that case, the level of the first paragraph
    + * is returned.
    + *
    + * @see UBiDiLevel
    + * @see ubidi_getParagraph
    + * @see ubidi_getParagraphByIndex
    + * @stable ICU 2.0
    + */
    +U_STABLE UBiDiLevel U_EXPORT2
    +ubidi_getParaLevel(const UBiDi *pBiDi);
    +
    +/**
    + * Get the number of paragraphs.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @return The number of paragraphs.
    + * @stable ICU 3.4
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_countParagraphs(UBiDi *pBiDi);
    +
    +/**
    + * Get a paragraph, given a position within the text.
    + * This function returns information about a paragraph.<br>
    + * Note: if the paragraph index is known, it is more efficient to
    + * retrieve the paragraph information using ubidi_getParagraphByIndex().<p>
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param charIndex is the index of a character within the text, in the
    + * range <code>[0..ubidi_getProcessedLength(pBiDi)-1]</code>.
    + *
    + * @param pParaStart will receive the index of the first character of the
    + * paragraph in the text.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pParaLimit will receive the limit of the paragraph.
    + * The l-value that you point to here may be the
    + * same expression (variable) as the one for
    + * <code>charIndex</code>.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pParaLevel will receive the level of the paragraph.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The index of the paragraph containing the specified position.
    + *
    + * @see ubidi_getProcessedLength
    + * @stable ICU 3.4
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_getParagraph(const UBiDi *pBiDi, int32_t charIndex, int32_t *pParaStart,
    + int32_t *pParaLimit, UBiDiLevel *pParaLevel,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Get a paragraph, given the index of this paragraph.
    + *
    + * This function returns information about a paragraph.<p>
    + *
    + * @param pBiDi is the paragraph <code>UBiDi</code> object.
    + *
    + * @param paraIndex is the number of the paragraph, in the
    + * range <code>[0..ubidi_countParagraphs(pBiDi)-1]</code>.
    + *
    + * @param pParaStart will receive the index of the first character of the
    + * paragraph in the text.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pParaLimit will receive the limit of the paragraph.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pParaLevel will receive the level of the paragraph.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @stable ICU 3.4
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_getParagraphByIndex(const UBiDi *pBiDi, int32_t paraIndex,
    + int32_t *pParaStart, int32_t *pParaLimit,
    + UBiDiLevel *pParaLevel, UErrorCode *pErrorCode);
    +
    +/**
    + * Get the level for one character.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param charIndex the index of a character. It must be in the range
    + * [0..ubidi_getProcessedLength(pBiDi)].
    + *
    + * @return The level for the character at charIndex (0 if charIndex is not
    + * in the valid range).
    + *
    + * @see UBiDiLevel
    + * @see ubidi_getProcessedLength
    + * @stable ICU 2.0
    + */
    +U_STABLE UBiDiLevel U_EXPORT2
    +ubidi_getLevelAt(const UBiDi *pBiDi, int32_t charIndex);
    +
    +/**
    + * Get an array of levels for each character.<p>
    + *
    + * Note that this function may allocate memory under some
    + * circumstances, unlike <code>ubidi_getLevelAt()</code>.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object, whose
    + * text length must be strictly positive.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The levels array for the text,
    + * or <code>NULL</code> if an error occurs.
    + *
    + * @see UBiDiLevel
    + * @see ubidi_getProcessedLength
    + * @stable ICU 2.0
    + */
    +U_STABLE const UBiDiLevel * U_EXPORT2
    +ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode);
    +
    +/**
    + * Get a logical run.
    + * This function returns information about a run and is used
    + * to retrieve runs in logical order.<p>
    + * This is especially useful for line-breaking on a paragraph.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param logicalPosition is a logical position within the source text.
    + *
    + * @param pLogicalLimit will receive the limit of the corresponding run.
    + * The l-value that you point to here may be the
    + * same expression (variable) as the one for
    + * <code>logicalPosition</code>.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @param pLevel will receive the level of the corresponding run.
    + * This pointer can be <code>NULL</code> if this
    + * value is not necessary.
    + *
    + * @see ubidi_getProcessedLength
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_getLogicalRun(const UBiDi *pBiDi, int32_t logicalPosition,
    + int32_t *pLogicalLimit, UBiDiLevel *pLevel);
    +
    +/**
    + * Get the number of runs.
    + * This function may invoke the actual reordering on the
    + * <code>UBiDi</code> object, after <code>ubidi_setPara()</code>
    + * may have resolved only the levels of the text. Therefore,
    + * <code>ubidi_countRuns()</code> may have to allocate memory,
    + * and may fail doing so.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The number of runs.
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode);
    +
    +/**
    + * Get one run's logical start, length, and directionality,
    + * which can be 0 for LTR or 1 for RTL.
    + * In an RTL run, the character at the logical start is
    + * visually on the right of the displayed run.
    + * The length is the number of characters in the run.<p>
    + * <code>ubidi_countRuns()</code> should be called
    + * before the runs are retrieved.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param runIndex is the number of the run in visual order, in the
    + * range <code>[0..ubidi_countRuns(pBiDi)-1]</code>.
    + *
    + * @param pLogicalStart is the first logical character index in the text.
    + * The pointer may be <code>NULL</code> if this index is not needed.
    + *
    + * @param pLength is the number of characters (at least one) in the run.
    + * The pointer may be <code>NULL</code> if this is not needed.
    + *
    + * @return the directionality of the run,
    + * <code>UBIDI_LTR==0</code> or <code>UBIDI_RTL==1</code>,
    + * never <code>UBIDI_MIXED</code>.
    + *
    + * @see ubidi_countRuns
    + *
    + * Example:
    + * <pre>
    + * \code
    + * int32_t i, count=ubidi_countRuns(pBiDi),
    + * logicalStart, visualIndex=0, length;
    + * for(i=0; i<count; ++i) {
    + * if(UBIDI_LTR==ubidi_getVisualRun(pBiDi, i, &logicalStart, &length)) {
    + * do { // LTR
    + * show_char(text[logicalStart++], visualIndex++);
    + * } while(--length>0);
    + * } else {
    + * logicalStart+=length; // logicalLimit
    + * do { // RTL
    + * show_char(text[--logicalStart], visualIndex++);
    + * } while(--length>0);
    + * }
    + * }
    + *\endcode
    + * </pre>
    + *
    + * Note that in right-to-left runs, code like this places
    + * second surrogates before first ones (which is generally a bad idea)
    + * and combining characters before base characters.
    + * <p>
    + * Use of <code>ubidi_writeReordered()</code>, optionally with the
    + * <code>#UBIDI_KEEP_BASE_COMBINING</code> option, can be considered in order
    + * to avoid these issues.
    + * @stable ICU 2.0
    + */
    +U_STABLE UBiDiDirection U_EXPORT2
    +ubidi_getVisualRun(UBiDi *pBiDi, int32_t runIndex,
    + int32_t *pLogicalStart, int32_t *pLength);
    +
    +/**
    + * Get the visual position from a logical text position.
    + * If such a mapping is used many times on the same
    + * <code>UBiDi</code> object, then calling
    + * <code>ubidi_getLogicalMap()</code> is more efficient.<p>
    + *
    + * The value returned may be <code>#UBIDI_MAP_NOWHERE</code> if there is no
    + * visual position because the corresponding text character is a Bidi control
    + * removed from output by the option <code>#UBIDI_OPTION_REMOVE_CONTROLS</code>.
    + * <p>
    + * When the visual output is altered by using options of
    + * <code>ubidi_writeReordered()</code> such as <code>UBIDI_INSERT_LRM_FOR_NUMERIC</code>,
    + * <code>UBIDI_KEEP_BASE_COMBINING</code>, <code>UBIDI_OUTPUT_REVERSE</code>,
    + * <code>UBIDI_REMOVE_BIDI_CONTROLS</code>, the visual position returned may not
    + * be correct. It is advised to use, when possible, reordering options
    + * such as <code>UBIDI_OPTION_INSERT_MARKS</code> and <code>UBIDI_OPTION_REMOVE_CONTROLS</code>.
    + * <p>
    + * Note that in right-to-left runs, this mapping places
    + * second surrogates before first ones (which is generally a bad idea)
    + * and combining characters before base characters.
    + * Use of <code>ubidi_writeReordered()</code>, optionally with the
    + * <code>#UBIDI_KEEP_BASE_COMBINING</code> option can be considered instead
    + * of using the mapping, in order to avoid these issues.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param logicalIndex is the index of a character in the text.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The visual position of this character.
    + *
    + * @see ubidi_getLogicalMap
    + * @see ubidi_getLogicalIndex
    + * @see ubidi_getProcessedLength
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode);
    +
    +/**
    + * Get the logical text position from a visual position.
    + * If such a mapping is used many times on the same
    + * <code>UBiDi</code> object, then calling
    + * <code>ubidi_getVisualMap()</code> is more efficient.<p>
    + *
    + * The value returned may be <code>#UBIDI_MAP_NOWHERE</code> if there is no
    + * logical position because the corresponding text character is a Bidi mark
    + * inserted in the output by option <code>#UBIDI_OPTION_INSERT_MARKS</code>.
    + * <p>
    + * This is the inverse function to <code>ubidi_getVisualIndex()</code>.
    + * <p>
    + * When the visual output is altered by using options of
    + * <code>ubidi_writeReordered()</code> such as <code>UBIDI_INSERT_LRM_FOR_NUMERIC</code>,
    + * <code>UBIDI_KEEP_BASE_COMBINING</code>, <code>UBIDI_OUTPUT_REVERSE</code>,
    + * <code>UBIDI_REMOVE_BIDI_CONTROLS</code>, the logical position returned may not
    + * be correct. It is advised to use, when possible, reordering options
    + * such as <code>UBIDI_OPTION_INSERT_MARKS</code> and <code>UBIDI_OPTION_REMOVE_CONTROLS</code>.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param visualIndex is the visual position of a character.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The index of this character in the text.
    + *
    + * @see ubidi_getVisualMap
    + * @see ubidi_getVisualIndex
    + * @see ubidi_getResultLength
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode);
    +
    +/**
    + * Get a logical-to-visual index map (array) for the characters in the UBiDi
    + * (paragraph or line) object.
    + * <p>
    + * Some values in the map may be <code>#UBIDI_MAP_NOWHERE</code> if the
    + * corresponding text characters are Bidi controls removed from the visual
    + * output by the option <code>#UBIDI_OPTION_REMOVE_CONTROLS</code>.
    + * <p>
    + * When the visual output is altered by using options of
    + * <code>ubidi_writeReordered()</code> such as <code>UBIDI_INSERT_LRM_FOR_NUMERIC</code>,
    + * <code>UBIDI_KEEP_BASE_COMBINING</code>, <code>UBIDI_OUTPUT_REVERSE</code>,
    + * <code>UBIDI_REMOVE_BIDI_CONTROLS</code>, the visual positions returned may not
    + * be correct. It is advised to use, when possible, reordering options
    + * such as <code>UBIDI_OPTION_INSERT_MARKS</code> and <code>UBIDI_OPTION_REMOVE_CONTROLS</code>.
    + * <p>
    + * Note that in right-to-left runs, this mapping places
    + * second surrogates before first ones (which is generally a bad idea)
    + * and combining characters before base characters.
    + * Use of <code>ubidi_writeReordered()</code>, optionally with the
    + * <code>#UBIDI_KEEP_BASE_COMBINING</code> option can be considered instead
    + * of using the mapping, in order to avoid these issues.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param indexMap is a pointer to an array of <code>ubidi_getProcessedLength()</code>
    + * indexes which will reflect the reordering of the characters.
    + * If option <code>#UBIDI_OPTION_INSERT_MARKS</code> is set, the number
    + * of elements allocated in <code>indexMap</code> must be no less than
    + * <code>ubidi_getResultLength()</code>.
    + * The array does not need to be initialized.<br><br>
    + * The index map will result in <code>indexMap[logicalIndex]==visualIndex</code>.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @see ubidi_getVisualMap
    + * @see ubidi_getVisualIndex
    + * @see ubidi_getProcessedLength
    + * @see ubidi_getResultLength
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
    +
    +/**
    + * Get a visual-to-logical index map (array) for the characters in the UBiDi
    + * (paragraph or line) object.
    + * <p>
    + * Some values in the map may be <code>#UBIDI_MAP_NOWHERE</code> if the
    + * corresponding text characters are Bidi marks inserted in the visual output
    + * by the option <code>#UBIDI_OPTION_INSERT_MARKS</code>.
    + * <p>
    + * When the visual output is altered by using options of
    + * <code>ubidi_writeReordered()</code> such as <code>UBIDI_INSERT_LRM_FOR_NUMERIC</code>,
    + * <code>UBIDI_KEEP_BASE_COMBINING</code>, <code>UBIDI_OUTPUT_REVERSE</code>,
    + * <code>UBIDI_REMOVE_BIDI_CONTROLS</code>, the logical positions returned may not
    + * be correct. It is advised to use, when possible, reordering options
    + * such as <code>UBIDI_OPTION_INSERT_MARKS</code> and <code>UBIDI_OPTION_REMOVE_CONTROLS</code>.
    + *
    + * @param pBiDi is the paragraph or line <code>UBiDi</code> object.
    + *
    + * @param indexMap is a pointer to an array of <code>ubidi_getResultLength()</code>
    + * indexes which will reflect the reordering of the characters.
    + * If option <code>#UBIDI_OPTION_REMOVE_CONTROLS</code> is set, the number
    + * of elements allocated in <code>indexMap</code> must be no less than
    + * <code>ubidi_getProcessedLength()</code>.
    + * The array does not need to be initialized.<br><br>
    + * The index map will result in <code>indexMap[visualIndex]==logicalIndex</code>.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @see ubidi_getLogicalMap
    + * @see ubidi_getLogicalIndex
    + * @see ubidi_getProcessedLength
    + * @see ubidi_getResultLength
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
    +
    +/**
    + * This is a convenience function that does not use a UBiDi object.
    + * It is intended to be used for when an application has determined the levels
    + * of objects (character sequences) and just needs to have them reordered (L2).
    + * This is equivalent to using <code>ubidi_getLogicalMap()</code> on a
    + * <code>UBiDi</code> object.
    + *
    + * @param levels is an array with <code>length</code> levels that have been determined by
    + * the application.
    + *
    + * @param length is the number of levels in the array, or, semantically,
    + * the number of objects to be reordered.
    + * It must be <code>length>0</code>.
    + *
    + * @param indexMap is a pointer to an array of <code>length</code>
    + * indexes which will reflect the reordering of the characters.
    + * The array does not need to be initialized.<p>
    + * The index map will result in <code>indexMap[logicalIndex]==visualIndex</code>.
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_reorderLogical(const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
    +
    +/**
    + * This is a convenience function that does not use a UBiDi object.
    + * It is intended to be used for when an application has determined the levels
    + * of objects (character sequences) and just needs to have them reordered (L2).
    + * This is equivalent to using <code>ubidi_getVisualMap()</code> on a
    + * <code>UBiDi</code> object.
    + *
    + * @param levels is an array with <code>length</code> levels that have been determined by
    + * the application.
    + *
    + * @param length is the number of levels in the array, or, semantically,
    + * the number of objects to be reordered.
    + * It must be <code>length>0</code>.
    + *
    + * @param indexMap is a pointer to an array of <code>length</code>
    + * indexes which will reflect the reordering of the characters.
    + * The array does not need to be initialized.<p>
    + * The index map will result in <code>indexMap[visualIndex]==logicalIndex</code>.
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_reorderVisual(const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
    +
    +/**
    + * Invert an index map.
    + * The index mapping of the first map is inverted and written to
    + * the second one.
    + *
    + * @param srcMap is an array with <code>length</code> elements
    + * which defines the original mapping from a source array containing
    + * <code>length</code> elements to a destination array.
    + * Some elements of the source array may have no mapping in the
    + * destination array. In that case, their value will be
    + * the special value <code>UBIDI_MAP_NOWHERE</code>.
    + * All elements must be >=0 or equal to <code>UBIDI_MAP_NOWHERE</code>.
    + * Some elements may have a value >= <code>length</code>, if the
    + * destination array has more elements than the source array.
    + * There must be no duplicate indexes (two or more elements with the
    + * same value except <code>UBIDI_MAP_NOWHERE</code>).
    + *
    + * @param destMap is an array with a number of elements equal to 1 + the highest
    + * value in <code>srcMap</code>.
    + * <code>destMap</code> will be filled with the inverse mapping.
    + * If element with index i in <code>srcMap</code> has a value k different
    + * from <code>UBIDI_MAP_NOWHERE</code>, this means that element i of
    + * the source array maps to element k in the destination array.
    + * The inverse map will have value i in its k-th element.
    + * For all elements of the destination array which do not map to
    + * an element in the source array, the corresponding element in the
    + * inverse map will have a value equal to <code>UBIDI_MAP_NOWHERE</code>.
    + *
    + * @param length is the length of each array.
    + * @see UBIDI_MAP_NOWHERE
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_invertMap(const int32_t *srcMap, int32_t *destMap, int32_t length);
    +
    +/** option flags for ubidi_writeReordered() */
    +
    +/**
    + * option bit for ubidi_writeReordered():
    + * keep combining characters after their base characters in RTL runs
    + *
    + * @see ubidi_writeReordered
    + * @stable ICU 2.0
    + */
    +#define UBIDI_KEEP_BASE_COMBINING 1
    +
    +/**
    + * option bit for ubidi_writeReordered():
    + * replace characters with the "mirrored" property in RTL runs
    + * by their mirror-image mappings
    + *
    + * @see ubidi_writeReordered
    + * @stable ICU 2.0
    + */
    +#define UBIDI_DO_MIRRORING 2
    +
    +/**
    + * option bit for ubidi_writeReordered():
    + * surround the run with LRMs if necessary;
    + * this is part of the approximate "inverse Bidi" algorithm
    + *
    + * <p>This option does not imply corresponding adjustment of the index
    + * mappings.</p>
    + *
    + * @see ubidi_setInverse
    + * @see ubidi_writeReordered
    + * @stable ICU 2.0
    + */
    +#define UBIDI_INSERT_LRM_FOR_NUMERIC 4
    +
    +/**
    + * option bit for ubidi_writeReordered():
    + * remove Bidi control characters
    + * (this does not affect #UBIDI_INSERT_LRM_FOR_NUMERIC)
    + *
    + * <p>This option does not imply corresponding adjustment of the index
    + * mappings.</p>
    + *
    + * @see ubidi_writeReordered
    + * @stable ICU 2.0
    + */
    +#define UBIDI_REMOVE_BIDI_CONTROLS 8
    +
    +/**
    + * option bit for ubidi_writeReordered():
    + * write the output in reverse order
    + *
    + * <p>This has the same effect as calling <code>ubidi_writeReordered()</code>
    + * first without this option, and then calling
    + * <code>ubidi_writeReverse()</code> without mirroring.
    + * Doing this in the same step is faster and avoids a temporary buffer.
    + * An example for using this option is output to a character terminal that
    + * is designed for RTL scripts and stores text in reverse order.</p>
    + *
    + * @see ubidi_writeReordered
    + * @stable ICU 2.0
    + */
    +#define UBIDI_OUTPUT_REVERSE 16
    +
    +/**
    + * Get the length of the source text processed by the last call to
    + * <code>ubidi_setPara()</code>. This length may be different from the length
    + * of the source text if option <code>#UBIDI_OPTION_STREAMING</code>
    + * has been set.
    + * <br>
    + * Note that whenever the length of the text affects the execution or the
    + * result of a function, it is the processed length which must be considered,
    + * except for <code>ubidi_setPara</code> (which receives unprocessed source
    + * text) and <code>ubidi_getLength</code> (which returns the original length
    + * of the source text).<br>
    + * In particular, the processed length is the one to consider in the following
    + * cases:
    + * <ul>
    + * <li>maximum value of the <code>limit</code> argument of
    + * <code>ubidi_setLine</code></li>
    + * <li>maximum value of the <code>charIndex</code> argument of
    + * <code>ubidi_getParagraph</code></li>
    + * <li>maximum value of the <code>charIndex</code> argument of
    + * <code>ubidi_getLevelAt</code></li>
    + * <li>number of elements in the array returned by <code>ubidi_getLevels</code></li>
    + * <li>maximum value of the <code>logicalStart</code> argument of
    + * <code>ubidi_getLogicalRun</code></li>
    + * <li>maximum value of the <code>logicalIndex</code> argument of
    + * <code>ubidi_getVisualIndex</code></li>
    + * <li>number of elements filled in the <code>*indexMap</code> argument of
    + * <code>ubidi_getLogicalMap</code></li>
    + * <li>length of text processed by <code>ubidi_writeReordered</code></li>
    + * </ul>
    + *
    + * @param pBiDi is the paragraph <code>UBiDi</code> object.
    + *
    + * @return The length of the part of the source text processed by
    + * the last call to <code>ubidi_setPara</code>.
    + * @see ubidi_setPara
    + * @see UBIDI_OPTION_STREAMING
    + * @stable ICU 3.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_getProcessedLength(const UBiDi *pBiDi);
    +
    +/**
    + * Get the length of the reordered text resulting from the last call to
    + * <code>ubidi_setPara()</code>. This length may be different from the length
    + * of the source text if option <code>#UBIDI_OPTION_INSERT_MARKS</code>
    + * or option <code>#UBIDI_OPTION_REMOVE_CONTROLS</code> has been set.
    + * <br>
    + * This resulting length is the one to consider in the following cases:
    + * <ul>
    + * <li>maximum value of the <code>visualIndex</code> argument of
    + * <code>ubidi_getLogicalIndex</code></li>
    + * <li>number of elements of the <code>*indexMap</code> argument of
    + * <code>ubidi_getVisualMap</code></li>
    + * </ul>
    + * Note that this length stays identical to the source text length if
    + * Bidi marks are inserted or removed using option bits of
    + * <code>ubidi_writeReordered</code>, or if option
    + * <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code> has been set.
    + *
    + * @param pBiDi is the paragraph <code>UBiDi</code> object.
    + *
    + * @return The length of the reordered text resulting from
    + * the last call to <code>ubidi_setPara</code>.
    + * @see ubidi_setPara
    + * @see UBIDI_OPTION_INSERT_MARKS
    + * @see UBIDI_OPTION_REMOVE_CONTROLS
    + * @stable ICU 3.6
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_getResultLength(const UBiDi *pBiDi);
    +
    +U_CDECL_BEGIN
    +/**
    + * value returned by <code>UBiDiClassCallback</code> callbacks when
    + * there is no need to override the standard Bidi class for a given code point.
    + * @see UBiDiClassCallback
    + * @stable ICU 3.6
    + */
    +#define U_BIDI_CLASS_DEFAULT U_CHAR_DIRECTION_COUNT
    +
    +/**
    + * Callback type declaration for overriding default Bidi class values with
    + * custom ones.
    + * <p>Usually, the function pointer will be propagated to a <code>UBiDi</code>
    + * object by calling the <code>ubidi_setClassCallback()</code> function;
    + * then the callback will be invoked by the UBA implementation any time the
    + * class of a character is to be determined.</p>
    + *
    + * @param context is a pointer to the callback private data.
    + *
    + * @param c is the code point to get a Bidi class for.
    + *
    + * @return The directional property / Bidi class for the given code point
    + * <code>c</code> if the default class has been overridden, or
    + * <code>#U_BIDI_CLASS_DEFAULT</code> if the standard Bidi class value
    + * for <code>c</code> is to be used.
    + * @see ubidi_setClassCallback
    + * @see ubidi_getClassCallback
    + * @stable ICU 3.6
    + */
    +typedef UCharDirection U_CALLCONV
    +UBiDiClassCallback(const void *context, UChar32 c);
    +
    +U_CDECL_END
    +
    +/**
    + * Retrieve the Bidi class for a given code point.
    + * <p>If a <code>#UBiDiClassCallback</code> callback is defined and returns a
    + * value other than <code>#U_BIDI_CLASS_DEFAULT</code>, that value is used;
    + * otherwise the default class determination mechanism is invoked.</p>
    + *
    + * @param pBiDi is the paragraph <code>UBiDi</code> object.
    + *
    + * @param c is the code point whose Bidi class must be retrieved.
    + *
    + * @return The Bidi class for character <code>c</code> based
    + * on the given <code>pBiDi</code> instance.
    + * @see UBiDiClassCallback
    + * @stable ICU 3.6
    + */
    +U_STABLE UCharDirection U_EXPORT2
    +ubidi_getCustomizedClass(UBiDi *pBiDi, UChar32 c);
    +
    +/**
    + * Set the callback function and callback data used by the UBA
    + * implementation for Bidi class determination.
    + * <p>This may be useful for assigning Bidi classes to PUA characters, or
    + * for special application needs. For instance, an application may want to
    + * handle all spaces like L or R characters (according to the base direction)
    + * when creating the visual ordering of logical lines which are part of a report
    + * organized in columns: there should not be interaction between adjacent
    + * cells.<p>
    + *
    + * @param pBiDi is the paragraph <code>UBiDi</code> object.
    + *
    + * @param newFn is the new callback function pointer.
    + *
    + * @param newContext is the new callback context pointer. This can be NULL.
    + *
    + * @param oldFn fillin: Returns the old callback function pointer. This can be
    + * NULL.
    + *
    + * @param oldContext fillin: Returns the old callback's context. This can be
    + * NULL.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @see ubidi_getClassCallback
    + * @stable ICU 3.6
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_setClassCallback(UBiDi *pBiDi, UBiDiClassCallback *newFn,
    + const void *newContext, UBiDiClassCallback **oldFn,
    + const void **oldContext, UErrorCode *pErrorCode);
    +
    +/**
    + * Get the current callback function used for Bidi class determination.
    + *
    + * @param pBiDi is the paragraph <code>UBiDi</code> object.
    + *
    + * @param fn fillin: Returns the callback function pointer.
    + *
    + * @param context fillin: Returns the callback's private context.
    + *
    + * @see ubidi_setClassCallback
    + * @stable ICU 3.6
    + */
    +U_STABLE void U_EXPORT2
    +ubidi_getClassCallback(UBiDi *pBiDi, UBiDiClassCallback **fn, const void **context);
    +
    +/**
    + * Take a <code>UBiDi</code> object containing the reordering
    + * information for a piece of text (one or more paragraphs) set by
    + * <code>ubidi_setPara()</code> or for a line of text set by
    + * <code>ubidi_setLine()</code> and write a reordered string to the
    + * destination buffer.
    + *
    + * This function preserves the integrity of characters with multiple
    + * code units and (optionally) combining characters.
    + * Characters in RTL runs can be replaced by mirror-image characters
    + * in the destination buffer. Note that "real" mirroring has
    + * to be done in a rendering engine by glyph selection
    + * and that for many "mirrored" characters there are no
    + * Unicode characters as mirror-image equivalents.
    + * There are also options to insert or remove Bidi control
    + * characters; see the description of the <code>destSize</code>
    + * and <code>options</code> parameters and of the option bit flags.
    + *
    + * @param pBiDi A pointer to a <code>UBiDi</code> object that
    + * is set by <code>ubidi_setPara()</code> or
    + * <code>ubidi_setLine()</code> and contains the reordering
    + * information for the text that it was defined for,
    + * as well as a pointer to that text.<br><br>
    + * The text was aliased (only the pointer was stored
    + * without copying the contents) and must not have been modified
    + * since the <code>ubidi_setPara()</code> call.
    + *
    + * @param dest A pointer to where the reordered text is to be copied.
    + * The source text and <code>dest[destSize]</code>
    + * must not overlap.
    + *
    + * @param destSize The size of the <code>dest</code> buffer,
    + * in number of UChars.
    + * If the <code>UBIDI_INSERT_LRM_FOR_NUMERIC</code>
    + * option is set, then the destination length could be
    + * as large as
    + * <code>ubidi_getLength(pBiDi)+2*ubidi_countRuns(pBiDi)</code>.
    + * If the <code>UBIDI_REMOVE_BIDI_CONTROLS</code> option
    + * is set, then the destination length may be less than
    + * <code>ubidi_getLength(pBiDi)</code>.
    + * If none of these options is set, then the destination length
    + * will be exactly <code>ubidi_getProcessedLength(pBiDi)</code>.
    + *
    + * @param options A bit set of options for the reordering that control
    + * how the reordered text is written.
    + * The options include mirroring the characters on a code
    + * point basis and inserting LRM characters, which is used
    + * especially for transforming visually stored text
    + * to logically stored text (although this is still an
    + * imperfect implementation of an "inverse Bidi" algorithm
    + * because it uses the "forward Bidi" algorithm at its core).
    + * The available options are:
    + * <code>#UBIDI_DO_MIRRORING</code>,
    + * <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code>,
    + * <code>#UBIDI_KEEP_BASE_COMBINING</code>,
    + * <code>#UBIDI_OUTPUT_REVERSE</code>,
    + * <code>#UBIDI_REMOVE_BIDI_CONTROLS</code>
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The length of the output string.
    + *
    + * @see ubidi_getProcessedLength
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_writeReordered(UBiDi *pBiDi,
    + UChar *dest, int32_t destSize,
    + uint16_t options,
    + UErrorCode *pErrorCode);
    +
    +/**
    + * Reverse a Right-To-Left run of Unicode text.
    + *
    + * This function preserves the integrity of characters with multiple
    + * code units and (optionally) combining characters.
    + * Characters can be replaced by mirror-image characters
    + * in the destination buffer. Note that "real" mirroring has
    + * to be done in a rendering engine by glyph selection
    + * and that for many "mirrored" characters there are no
    + * Unicode characters as mirror-image equivalents.
    + * There are also options to insert or remove Bidi control
    + * characters.
    + *
    + * This function is the implementation for reversing RTL runs as part
    + * of <code>ubidi_writeReordered()</code>. For detailed descriptions
    + * of the parameters, see there.
    + * Since no Bidi controls are inserted here, the output string length
    + * will never exceed <code>srcLength</code>.
    + *
    + * @see ubidi_writeReordered
    + *
    + * @param src A pointer to the RTL run text.
    + *
    + * @param srcLength The length of the RTL run.
    + *
    + * @param dest A pointer to where the reordered text is to be copied.
    + * <code>src[srcLength]</code> and <code>dest[destSize]</code>
    + * must not overlap.
    + *
    + * @param destSize The size of the <code>dest</code> buffer,
    + * in number of UChars.
    + * If the <code>UBIDI_REMOVE_BIDI_CONTROLS</code> option
    + * is set, then the destination length may be less than
    + * <code>srcLength</code>.
    + * If this option is not set, then the destination length
    + * will be exactly <code>srcLength</code>.
    + *
    + * @param options A bit set of options for the reordering that control
    + * how the reordered text is written.
    + * See the <code>options</code> parameter in <code>ubidi_writeReordered()</code>.
    + *
    + * @param pErrorCode must be a valid pointer to an error code value.
    + *
    + * @return The length of the output string.
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ubidi_writeReverse(const UChar *src, int32_t srcLength,
    + UChar *dest, int32_t destSize,
    + uint16_t options,
    + UErrorCode *pErrorCode);
    +
    +/*#define BIDI_SAMPLE_CODE*/
    +/*@}*/
    +
    +#endif
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/tzrule.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/tzrule.h b/platform/osx/icu/unicode/tzrule.h
    new file mode 100644
    index 0000000..95ad1d0
    --- /dev/null
    +++ b/platform/osx/icu/unicode/tzrule.h
    @@ -0,0 +1,828 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2007-2008, International Business Machines Corporation and *
    +* others. All Rights Reserved. *
    +*******************************************************************************
    +*/
    +#ifndef TZRULE_H
    +#define TZRULE_H
    +
    +/**
    + * \file
    + * \brief C++ API: Time zone rule classes
    + */
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/uobject.h"
    +#include "unicode/unistr.h"
    +#include "unicode/dtrule.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +/**
    + * <code>TimeZoneRule</code> is a class representing a rule for time zone.
    + * <code>TimeZoneRule</code> has a set of time zone attributes, such as zone name,
    + * raw offset (UTC offset for standard time) and daylight saving time offset.
    + *
    + * @stable ICU 4.0
    + */
    +class U_I18N_API TimeZoneRule : public UObject {
    +public:
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + virtual ~TimeZoneRule();
    +
    + /**
    + * Clone this TimeZoneRule object polymorphically. The caller owns the result and
    + * should delete it when done.
    + * @return A copy of the object.
    + * @stable ICU 4.0
    + */
    + virtual TimeZoneRule* clone(void) const = 0;
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically equal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically equal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator==(const TimeZoneRule& that) const;
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically unequal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator!=(const TimeZoneRule& that) const;
    +
    + /**
    + * Fills in "name" with the name of this time zone.
    + * @param name Receives the name of this time zone.
    + * @return A reference to "name"
    + * @stable ICU 4.0
    + */
    + UnicodeString& getName(UnicodeString& name) const;
    +
    + /**
    + * Gets the standard time offset.
    + * @return The standard time offset from UTC in milliseconds.
    + * @stable ICU 4.0
    + */
    + int32_t getRawOffset(void) const;
    +
    + /**
    + * Gets the amount of daylight saving delta time from the standard time.
    + * @return The amount of daylight saving offset used by this rule
    + * in milliseconds.
    + * @stable ICU 4.0
    + */
    + int32_t getDSTSavings(void) const;
    +
    + /**
    + * Returns if this rule represents the same rule and offsets as another.
    + * When two <code>TimeZoneRule</code> objects differ only its names, this method
    + * returns true.
    + * @param other The <code>TimeZoneRule</code> object to be compared with.
    + * @return true if the other <code>TimeZoneRule</code> is the same as this one.
    + * @stable ICU 4.0
    + */
    + virtual UBool isEquivalentTo(const TimeZoneRule& other) const;
    +
    + /**
    + * Gets the very first time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the very first time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const = 0;
    +
    + /**
    + * Gets the final time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the final time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const = 0;
    +
    + /**
    + * Gets the first time when this rule takes effect after the specified time.
    + * @param base The first start time after this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The first time when this rule takes effect after
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const = 0;
    +
    + /**
    + * Gets the most recent time when this rule takes effect before the specified time.
    + * @param base The most recent time before this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The most recent time when this rule takes effect before
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const = 0;
    +
    +protected:
    +
    + /**
    + * Constructs a <code>TimeZoneRule</code> with the name, the GMT offset of its
    + * standard time and the amount of daylight saving offset adjustment.
    + * @param name The time zone name.
    + * @param rawOffset The UTC offset of its standard time in milliseconds.
    + * @param dstSavings The amount of daylight saving offset adjustment in milliseconds.
    + * If this ia a rule for standard time, the value of this argument is 0.
    + * @stable ICU 4.0
    + */
    + TimeZoneRule(const UnicodeString& name, int32_t rawOffset, int32_t dstSavings);
    +
    + /**
    + * Copy constructor.
    + * @param source The TimeZoneRule object to be copied.
    + * @stable ICU 4.0
    + */
    + TimeZoneRule(const TimeZoneRule& source);
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + TimeZoneRule& operator=(const TimeZoneRule& right);
    +
    +private:
    + UnicodeString fName; // time name
    + int32_t fRawOffset; // UTC offset of the standard time in milliseconds
    + int32_t fDSTSavings; // DST saving amount in milliseconds
    +};
    +
    +/**
    + * <code>InitialTimeZoneRule</code> represents a time zone rule
    + * representing a time zone effective from the beginning and
    + * has no actual start times.
    + * @stable ICU 4.0
    + */
    +class U_I18N_API InitialTimeZoneRule : public TimeZoneRule {
    +public:
    + /**
    + * Constructs an <code>InitialTimeZoneRule</code> with the name, the GMT offset of its
    + * standard time and the amount of daylight saving offset adjustment.
    + * @param name The time zone name.
    + * @param rawOffset The UTC offset of its standard time in milliseconds.
    + * @param dstSavings The amount of daylight saving offset adjustment in milliseconds.
    + * If this ia a rule for standard time, the value of this argument is 0.
    + * @stable ICU 4.0
    + */
    + InitialTimeZoneRule(const UnicodeString& name, int32_t rawOffset, int32_t dstSavings);
    +
    + /**
    + * Copy constructor.
    + * @param source The InitialTimeZoneRule object to be copied.
    + * @stable ICU 4.0
    + */
    + InitialTimeZoneRule(const InitialTimeZoneRule& source);
    +
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + virtual ~InitialTimeZoneRule();
    +
    + /**
    + * Clone this InitialTimeZoneRule object polymorphically. The caller owns the result and
    + * should delete it when done.
    + * @return A copy of the object.
    + * @stable ICU 4.0
    + */
    + virtual InitialTimeZoneRule* clone(void) const;
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + InitialTimeZoneRule& operator=(const InitialTimeZoneRule& right);
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically equal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically equal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator==(const TimeZoneRule& that) const;
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically unequal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator!=(const TimeZoneRule& that) const;
    +
    + /**
    + * Gets the time when this rule takes effect in the given year.
    + * @param year The Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the start time in the year.
    + * @return true if this rule takes effect in the year and the result is set to
    + * "result".
    + * @stable ICU 4.0
    + */
    + UBool getStartInYear(int32_t year, int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Returns if this rule represents the same rule and offsets as another.
    + * When two <code>TimeZoneRule</code> objects differ only its names, this method
    + * returns true.
    + * @param that The <code>TimeZoneRule</code> object to be compared with.
    + * @return true if the other <code>TimeZoneRule</code> is equivalent to this one.
    + * @stable ICU 4.0
    + */
    + virtual UBool isEquivalentTo(const TimeZoneRule& that) const;
    +
    + /**
    + * Gets the very first time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the very first time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Gets the final time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the final time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Gets the first time when this rule takes effect after the specified time.
    + * @param base The first start time after this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The first time when this rule takes effect after
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const;
    +
    + /**
    + * Gets the most recent time when this rule takes effect before the specified time.
    + * @param base The most recent time before this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The most recent time when this rule takes effect before
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const;
    +
    +public:
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +};
    +
    +/**
    + * <code>AnnualTimeZoneRule</code> is a class used for representing a time zone
    + * rule which takes effect annually. The calenday system used for the rule is
    + * is based on Gregorian calendar
    + *
    + * @stable ICU 4.0
    + */
    +class U_I18N_API AnnualTimeZoneRule : public TimeZoneRule {
    +public:
    + /**
    + * The constant representing the maximum year used for designating
    + * a rule is permanent.
    + */
    + static const int32_t MAX_YEAR;
    +
    + /**
    + * Constructs a <code>AnnualTimeZoneRule</code> with the name, the GMT offset of its
    + * standard time, the amount of daylight saving offset adjustment, the annual start
    + * time rule and the start/until years. The input DateTimeRule is copied by this
    + * constructor, so the caller remains responsible for deleting the object.
    + * @param name The time zone name.
    + * @param rawOffset The GMT offset of its standard time in milliseconds.
    + * @param dstSavings The amount of daylight saving offset adjustment in
    + * milliseconds. If this ia a rule for standard time,
    + * the value of this argument is 0.
    + * @param dateTimeRule The start date/time rule repeated annually.
    + * @param startYear The first year when this rule takes effect.
    + * @param endYear The last year when this rule takes effect. If this
    + * rule is effective forever in future, specify MAX_YEAR.
    + * @stable ICU 4.0
    + */
    + AnnualTimeZoneRule(const UnicodeString& name, int32_t rawOffset, int32_t dstSavings,
    + const DateTimeRule& dateTimeRule, int32_t startYear, int32_t endYear);
    +
    + /**
    + * Constructs a <code>AnnualTimeZoneRule</code> with the name, the GMT offset of its
    + * standard time, the amount of daylight saving offset adjustment, the annual start
    + * time rule and the start/until years. The input DateTimeRule object is adopted
    + * by this object, therefore, the caller must not delete the object.
    + * @param name The time zone name.
    + * @param rawOffset The GMT offset of its standard time in milliseconds.
    + * @param dstSavings The amount of daylight saving offset adjustment in
    + * milliseconds. If this ia a rule for standard time,
    + * the value of this argument is 0.
    + * @param dateTimeRule The start date/time rule repeated annually.
    + * @param startYear The first year when this rule takes effect.
    + * @param endYear The last year when this rule takes effect. If this
    + * rule is effective forever in future, specify MAX_YEAR.
    + * @stable ICU 4.0
    + */
    + AnnualTimeZoneRule(const UnicodeString& name, int32_t rawOffset, int32_t dstSavings,
    + DateTimeRule* dateTimeRule, int32_t startYear, int32_t endYear);
    +
    + /**
    + * Copy constructor.
    + * @param source The AnnualTimeZoneRule object to be copied.
    + * @stable ICU 4.0
    + */
    + AnnualTimeZoneRule(const AnnualTimeZoneRule& source);
    +
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + virtual ~AnnualTimeZoneRule();
    +
    + /**
    + * Clone this AnnualTimeZoneRule object polymorphically. The caller owns the result and
    + * should delete it when done.
    + * @return A copy of the object.
    + * @stable ICU 4.0
    + */
    + virtual AnnualTimeZoneRule* clone(void) const;
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + AnnualTimeZoneRule& operator=(const AnnualTimeZoneRule& right);
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically equal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically equal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator==(const TimeZoneRule& that) const;
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically unequal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator!=(const TimeZoneRule& that) const;
    +
    + /**
    + * Gets the start date/time rule used by this rule.
    + * @return The <code>AnnualDateTimeRule</code> which represents the start date/time
    + * rule used by this time zone rule.
    + * @stable ICU 4.0
    + */
    + const DateTimeRule* getRule(void) const;
    +
    + /**
    + * Gets the first year when this rule takes effect.
    + * @return The start year of this rule. The year is in Gregorian calendar
    + * with 0 == 1 BCE, -1 == 2 BCE, etc.
    + * @stable ICU 4.0
    + */
    + int32_t getStartYear(void) const;
    +
    + /**
    + * Gets the end year when this rule takes effect.
    + * @return The end year of this rule (inclusive). The year is in Gregorian calendar
    + * with 0 == 1 BCE, -1 == 2 BCE, etc.
    + * @stable ICU 4.0
    + */
    + int32_t getEndYear(void) const;
    +
    + /**
    + * Gets the time when this rule takes effect in the given year.
    + * @param year The Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the start time in the year.
    + * @return true if this rule takes effect in the year and the result is set to
    + * "result".
    + * @stable ICU 4.0
    + */
    + UBool getStartInYear(int32_t year, int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Returns if this rule represents the same rule and offsets as another.
    + * When two <code>TimeZoneRule</code> objects differ only its names, this method
    + * returns true.
    + * @param that The <code>TimeZoneRule</code> object to be compared with.
    + * @return true if the other <code>TimeZoneRule</code> is equivalent to this one.
    + * @stable ICU 4.0
    + */
    + virtual UBool isEquivalentTo(const TimeZoneRule& that) const;
    +
    + /**
    + * Gets the very first time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the very first time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Gets the final time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the final time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Gets the first time when this rule takes effect after the specified time.
    + * @param base The first start time after this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The first time when this rule takes effect after
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const;
    +
    + /**
    + * Gets the most recent time when this rule takes effect before the specified time.
    + * @param base The most recent time before this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The most recent time when this rule takes effect before
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const;
    +
    +
    +private:
    + DateTimeRule* fDateTimeRule;
    + int32_t fStartYear;
    + int32_t fEndYear;
    +
    +public:
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +};
    +
    +/**
    + * <code>TimeArrayTimeZoneRule</code> represents a time zone rule whose start times are
    + * defined by an array of milliseconds since the standard base time.
    + *
    + * @stable ICU 4.0
    + */
    +class U_I18N_API TimeArrayTimeZoneRule : public TimeZoneRule {
    +public:
    + /**
    + * Constructs a <code>TimeArrayTimeZoneRule</code> with the name, the GMT offset of its
    + * standard time, the amount of daylight saving offset adjustment and
    + * the array of times when this rule takes effect.
    + * @param name The time zone name.
    + * @param rawOffset The UTC offset of its standard time in milliseconds.
    + * @param dstSavings The amount of daylight saving offset adjustment in
    + * milliseconds. If this ia a rule for standard time,
    + * the value of this argument is 0.
    + * @param startTimes The array start times in milliseconds since the base time
    + * (January 1, 1970, 00:00:00).
    + * @param numStartTimes The number of elements in the parameter "startTimes"
    + * @param timeRuleType The time type of the start times, which is one of
    + * <code>DataTimeRule::WALL_TIME</code>, <code>STANDARD_TIME</code>
    + * and <code>UTC_TIME</code>.
    + * @stable ICU 4.0
    + */
    + TimeArrayTimeZoneRule(const UnicodeString& name, int32_t rawOffset, int32_t dstSavings,
    + const UDate* startTimes, int32_t numStartTimes, DateTimeRule::TimeRuleType timeRuleType);
    +
    + /**
    + * Copy constructor.
    + * @param source The TimeArrayTimeZoneRule object to be copied.
    + * @stable ICU 4.0
    + */
    + TimeArrayTimeZoneRule(const TimeArrayTimeZoneRule& source);
    +
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + virtual ~TimeArrayTimeZoneRule();
    +
    + /**
    + * Clone this TimeArrayTimeZoneRule object polymorphically. The caller owns the result and
    + * should delete it when done.
    + * @return A copy of the object.
    + * @stable ICU 4.0
    + */
    + virtual TimeArrayTimeZoneRule* clone(void) const;
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + TimeArrayTimeZoneRule& operator=(const TimeArrayTimeZoneRule& right);
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically equal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically equal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator==(const TimeZoneRule& that) const;
    +
    + /**
    + * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZoneRule</code> objects are semantically unequal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator!=(const TimeZoneRule& that) const;
    +
    + /**
    + * Gets the time type of the start times used by this rule. The return value
    + * is either <code>DateTimeRule::WALL_TIME</code> or <code>STANDARD_TIME</code>
    + * or <code>UTC_TIME</code>.
    + *
    + * @return The time type used of the start times used by this rule.
    + * @stable ICU 4.0
    + */
    + DateTimeRule::TimeRuleType getTimeType(void) const;
    +
    + /**
    + * Gets a start time at the index stored in this rule.
    + * @param index The index of start times
    + * @param result Receives the start time at the index
    + * @return true if the index is within the valid range and
    + * and the result is set. When false, the output
    + * parameger "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + UBool getStartTimeAt(int32_t index, UDate& result) const;
    +
    + /**
    + * Returns the number of start times stored in this rule
    + * @return The number of start times.
    + * @stable ICU 4.0
    + */
    + int32_t countStartTimes(void) const;
    +
    + /**
    + * Returns if this rule represents the same rule and offsets as another.
    + * When two <code>TimeZoneRule</code> objects differ only its names, this method
    + * returns true.
    + * @param that The <code>TimeZoneRule</code> object to be compared with.
    + * @return true if the other <code>TimeZoneRule</code> is equivalent to this one.
    + * @stable ICU 4.0
    + */
    + virtual UBool isEquivalentTo(const TimeZoneRule& that) const;
    +
    + /**
    + * Gets the very first time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the very first time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Gets the final time when this rule takes effect.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param result Receives the final time when this rule takes effect.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const;
    +
    + /**
    + * Gets the first time when this rule takes effect after the specified time.
    + * @param base The first start time after this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The first time when this rule takes effect after
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const;
    +
    + /**
    + * Gets the most recent time when this rule takes effect before the specified time.
    + * @param base The most recent time before this base time will be returned.
    + * @param prevRawOffset The standard time offset from UTC before this rule
    + * takes effect in milliseconds.
    + * @param prevDSTSavings The amount of daylight saving offset from the
    + * standard time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives The most recent time when this rule takes effect before
    + * the specified base time.
    + * @return true if the start time is available. When false is returned, output parameter
    + * "result" is unchanged.
    + * @stable ICU 4.0
    + */
    + virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings,
    + UBool inclusive, UDate& result) const;
    +
    +
    +private:
    + enum { TIMEARRAY_STACK_BUFFER_SIZE = 32 };
    + UBool initStartTimes(const UDate source[], int32_t size, UErrorCode& ec);
    + UDate getUTC(UDate time, int32_t raw, int32_t dst) const;
    +
    + DateTimeRule::TimeRuleType fTimeRuleType;
    + int32_t fNumStartTimes;
    + UDate* fStartTimes;
    + UDate fLocalStartTimes[TIMEARRAY_STACK_BUFFER_SIZE];
    +
    +public:
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +};
    +
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // TZRULE_H
    +
    +//eof

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/tztrans.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/tztrans.h b/platform/osx/icu/unicode/tztrans.h
    new file mode 100644
    index 0000000..12f85d6
    --- /dev/null
    +++ b/platform/osx/icu/unicode/tztrans.h
    @@ -0,0 +1,195 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2007-2008, International Business Machines Corporation and *
    +* others. All Rights Reserved. *
    +*******************************************************************************
    +*/
    +#ifndef TZTRANS_H
    +#define TZTRANS_H
    +
    +/**
    + * \file
    + * \brief C++ API: Time zone transition
    + */
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/uobject.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +// Forward declaration
    +class TimeZoneRule;
    +
    +/**
    + * <code>TimeZoneTransition</code> is a class representing a time zone transition.
    + * An instance has a time of transition and rules for both before and after the transition.
    + * @stable ICU 4.0
    + */
    +class U_I18N_API TimeZoneTransition : public UObject {
    +public:
    + /**
    + * Constructs a <code>TimeZoneTransition</code> with the time and the rules before/after
    + * the transition.
    + *
    + * @param time The time of transition in milliseconds since the base time.
    + * @param from The time zone rule used before the transition.
    + * @param to The time zone rule used after the transition.
    + * @stable ICU 4.0
    + */
    + TimeZoneTransition(UDate time, const TimeZoneRule& from, const TimeZoneRule& to);
    +
    + /**
    + * Constructs an empty <code>TimeZoneTransition</code>
    + * @stable ICU 4.0
    + */
    + TimeZoneTransition();
    +
    + /**
    + * Copy constructor.
    + * @param source The TimeZoneTransition object to be copied.
    + * @stable ICU 4.0
    + */
    + TimeZoneTransition(const TimeZoneTransition& source);
    +
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + ~TimeZoneTransition();
    +
    + /**
    + * Clone this TimeZoneTransition object polymorphically. The caller owns the result and
    + * should delete it when done.
    + * @return A copy of the object.
    + * @stable ICU 4.0
    + */
    + TimeZoneTransition* clone(void) const;
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + TimeZoneTransition& operator=(const TimeZoneTransition& right);
    +
    + /**
    + * Return true if the given TimeZoneTransition objects are semantically equal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given TimeZoneTransition objects are semantically equal.
    + * @stable ICU 4.0
    + */
    + UBool operator==(const TimeZoneTransition& that) const;
    +
    + /**
    + * Return true if the given TimeZoneTransition objects are semantically unequal. Objects
    + * of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given TimeZoneTransition objects are semantically unequal.
    + * @stable ICU 4.0
    + */
    + UBool operator!=(const TimeZoneTransition& that) const;
    +
    + /**
    + * Returns the time of transition in milliseconds.
    + * @return The time of the transition in milliseconds since the 1970 Jan 1 epoch time.
    + * @stable ICU 4.0
    + */
    + UDate getTime(void) const;
    +
    + /**
    + * Sets the time of transition in milliseconds.
    + * @param time The time of the transition in milliseconds since the 1970 Jan 1 epoch time.
    + * @stable ICU 4.0
    + */
    + void setTime(UDate time);
    +
    + /**
    + * Returns the rule used before the transition.
    + * @return The time zone rule used after the transition.
    + * @stable ICU 4.0
    + */
    + const TimeZoneRule* getFrom(void) const;
    +
    + /**
    + * Sets the rule used before the transition. The caller remains
    + * responsible for deleting the <code>TimeZoneRule</code> object.
    + * @param from The time zone rule used before the transition.
    + * @stable ICU 4.0
    + */
    + void setFrom(const TimeZoneRule& from);
    +
    + /**
    + * Adopts the rule used before the transition. The caller must
    + * not delete the <code>TimeZoneRule</code> object passed in.
    + * @param from The time zone rule used before the transition.
    + * @stable ICU 4.0
    + */
    + void adoptFrom(TimeZoneRule* from);
    +
    + /**
    + * Sets the rule used after the transition. The caller remains
    + * responsible for deleting the <code>TimeZoneRule</code> object.
    + * @param to The time zone rule used after the transition.
    + * @stable ICU 4.0
    + */
    + void setTo(const TimeZoneRule& to);
    +
    + /**
    + * Adopts the rule used after the transition. The caller must
    + * not delete the <code>TimeZoneRule</code> object passed in.
    + * @param to The time zone rule used after the transition.
    + * @stable ICU 4.0
    + */
    + void adoptTo(TimeZoneRule* to);
    +
    + /**
    + * Returns the rule used after the transition.
    + * @return The time zone rule used after the transition.
    + * @stable ICU 4.0
    + */
    + const TimeZoneRule* getTo(void) const;
    +
    +private:
    + UDate fTime;
    + TimeZoneRule* fFrom;
    + TimeZoneRule* fTo;
    +
    +public:
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +};
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // TZTRANS_H
    +
    +//eof
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/caniter.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/caniter.h b/platform/osx/icu/unicode/caniter.h
    new file mode 100644
    index 0000000..84a6595
    --- /dev/null
    +++ b/platform/osx/icu/unicode/caniter.h
    @@ -0,0 +1,201 @@
    +/*
    + *******************************************************************************
    + * Copyright (C) 1996-2006, International Business Machines Corporation and *
    + * others. All Rights Reserved. *
    + *******************************************************************************
    + */
    +
    +#ifndef CANITER_H
    +#define CANITER_H
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_NORMALIZATION
    +
    +#include "unicode/uobject.h"
    +#include "unicode/unistr.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Canonical Iterator
    + */
    +
    +/** Should permutation skip characters with combining class zero
    + * Should be either TRUE or FALSE. This is a compile time option
    + * @stable ICU 2.4
    + */
    +#ifndef CANITER_SKIP_ZEROES
    +#define CANITER_SKIP_ZEROES TRUE
    +#endif
    +
    +U_NAMESPACE_BEGIN
    +
    +class Hashtable;
    +
    +/**
    + * This class allows one to iterate through all the strings that are canonically equivalent to a given
    + * string. For example, here are some sample results:
    +Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA}
    +1: \\u0041\\u030A\\u0064\\u0307\\u0327
    + = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA}
    +2: \\u0041\\u030A\\u0064\\u0327\\u0307
    + = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE}
    +3: \\u0041\\u030A\\u1E0B\\u0327
    + = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA}
    +4: \\u0041\\u030A\\u1E11\\u0307
    + = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE}
    +5: \\u00C5\\u0064\\u0307\\u0327
    + = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA}
    +6: \\u00C5\\u0064\\u0327\\u0307
    + = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE}
    +7: \\u00C5\\u1E0B\\u0327
    + = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA}
    +8: \\u00C5\\u1E11\\u0307
    + = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE}
    +9: \\u212B\\u0064\\u0307\\u0327
    + = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA}
    +10: \\u212B\\u0064\\u0327\\u0307
    + = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE}
    +11: \\u212B\\u1E0B\\u0327
    + = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA}
    +12: \\u212B\\u1E11\\u0307
    + = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE}
    + *<br>Note: the code is intended for use with small strings, and is not suitable for larger ones,
    + * since it has not been optimized for that situation.
    + * Note, CanonicalIterator is not intended to be subclassed.
    + * @author M. Davis
    + * @author C++ port by V. Weinstein
    + * @stable ICU 2.4
    + */
    +class U_COMMON_API CanonicalIterator : public UObject {
    +public:
    + /**
    + * Construct a CanonicalIterator object
    + * @param source string to get results for
    + * @param status Fill-in parameter which receives the status of this operation.
    + * @stable ICU 2.4
    + */
    + CanonicalIterator(const UnicodeString &source, UErrorCode &status);
    +
    + /** Destructor
    + * Cleans pieces
    + * @stable ICU 2.4
    + */
    + virtual ~CanonicalIterator();
    +
    + /**
    + * Gets the NFD form of the current source we are iterating over.
    + * @return gets the source: NOTE: it is the NFD form of source
    + * @stable ICU 2.4
    + */
    + UnicodeString getSource();
    +
    + /**
    + * Resets the iterator so that one can start again from the beginning.
    + * @stable ICU 2.4
    + */
    + void reset();
    +
    + /**
    + * Get the next canonically equivalent string.
    + * <br><b>Warning: The strings are not guaranteed to be in any particular order.</b>
    + * @return the next string that is canonically equivalent. A bogus string is returned when
    + * the iteration is done.
    + * @stable ICU 2.4
    + */
    + UnicodeString next();
    +
    + /**
    + * Set a new source for this iterator. Allows object reuse.
    + * @param newSource the source string to iterate against. This allows the same iterator to be used
    + * while changing the source string, saving object creation.
    + * @param status Fill-in parameter which receives the status of this operation.
    + * @stable ICU 2.4
    + */
    + void setSource(const UnicodeString &newSource, UErrorCode &status);
    +
    + /**
    + * Dumb recursive implementation of permutation.
    + * TODO: optimize
    + * @param source the string to find permutations for
    + * @param skipZeros determine if skip zeros
    + * @param result the results in a set.
    + * @param status Fill-in parameter which receives the status of this operation.
    + * @internal
    + */
    + static void U_EXPORT2 permute(UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status);
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for this class.
    + *
    + * @stable ICU 2.2
    + */
    + static UClassID U_EXPORT2 getStaticClassID();
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for the actual class.
    + *
    + * @stable ICU 2.2
    + */
    + virtual UClassID getDynamicClassID() const;
    +
    +private:
    + // ===================== PRIVATES ==============================
    + // private default constructor
    + CanonicalIterator();
    +
    +
    + /**
    + * Copy constructor. Private for now.
    + * @internal
    + */
    + CanonicalIterator(const CanonicalIterator& other);
    +
    + /**
    + * Assignment operator. Private for now.
    + * @internal
    + */
    + CanonicalIterator& operator=(const CanonicalIterator& other);
    +
    + // fields
    + UnicodeString source;
    + UBool done;
    +
    + // 2 dimensional array holds the pieces of the string with
    + // their different canonically equivalent representations
    + UnicodeString **pieces;
    + int32_t pieces_length;
    + int32_t *pieces_lengths;
    +
    + // current is used in iterating to combine pieces
    + int32_t *current;
    + int32_t current_length;
    +
    + // transient fields
    + UnicodeString buffer;
    +
    + // we have a segment, in NFD. Find all the strings that are canonically equivalent to it.
    + UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status); //private String[] getEquivalents(String segment)
    +
    + //Set getEquivalents2(String segment);
    + Hashtable *getEquivalents2(Hashtable *fillinResult, const UChar *segment, int32_t segLen, UErrorCode &status);
    + //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status);
    +
    + /**
    + * See if the decomposition of cp2 is at segment starting at segmentPos
    + * (with canonical rearrangment!)
    + * If so, take the remainder, and return the equivalents
    + */
    + //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer);
    + Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
    + //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
    +
    + void cleanPieces();
    +
    +};
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_NORMALIZATION */
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/chariter.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/chariter.h b/platform/osx/icu/unicode/chariter.h
    new file mode 100644
    index 0000000..12fc924
    --- /dev/null
    +++ b/platform/osx/icu/unicode/chariter.h
    @@ -0,0 +1,716 @@
    +/*
    +********************************************************************
    +*
    +* Copyright (C) 1997-2005, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +********************************************************************
    +*/
    +
    +#ifndef CHARITER_H
    +#define CHARITER_H
    +
    +#include "unicode/utypes.h"
    +#include "unicode/uobject.h"
    +#include "unicode/unistr.h"
    +/**
    + * \file
    + * \brief C++ API: Character Iterator
    + */
    +
    +U_NAMESPACE_BEGIN
    +/**
    + * Abstract class that defines an API for forward-only iteration
    + * on text objects.
    + * This is a minimal interface for iteration without random access
    + * or backwards iteration. It is especially useful for wrapping
    + * streams with converters into an object for collation or
    + * normalization.
    + *
    + * <p>Characters can be accessed in two ways: as code units or as
    + * code points.
    + * Unicode code points are 21-bit integers and are the scalar values
    + * of Unicode characters. ICU uses the type UChar32 for them.
    + * Unicode code units are the storage units of a given
    + * Unicode/UCS Transformation Format (a character encoding scheme).
    + * With UTF-16, all code points can be represented with either one
    + * or two code units ("surrogates").
    + * String storage is typically based on code units, while properties
    + * of characters are typically determined using code point values.
    + * Some processes may be designed to work with sequences of code units,
    + * or it may be known that all characters that are important to an
    + * algorithm can be represented with single code units.
    + * Other processes will need to use the code point access functions.</p>
    + *
    + * <p>ForwardCharacterIterator provides nextPostInc() to access
    + * a code unit and advance an internal position into the text object,
    + * similar to a <code>return text[position++]</code>.<br>
    + * It provides next32PostInc() to access a code point and advance an internal
    + * position.</p>
    + *
    + * <p>next32PostInc() assumes that the current position is that of
    + * the beginning of a code point, i.e., of its first code unit.
    + * After next32PostInc(), this will be true again.
    + * In general, access to code units and code points in the same
    + * iteration loop should not be mixed. In UTF-16, if the current position
    + * is on a second code unit (Low Surrogate), then only that code unit
    + * is returned even by next32PostInc().</p>
    + *
    + * <p>For iteration with either function, there are two ways to
    + * check for the end of the iteration. When there are no more
    + * characters in the text object:
    + * <ul>
    + * <li>The hasNext() function returns FALSE.</li>
    + * <li>nextPostInc() and next32PostInc() return DONE
    + * when one attempts to read beyond the end of the text object.</li>
    + * </ul>
    + *
    + * Example:
    + * \code
    + * void function1(ForwardCharacterIterator &it) {
    + * UChar32 c;
    + * while(it.hasNext()) {
    + * c=it.next32PostInc();
    + * // use c
    + * }
    + * }
    + *
    + * void function1(ForwardCharacterIterator &it) {
    + * UChar c;
    + * while((c=it.nextPostInc())!=ForwardCharacterIterator::DONE) {
    + * // use c
    + * }
    + * }
    + * \endcode
    + * </p>
    + *
    + * @stable ICU 2.0
    + */
    +class U_COMMON_API ForwardCharacterIterator : public UObject {
    +public:
    + /**
    + * Value returned by most of ForwardCharacterIterator's functions
    + * when the iterator has reached the limits of its iteration.
    + * @stable ICU 2.0
    + */
    + enum { DONE = 0xffff };
    +
    + /**
    + * Destructor.
    + * @stable ICU 2.0
    + */
    + virtual ~ForwardCharacterIterator();
    +
    + /**
    + * Returns true when both iterators refer to the same
    + * character in the same character-storage object.
    + * @param that The ForwardCharacterIterator to be compared for equality
    + * @return true when both iterators refer to the same
    + * character in the same character-storage object
    + * @stable ICU 2.0
    + */
    + virtual UBool operator==(const ForwardCharacterIterator& that) const = 0;
    +
    + /**
    + * Returns true when the iterators refer to different
    + * text-storage objects, or to different characters in the
    + * same text-storage object.
    + * @param that The ForwardCharacterIterator to be compared for inequality
    + * @return true when the iterators refer to different
    + * text-storage objects, or to different characters in the
    + * same text-storage object
    + * @stable ICU 2.0
    + */
    + inline UBool operator!=(const ForwardCharacterIterator& that) const;
    +
    + /**
    + * Generates a hash code for this iterator.
    + * @return the hash code.
    + * @stable ICU 2.0
    + */
    + virtual int32_t hashCode(void) const = 0;
    +
    + /**
    + * Returns a UClassID for this ForwardCharacterIterator ("poor man's
    + * RTTI").<P> Despite the fact that this function is public,
    + * DO NOT CONSIDER IT PART OF CHARACTERITERATOR'S API!
    + * @return a UClassID for this ForwardCharacterIterator
    + * @stable ICU 2.0
    + */
    + virtual UClassID getDynamicClassID(void) const = 0;
    +
    + /**
    + * Gets the current code unit for returning and advances to the next code unit
    + * in the iteration range
    + * (toward endIndex()). If there are
    + * no more code units to return, returns DONE.
    + * @return the current code unit.
    + * @stable ICU 2.0
    + */
    + virtual UChar nextPostInc(void) = 0;
    +
    + /**
    + * Gets the current code point for returning and advances to the next code point
    + * in the iteration range
    + * (toward endIndex()). If there are
    + * no more code points to return, returns DONE.
    + * @return the current code point.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 next32PostInc(void) = 0;
    +
    + /**
    + * Returns FALSE if there are no more code units or code points
    + * at or after the current position in the iteration range.
    + * This is used with nextPostInc() or next32PostInc() in forward
    + * iteration.
    + * @returns FALSE if there are no more code units or code points
    + * at or after the current position in the iteration range.
    + * @stable ICU 2.0
    + */
    + virtual UBool hasNext() = 0;
    +
    +protected:
    + /** Default constructor to be overridden in the implementing class. @stable ICU 2.0*/
    + ForwardCharacterIterator();
    +
    + /** Copy constructor to be overridden in the implementing class. @stable ICU 2.0*/
    + ForwardCharacterIterator(const ForwardCharacterIterator &other);
    +
    + /**
    + * Assignment operator to be overridden in the implementing class.
    + * @stable ICU 2.0
    + */
    + ForwardCharacterIterator &operator=(const ForwardCharacterIterator&) { return *this; }
    +};
    +
    +/**
    + * Abstract class that defines an API for iteration
    + * on text objects.
    + * This is an interface for forward and backward iteration
    + * and random access into a text object.
    + *
    + * <p>The API provides backward compatibility to the Java and older ICU
    + * CharacterIterator classes but extends them significantly:
    + * <ol>
    + * <li>CharacterIterator is now a subclass of ForwardCharacterIterator.</li>
    + * <li>While the old API functions provided forward iteration with
    + * "pre-increment" semantics, the new one also provides functions
    + * with "post-increment" semantics. They are more efficient and should
    + * be the preferred iterator functions for new implementations.
    + * The backward iteration always had "pre-decrement" semantics, which
    + * are efficient.</li>
    + * <li>Just like ForwardCharacterIterator, it provides access to
    + * both code units and code points. Code point access versions are available
    + * for the old and the new iteration semantics.</li>
    + * <li>There are new functions for setting and moving the current position
    + * without returning a character, for efficiency.</li>
    + * </ol>
    + *
    + * See ForwardCharacterIterator for examples for using the new forward iteration
    + * functions. For backward iteration, there is also a hasPrevious() function
    + * that can be used analogously to hasNext().
    + * The old functions work as before and are shown below.</p>
    + *
    + * <p>Examples for some of the new functions:</p>
    + *
    + * Forward iteration with hasNext():
    + * \code
    + * void forward1(CharacterIterator &it) {
    + * UChar32 c;
    + * for(it.setToStart(); it.hasNext();) {
    + * c=it.next32PostInc();
    + * // use c
    + * }
    + * }
    + * \endcode
    + * Forward iteration more similar to loops with the old forward iteration,
    + * showing a way to convert simple for() loops:
    + * \code
    + * void forward2(CharacterIterator &it) {
    + * UChar c;
    + * for(c=it.firstPostInc(); c!=CharacterIterator::DONE; c=it.nextPostInc()) {
    + * // use c
    + * }
    + * }
    + * \endcode
    + * Backward iteration with setToEnd() and hasPrevious():
    + * \code
    + * void backward1(CharacterIterator &it) {
    + * UChar32 c;
    + * for(it.setToEnd(); it.hasPrevious();) {
    + * c=it.previous32();
    + * // use c
    + * }
    + * }
    + * \endcode
    + * Backward iteration with a more traditional for() loop:
    + * \code
    + * void backward2(CharacterIterator &it) {
    + * UChar c;
    + * for(c=it.last(); c!=CharacterIterator::DONE; c=it.previous()) {
    + * // use c
    + * }
    + * }
    + * \endcode
    + *
    + * Example for random access:
    + * \code
    + * void random(CharacterIterator &it) {
    + * // set to the third code point from the beginning
    + * it.move32(3, CharacterIterator::kStart);
    + * // get a code point from here without moving the position
    + * UChar32 c=it.current32();
    + * // get the position
    + * int32_t pos=it.getIndex();
    + * // get the previous code unit
    + * UChar u=it.previous();
    + * // move back one more code unit
    + * it.move(-1, CharacterIterator::kCurrent);
    + * // set the position back to where it was
    + * // and read the same code point c and move beyond it
    + * it.setIndex(pos);
    + * if(c!=it.next32PostInc()) {
    + * exit(1); // CharacterIterator inconsistent
    + * }
    + * }
    + * \endcode
    + *
    + * <p>Examples, especially for the old API:</p>
    + *
    + * Function processing characters, in this example simple output
    + * <pre>
    + * \code
    + * void processChar( UChar c )
    + * {
    + * cout << " " << c;
    + * }
    + * \endcode
    + * </pre>
    + * Traverse the text from start to finish
    + * <pre>
    + * \code
    + * void traverseForward(CharacterIterator& iter)
    + * {
    + * for(UChar c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
    + * processChar(c);
    + * }
    + * }
    + * \endcode
    + * </pre>
    + * Traverse the text backwards, from end to start
    + * <pre>
    + * \code
    + * void traverseBackward(CharacterIterator& iter)
    + * {
    + * for(UChar c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
    + * processChar(c);
    + * }
    + * }
    + * \endcode
    + * </pre>
    + * Traverse both forward and backward from a given position in the text.
    + * Calls to notBoundary() in this example represents some additional stopping criteria.
    + * <pre>
    + * \code
    + * void traverseOut(CharacterIterator& iter, int32_t pos)
    + * {
    + * UChar c;
    + * for (c = iter.setIndex(pos);
    + * c != CharacterIterator.DONE && (Unicode::isLetter(c) || Unicode::isDigit(c));
    + * c = iter.next()) {}
    + * int32_t end = iter.getIndex();
    + * for (c = iter.setIndex(pos);
    + * c != CharacterIterator.DONE && (Unicode::isLetter(c) || Unicode::isDigit(c));
    + * c = iter.previous()) {}
    + * int32_t start = iter.getIndex() + 1;
    + *
    + * cout << "start: " << start << " end: " << end << endl;
    + * for (c = iter.setIndex(start); iter.getIndex() < end; c = iter.next() ) {
    + * processChar(c);
    + * }
    + * }
    + * \endcode
    + * </pre>
    + * Creating a StringCharacterIterator and calling the test functions
    + * <pre>
    + * \code
    + * void CharacterIterator_Example( void )
    + * {
    + * cout << endl << "===== CharacterIterator_Example: =====" << endl;
    + * UnicodeString text("Ein kleiner Satz.");
    + * StringCharacterIterator iterator(text);
    + * cout << "----- traverseForward: -----------" << endl;
    + * traverseForward( iterator );
    + * cout << endl << endl << "----- traverseBackward: ----------" << endl;
    + * traverseBackward( iterator );
    + * cout << endl << endl << "----- traverseOut: ---------------" << endl;
    + * traverseOut( iterator, 7 );
    + * cout << endl << endl << "-----" << endl;
    + * }
    + * \endcode
    + * </pre>
    + *
    + * @stable ICU 2.0
    + */
    +class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
    +public:
    + /**
    + * Origin enumeration for the move() and move32() functions.
    + * @stable ICU 2.0
    + */
    + enum EOrigin { kStart, kCurrent, kEnd };
    +
    + /**
    + * Returns a pointer to a new CharacterIterator of the same
    + * concrete class as this one, and referring to the same
    + * character in the same text-storage object as this one. The
    + * caller is responsible for deleting the new clone.
    + * @return a pointer to a new CharacterIterator
    + * @stable ICU 2.0
    + */
    + virtual CharacterIterator* clone(void) const = 0;
    +
    + /**
    + * Sets the iterator to refer to the first code unit in its
    + * iteration range, and returns that code unit.
    + * This can be used to begin an iteration with next().
    + * @return the first code unit in its iteration range.
    + * @stable ICU 2.0
    + */
    + virtual UChar first(void) = 0;
    +
    + /**
    + * Sets the iterator to refer to the first code unit in its
    + * iteration range, returns that code unit, and moves the position
    + * to the second code unit. This is an alternative to setToStart()
    + * for forward iteration with nextPostInc().
    + * @return the first code unit in its iteration range.
    + * @stable ICU 2.0
    + */
    + virtual UChar firstPostInc(void);
    +
    + /**
    + * Sets the iterator to refer to the first code point in its
    + * iteration range, and returns that code unit,
    + * This can be used to begin an iteration with next32().
    + * Note that an iteration with next32PostInc(), beginning with,
    + * e.g., setToStart() or firstPostInc(), is more efficient.
    + * @return the first code point in its iteration range.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 first32(void) = 0;
    +
    + /**
    + * Sets the iterator to refer to the first code point in its
    + * iteration range, returns that code point, and moves the position
    + * to the second code point. This is an alternative to setToStart()
    + * for forward iteration with next32PostInc().
    + * @return the first code point in its iteration range.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 first32PostInc(void);
    +
    + /**
    + * Sets the iterator to refer to the first code unit or code point in its
    + * iteration range. This can be used to begin a forward
    + * iteration with nextPostInc() or next32PostInc().
    + * @return the start position of the iteration range
    + * @stable ICU 2.0
    + */
    + inline int32_t setToStart();
    +
    + /**
    + * Sets the iterator to refer to the last code unit in its
    + * iteration range, and returns that code unit.
    + * This can be used to begin an iteration with previous().
    + * @return the last code unit.
    + * @stable ICU 2.0
    + */
    + virtual UChar last(void) = 0;
    +
    + /**
    + * Sets the iterator to refer to the last code point in its
    + * iteration range, and returns that code unit.
    + * This can be used to begin an iteration with previous32().
    + * @return the last code point.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 last32(void) = 0;
    +
    + /**
    + * Sets the iterator to the end of its iteration range, just behind
    + * the last code unit or code point. This can be used to begin a backward
    + * iteration with previous() or previous32().
    + * @return the end position of the iteration range
    + * @stable ICU 2.0
    + */
    + inline int32_t setToEnd();
    +
    + /**
    + * Sets the iterator to refer to the "position"-th code unit
    + * in the text-storage object the iterator refers to, and
    + * returns that code unit.
    + * @param position the "position"-th code unit in the text-storage object
    + * @return the "position"-th code unit.
    + * @stable ICU 2.0
    + */
    + virtual UChar setIndex(int32_t position) = 0;
    +
    + /**
    + * Sets the iterator to refer to the beginning of the code point
    + * that contains the "position"-th code unit
    + * in the text-storage object the iterator refers to, and
    + * returns that code point.
    + * The current position is adjusted to the beginning of the code point
    + * (its first code unit).
    + * @param position the "position"-th code unit in the text-storage object
    + * @return the "position"-th code point.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 setIndex32(int32_t position) = 0;
    +
    + /**
    + * Returns the code unit the iterator currently refers to.
    + * @return the current code unit.
    + * @stable ICU 2.0
    + */
    + virtual UChar current(void) const = 0;
    +
    + /**
    + * Returns the code point the iterator currently refers to.
    + * @return the current code point.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 current32(void) const = 0;
    +
    + /**
    + * Advances to the next code unit in the iteration range
    + * (toward endIndex()), and returns that code unit. If there are
    + * no more code units to return, returns DONE.
    + * @return the next code unit.
    + * @stable ICU 2.0
    + */
    + virtual UChar next(void) = 0;
    +
    + /**
    + * Advances to the next code point in the iteration range
    + * (toward endIndex()), and returns that code point. If there are
    + * no more code points to return, returns DONE.
    + * Note that iteration with "pre-increment" semantics is less
    + * efficient than iteration with "post-increment" semantics
    + * that is provided by next32PostInc().
    + * @return the next code point.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 next32(void) = 0;
    +
    + /**
    + * Advances to the previous code unit in the iteration range
    + * (toward startIndex()), and returns that code unit. If there are
    + * no more code units to return, returns DONE.
    + * @return the previous code unit.
    + * @stable ICU 2.0
    + */
    + virtual UChar previous(void) = 0;
    +
    + /**
    + * Advances to the previous code point in the iteration range
    + * (toward startIndex()), and returns that code point. If there are
    + * no more code points to return, returns DONE.
    + * @return the previous code point.
    + * @stable ICU 2.0
    + */
    + virtual UChar32 previous32(void) = 0;
    +
    + /**
    + * Returns FALSE if there are no more code units or code points
    + * before the current position in the iteration range.
    + * This is used with previous() or previous32() in backward
    + * iteration.
    + * @return FALSE if there are no more code units or code points
    + * before the current position in the iteration range, return TRUE otherwise.
    + * @stable ICU 2.0
    + */
    + virtual UBool hasPrevious() = 0;
    +
    + /**
    + * Returns the numeric index in the underlying text-storage
    + * object of the character returned by first(). Since it's
    + * possible to create an iterator that iterates across only
    + * part of a text-storage object, this number isn't
    + * necessarily 0.
    + * @returns the numeric index in the underlying text-storage
    + * object of the character returned by first().
    + * @stable ICU 2.0
    + */
    + inline int32_t startIndex(void) const;
    +
    + /**
    + * Returns the numeric index in the underlying text-storage
    + * object of the position immediately BEYOND the character
    + * returned by last().
    + * @return the numeric index in the underlying text-storage
    + * object of the position immediately BEYOND the character
    + * returned by last().
    + * @stable ICU 2.0
    + */
    + inline int32_t endIndex(void) const;
    +
    + /**
    + * Returns the numeric index in the underlying text-storage
    + * object of the character the iterator currently refers to
    + * (i.e., the character returned by current()).
    + * @return the numberic index in the text-storage object of
    + * the character the iterator currently refers to
    + * @stable ICU 2.0
    + */
    + inline int32_t getIndex(void) const;
    +
    + /**
    + * Returns the length of the entire text in the underlying
    + * text-storage object.
    + * @return the length of the entire text in the text-storage object
    + * @stable ICU 2.0
    + */
    + inline int32_t getLength() const;
    +
    + /**
    + * Moves the current position relative to the start or end of the
    + * iteration range, or relative to the current position itself.
    + * The movement is expressed in numbers of code units forward
    + * or backward by specifying a positive or negative delta.
    + * @param delta the position relative to origin. A positive delta means forward;
    + * a negative delta means backward.
    + * @param origin Origin enumeration {kStart, kCurrent, kEnd}
    + * @return the new position
    + * @stable ICU 2.0
    + */
    + virtual int32_t move(int32_t delta, EOrigin origin) = 0;
    +
    + /**
    + * Moves the current position relative to the start or end of the
    + * iteration range, or relative to the current position itself.
    + * The movement is expressed in numbers of code points forward
    + * or backward by specifying a positive or negative delta.
    + * @param delta the position relative to origin. A positive delta means forward;
    + * a negative delta means backward.
    + * @param origin Origin enumeration {kStart, kCurrent, kEnd}
    + * @return the new position
    + * @stable ICU 2.0
    + */
    + virtual int32_t move32(int32_t delta, EOrigin origin) = 0;
    +
    + /**
    + * Copies the text under iteration into the UnicodeString
    + * referred to by "result".
    + * @param result Receives a copy of the text under iteration.
    + * @stable ICU 2.0
    + */
    + virtual void getText(UnicodeString& result) = 0;
    +
    +protected:
    + /**
    + * Empty constructor.
    + * @stable ICU 2.0
    + */
    + CharacterIterator();
    +
    + /**
    + * Constructor, just setting the length field in this base class.
    + * @stable ICU 2.0
    + */
    + CharacterIterator(int32_t length);
    +
    + /**
    + * Constructor, just setting the length and position fields in this base class.
    + * @stable ICU 2.0
    + */
    + CharacterIterator(int32_t length, int32_t position);
    +
    + /**
    + * Constructor, just setting the length, start, end, and position fields in this base class.
    + * @stable ICU 2.0
    + */
    + CharacterIterator(int32_t length, int32_t textBegin, int32_t textEnd, int32_t position);
    +
    + /**
    + * Copy constructor.
    + *
    + * @param that The CharacterIterator to be copied
    + * @stable ICU 2.0
    + */
    + CharacterIterator(const CharacterIterator &that);
    +
    + /**
    + * Assignment operator. Sets this CharacterIterator to have the same behavior,
    + * as the one passed in.
    + * @param that The CharacterIterator passed in.
    + * @return the newly set CharacterIterator.
    + * @stable ICU 2.0
    + */
    + CharacterIterator &operator=(const CharacterIterator &that);
    +
    + /**
    + * Base class text length field.
    + * Necessary this for correct getText() and hashCode().
    + * @stable ICU 2.0
    + */
    + int32_t textLength;
    +
    + /**
    + * Base class field for the current position.
    + * @stable ICU 2.0
    + */
    + int32_t pos;
    +
    + /**
    + * Base class field for the start of the iteration range.
    + * @stable ICU 2.0
    + */
    + int32_t begin;
    +
    + /**
    + * Base class field for the end of the iteration range.
    + * @stable ICU 2.0
    + */
    + int32_t end;
    +};
    +
    +inline UBool
    +ForwardCharacterIterator::operator!=(const ForwardCharacterIterator& that) const {
    + return !operator==(that);
    +}
    +
    +inline int32_t
    +CharacterIterator::setToStart() {
    + return move(0, kStart);
    +}
    +
    +inline int32_t
    +CharacterIterator::setToEnd() {
    + return move(0, kEnd);
    +}
    +
    +inline int32_t
    +CharacterIterator::startIndex(void) const {
    + return begin;
    +}
    +
    +inline int32_t
    +CharacterIterator::endIndex(void) const {
    + return end;
    +}
    +
    +inline int32_t
    +CharacterIterator::getIndex(void) const {
    + return pos;
    +}
    +
    +inline int32_t
    +CharacterIterator::getLength(void) const {
    + return textLength;
    +}
    +
    +U_NAMESPACE_END
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/choicfmt.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/choicfmt.h b/platform/osx/icu/unicode/choicfmt.h
    new file mode 100644
    index 0000000..8484648
    --- /dev/null
    +++ b/platform/osx/icu/unicode/choicfmt.h
    @@ -0,0 +1,746 @@
    +/*
    +********************************************************************************
    +* Copyright (C) 1997-2008, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +********************************************************************************
    +*
    +* File CHOICFMT.H
    +*
    +* Modification History:
    +*
    +* Date Name Description
    +* 02/19/97 aliu Converted from java.
    +* 03/20/97 helena Finished first cut of implementation and got rid
    +* of nextDouble/previousDouble and replaced with
    +* boolean array.
    +* 4/10/97 aliu Clean up. Modified to work on AIX.
    +* 8/6/97 nos Removed overloaded constructor, member var 'buffer'.
    +* 07/22/98 stephen Removed operator!= (implemented in Format)
    +********************************************************************************
    +*/
    +
    +#ifndef CHOICFMT_H
    +#define CHOICFMT_H
    +
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Choice Format.
    + */
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/unistr.h"
    +#include "unicode/numfmt.h"
    +#include "unicode/fieldpos.h"
    +#include "unicode/format.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +class MessageFormat;
    +
    +/**
    + * ChoiceFormat converts between ranges of numeric values
    + * and string names for those ranges. A <code>ChoiceFormat</code> splits
    + * the real number line <code>-Inf</code> to <code>+Inf</code> into two
    + * or more contiguous ranges. Each range is mapped to a
    + * string. <code>ChoiceFormat</code> is generally used in a
    + * <code>MessageFormat</code> for displaying grammatically correct
    + * plurals such as &quot;There are 2 files.&quot;</p>
    + *
    + * <p>There are two methods of defining a <code>ChoiceFormat</code>; both
    + * are equivalent. The first is by using a string pattern. This is the
    + * preferred method in most cases. The second method is through direct
    + * specification of the arrays that make up the
    + * <code>ChoiceFormat</code>.</p>
    + *
    + * <p><strong>Patterns</strong></p>
    + *
    + * <p>In most cases, the preferred way to define a
    + * <code>ChoiceFormat</code> is with a pattern. Here is an example of a
    + * <code>ChoiceFormat</code> pattern:</p>
    + *
    + * \htmlonly<pre> 0&#x2264;are no files|1&#x2264;is one file|1&lt;are many files</pre>\endhtmlonly
    + *
    + * <p>or equivalently,</p>
    + *
    + * \htmlonly<pre> 0#are no files|1#is one file|1&lt;are many files</pre>\endhtmlonly
    + *
    + * <p>The pattern consists of a number or <em>range specifiers</em>
    + * separated by vertical bars '|' (U+007C). There is no
    + * vertical bar after the last range. Each range specifier is of the
    + * form:</p>
    + *
    + * \htmlonly<blockquote><em>Number Separator String</em></blockquote>\endhtmlonly
    + *
    + * <p><em>Number</em> is a floating point number that can be parsed by a
    + * default <code>NumberFormat</code> for the US locale. It gives the
    + * lower limit of this range. The lower limit is either inclusive or
    + * exclusive, depending on the <em>separator</em>. The upper limit is
    + * given by the lower limit of the next range. The Unicode infinity
    + * sign \htmlonly&#x221E \endhtmlonly (U+221E) is recognized for positive infinity. It may be preceded by
    + * '-' (U+002D) to indicate negative infinity.</p>
    + *
    + * <p><em>String</em> is the format string for this range, with special
    + * characters enclosed in single quotes (<code>'The #
    + * sign'</code>). Single quotes themselves are indicated by two single
    + * quotes in a row (<code>'o''clock'</code>).</p>
    + *
    + * <p><em>Separator</em> is one of the following single characters:
    + *
    + * <ul>
    + * <li>\htmlonly'&#x2264;' \endhtmlonly (U+2264) or '#' (U+0023)
    + * indicates that the lower limit given by <em>Number</em> is
    + * inclusive. (The two characters are equivalent to ChoiceFormat.)
    + * This means that the limit value <em>Number</em> belongs to this
    + * range. Another way of saying this is that the corresponding
    + * closure is <code>FALSE</code>.</li>
    + *
    + * <li>'<' (U+003C) indicates that the lower limit given by
    + * <em>Number</em> is exclusive. This means that the value
    + * <em>Number</em> belongs to the prior range.</li> Another way of
    + * saying this is that the corresponding closure is
    + * <code>TRUE</code>.
    + * </ul>
    + *
    + * <p>See below for more information about closures.</p>
    + *
    + * <p><strong>Arrays</strong></p>
    + *
    + * <p>A <code>ChoiceFormat</code> defining <code>n</code> intervals
    + * (<code>n</code> &gt;= 2) is specified by three arrays of
    + * <code>n</code> items:
    + *
    + * <ul>
    + * <li><code>double limits[]</code> gives the start of each
    + * interval. This must be a non-decreasing list of values, none of
    + * which may be <code>NaN</code>.</li>
    + * <li><code>UBool closures[]</code> determines whether each limit
    + * value is contained in the interval below it or in the interval
    + * above it. If <code>closures[i]</code> is <code>FALSE</code>, then
    + * <code>limits[i]</code> is a member of interval
    + * <code>i</code>. Otherwise it is a member of interval
    + * <code>i+1</code>. If no closures array is specified, this is
    + * equivalent to having all closures be <code>FALSE</code>. Closures
    + * allow one to specify half-open, open, or closed intervals.</li>
    + * <li><code>UnicodeString formats[]</code> gives the string label
    + * associated with each interval.</li>
    + * </ul>
    + *
    + * <p><strong>Formatting and Parsing</strong></p>
    + *
    + * <p>During formatting, a number is converted to a
    + * string. <code>ChoiceFormat</code> accomplishes this by mapping the
    + * number to an interval using the following rule. Given a number
    + * <code>X</code> and and index value <code>j</code> in the range
    + * <code>0..n-1</code>, where <code>n</code> is the number of ranges:</p>
    + *
    + * \htmlonly<blockquote>\endhtmlonly<code>X</code> matches <code>j</code> if and only if
    + * <code>limit[j] &lt;= X &lt; limit[j+1]</code>
    + * \htmlonly</blockquote>\endhtmlonly
    + *
    + * <p>(This assumes that all closures are <code>FALSE</code>. If some
    + * closures are <code>TRUE</code> then the relations must be changed to
    + * <code>&lt;=</code> or <code>&lt;</code> as appropriate.) If there is
    + * no match, then either the first or last index is used, depending on
    + * whether the number is too low or too high. Once a number is mapped to
    + * an interval <code>j</code>, the string <code>formats[j]</code> is
    + * output.</p>
    + *
    + * <p>During parsing, a string is converted to a
    + * number. <code>ChoiceFormat</code> finds the element
    + * <code>formats[j]</code> equal to the string, and returns
    + * <code>limits[j]</code> as the parsed value.</p>
    + *
    + * <p><strong>Notes</strong></p>
    + *
    + * <p>The first limit value does not define a range boundary. For
    + * example, in the pattern \htmlonly&quot;<code>1.0#a|2.0#b</code>&quot;\endhtmlonly, the
    + * intervals are [-Inf, 2.0) and [2.0, +Inf]. It appears that the first
    + * interval should be [1.0, 2.0). However, since all values that are too
    + * small are mapped to range zero, the first interval is effectively
    + * [-Inf, 2.0). However, the first limit value <em>is</em> used during
    + * formatting. In this example, <code>parse(&quot;a&quot;)</code> returns
    + * 1.0.</p>
    + *
    + * <p>There are no gaps between intervals and the entire number line is
    + * covered. A <code>ChoiceFormat</code> maps <em>all</em> possible
    + * double values to a finite set of intervals.</p>
    + *
    + * <p>The non-number <code>NaN</code> is mapped to interval zero during
    + * formatting.</p>
    + *
    + * <p><strong>Examples</strong></p>
    + *
    + * <p>Here is an example of two arrays that map the number
    + * <code>1..7</code> to the English day of the week abbreviations
    + * <code>Sun..Sat</code>. No closures array is given; this is the same as
    + * specifying all closures to be <code>FALSE</code>.</p>
    + *
    + * <pre> {1,2,3,4,5,6,7},
    + * {&quot;Sun&quot;,&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thur&quot;,&quot;Fri&quot;,&quot;Sat&quot;}</pre>
    + *
    + * <p>Here is an example that maps the ranges [-Inf, 1), [1, 1], and (1,
    + * +Inf] to three strings. That is, the number line is split into three
    + * ranges: x &lt; 1.0, x = 1.0, and x &gt; 1.0.</p>
    + *
    + * <pre> {0, 1, 1},
    + * {FALSE, FALSE, TRUE},
    + * {&quot;no files&quot;, &quot;one file&quot;, &quot;many files&quot;}</pre>
    + *
    + * <p>Here is a simple example that shows formatting and parsing: </p>
    + *
    + * \code
    + * #include <unicode/choicfmt.h>
    + * #include <unicode/unistr.h>
    + * #include <iostream.h>
    + *
    + * int main(int argc, char *argv[]) {
    + * double limits[] = {1,2,3,4,5,6,7};
    + * UnicodeString monthNames[] = {
    + * "Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
    + * ChoiceFormat fmt(limits, monthNames, 7);
    + * UnicodeString str;
    + * char buf[256];
    + * for (double x = 1.0; x <= 8.0; x += 1.0) {
    + * fmt.format(x, str);
    + * str.extract(0, str.length(), buf, 256, "");
    + * str.truncate(0);
    + * cout << x << " -> "
    + * << buf << endl;
    + * }
    + * cout << endl;
    + * return 0;
    + * }
    + * \endcode
    + *
    + * <p>Here is a more complex example using a <code>ChoiceFormat</code>
    + * constructed from a pattern together with a
    + * <code>MessageFormat</code>.</p>
    + *
    + * \code
    + * #include <unicode/choicfmt.h>
    + * #include <unicode/msgfmt.h>
    + * #include <unicode/unistr.h>
    + * #include <iostream.h>
    + *
    + * int main(int argc, char *argv[]) {
    + * UErrorCode status = U_ZERO_ERROR;
    + * double filelimits[] = {0,1,2};
    + * UnicodeString filepart[] =
    + * {"are no files","is one file","are {0} files"};
    + * ChoiceFormat* fileform = new ChoiceFormat(filelimits, filepart, 3 );
    + * Format* testFormats[] =
    + * {fileform, NULL, NumberFormat::createInstance(status)};
    + * MessageFormat pattform("There {0} on {1}", status );
    + * pattform.adoptFormats(testFormats, 3);
    + * Formattable testArgs[] = {0L, "Disk A"};
    + * FieldPosition fp(0);
    + * UnicodeString str;
    + * char buf[256];
    + * for (int32_t i = 0; i < 4; ++i) {
    + * Formattable fInt(i);
    + * testArgs[0] = fInt;
    + * pattform.format(testArgs, 2, str, fp, status );
    + * str.extract(0, str.length(), buf, "");
    + * str.truncate(0);
    + * cout << "Output for i=" << i << " : " << buf << endl;
    + * }
    + * cout << endl;
    + * return 0;
    + * }
    + * \endcode
    + *
    + * <p><em>User subclasses are not supported.</em> While clients may write
    + * subclasses, such code will not necessarily work and will not be
    + * guaranteed to work stably from release to release.
    + */
    +class U_I18N_API ChoiceFormat: public NumberFormat {
    +public:
    + /**
    + * Construct a new ChoiceFormat with the limits and the corresponding formats
    + * based on the pattern.
    + *
    + * @param pattern Pattern used to construct object.
    + * @param status Output param to receive success code. If the
    + * pattern cannot be parsed, set to failure code.
    + * @stable ICU 2.0
    + */
    + ChoiceFormat(const UnicodeString& pattern,
    + UErrorCode& status);
    +
    +
    + /**
    + * Construct a new ChoiceFormat with the given limits and formats. Copy
    + * the limits and formats instead of adopting them.
    + *
    + * @param limits Array of limit values.
    + * @param formats Array of formats.
    + * @param count Size of 'limits' and 'formats' arrays.
    + * @stable ICU 2.0
    + */
    +
    + ChoiceFormat(const double* limits,
    + const UnicodeString* formats,
    + int32_t count );
    +
    + /**
    + * Construct a new ChoiceFormat with the given limits and formats.
    + * Copy the limits and formats (instead of adopting them). By
    + * default, each limit in the array specifies the inclusive lower
    + * bound of its range, and the exclusive upper bound of the previous
    + * range. However, if the isLimitOpen element corresponding to a
    + * limit is TRUE, then the limit is the exclusive lower bound of its
    + * range, and the inclusive upper bound of the previous range.
    + * @param limits Array of limit values
    + * @param closures Array of booleans specifying whether each
    + * element of 'limits' is open or closed. If FALSE, then the
    + * corresponding limit is a member of the range above it. If TRUE,
    + * then the limit belongs to the range below it.
    + * @param formats Array of formats
    + * @param count Size of 'limits', 'closures', and 'formats' arrays
    + * @stable ICU 2.4
    + */
    + ChoiceFormat(const double* limits,
    + const UBool* closures,
    + const UnicodeString* formats,
    + int32_t count);
    +
    + /**
    + * Copy constructor.
    + *
    + * @param that ChoiceFormat object to be copied from
    + * @stable ICU 2.0
    + */
    + ChoiceFormat(const ChoiceFormat& that);
    +
    + /**
    + * Assignment operator.
    + *
    + * @param that ChoiceFormat object to be copied
    + * @stable ICU 2.0
    + */
    + const ChoiceFormat& operator=(const ChoiceFormat& that);
    +
    + /**
    + * Destructor.
    + * @stable ICU 2.0
    + */
    + virtual ~ChoiceFormat();
    +
    + /**
    + * Clone this Format object polymorphically. The caller owns the
    + * result and should delete it when done.
    + *
    + * @return a copy of this object
    + * @stable ICU 2.0
    + */
    + virtual Format* clone(void) const;
    +
    + /**
    + * Return true if the given Format objects are semantically equal.
    + * Objects of different subclasses are considered unequal.
    + *
    + * @param other ChoiceFormat object to be compared
    + * @return true if other is the same as this.
    + * @stable ICU 2.0
    + */
    + virtual UBool operator==(const Format& other) const;
    +
    + /**
    + * Sets the pattern.
    + * @param pattern The pattern to be applied.
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + * @stable ICU 2.0
    + */
    + virtual void applyPattern(const UnicodeString& pattern,
    + UErrorCode& status);
    +
    + /**
    + * Sets the pattern.
    + * @param pattern The pattern to be applied.
    + * @param parseError Struct to recieve information on position
    + * of error if an error is encountered
    + * @param status Output param set to success/failure code on
    + * exit. If the pattern is invalid, this will be
    + * set to a failure result.
    + * @stable ICU 2.0
    + */
    + virtual void applyPattern(const UnicodeString& pattern,
    + UParseError& parseError,
    + UErrorCode& status);
    + /**
    + * Gets the pattern.
    + *
    + * @param pattern Output param which will recieve the pattern
    + * Previous contents are deleted.
    + * @return A reference to 'pattern'
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& toPattern(UnicodeString &pattern) const;
    +
    + /**
    + * Set the choices to be used in formatting.
    + *
    + * @param limitsToCopy Contains the top value that you want
    + * parsed with that format,and should be in
    + * ascending sorted order. When formatting X,
    + * the choice will be the i, where limit[i]
    + * &lt;= X &lt; limit[i+1].
    + * @param formatsToCopy The format strings you want to use for each limit.
    + * @param count The size of the above arrays.
    + * @stable ICU 2.0
    + */
    + virtual void setChoices(const double* limitsToCopy,
    + const UnicodeString* formatsToCopy,
    + int32_t count );
    +
    + /**
    + * Set the choices to be used in formatting. See class description
    + * for documenatation of the limits, closures, and formats arrays.
    + * @param limits Array of limits
    + * @param closures Array of limit booleans
    + * @param formats Array of format string
    + * @param count The size of the above arrays
    + * @stable ICU 2.4
    + */
    + virtual void setChoices(const double* limits,
    + const UBool* closures,
    + const UnicodeString* formats,
    + int32_t count);
    +
    + /**
    + * Get the limits passed in the constructor.
    + *
    + * @param count The size of the limits arrays
    + * @return the limits.
    + * @stable ICU 2.0
    + */
    + virtual const double* getLimits(int32_t& count) const;
    +
    + /**
    + * Get the limit booleans passed in the constructor. The caller
    + * must not delete the result.
    + *
    + * @param count The size of the arrays
    + * @return the closures
    + * @stable ICU 2.4
    + */
    + virtual const UBool* getClosures(int32_t& count) const;
    +
    + /**
    + * Get the formats passed in the constructor.
    + *
    + * @param count The size of the arrays
    + * @return the formats.
    + * @stable ICU 2.0
    + */
    + virtual const UnicodeString* getFormats(int32_t& count) const;
    +
    + /**
    + * Format a double or long number using this object's choices.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(double number,
    + UnicodeString& appendTo,
    + FieldPosition& pos) const;
    + /**
    + * Format a int_32t number using this object's choices.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(int32_t number,
    + UnicodeString& appendTo,
    + FieldPosition& pos) const;
    +
    + /**
    + * Format an int64_t number using this object's choices.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.8
    + */
    + virtual UnicodeString& format(int64_t number,
    + UnicodeString& appendTo,
    + FieldPosition& pos) const;
    +
    + /**
    + * Format an array of objects using this object's choices.
    + *
    + * @param objs The array of objects to be formatted.
    + * @param cnt The size of objs.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param success Output param set to success/failure code on
    + * exit.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(const Formattable* objs,
    + int32_t cnt,
    + UnicodeString& appendTo,
    + FieldPosition& pos,
    + UErrorCode& success) const;
    + /**
    + * Format an object using this object's choices.
    + *
    + *
    + * @param obj The object to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param pos On input: an alignment field, if desired.
    + * On output: the offsets of the alignment field.
    + * @param status Output param set to success/failure code on
    + * exit.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(const Formattable& obj,
    + UnicodeString& appendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + *
    + * @param obj The object to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @param status Output param set to success/failure code on
    + * exit.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(const Formattable& obj,
    + UnicodeString& appendTo,
    + UErrorCode& status) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * Format a double number. These methods call the NumberFormat
    + * pure virtual format() methods with the default FieldPosition.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format( double number,
    + UnicodeString& appendTo) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * Format a long number. These methods call the NumberFormat
    + * pure virtual format() methods with the default FieldPosition.
    + *
    + * @param number The value to be formatted.
    + * @param appendTo Output parameter to receive result.
    + * Result is appended to existing contents.
    + * @return Reference to 'appendTo' parameter.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format( int32_t number,
    + UnicodeString& appendTo) const;
    +
    + /**
    + * Return a long if possible (e.g. within range LONG_MAX,
    + * LONG_MAX], and with no decimals), otherwise a double. If
    + * IntegerOnly is set, will stop at a decimal point (or equivalent;
    + * e.g. for rational numbers "1 2/3", will stop after the 1).
    + * <P>
    + * If no object can be parsed, parsePosition is unchanged, and NULL is
    + * returned.
    + *
    + * @param text The text to be parsed.
    + * @param result Formattable to be set to the parse result.
    + * If parse fails, return contents are undefined.
    + * @param parsePosition The position to start parsing at on input.
    + * On output, moved to after the last successfully
    + * parse character. On parse failure, does not change.
    + * @see NumberFormat::isParseIntegerOnly
    + * @stable ICU 2.0
    + */
    + virtual void parse(const UnicodeString& text,
    + Formattable& result,
    + ParsePosition& parsePosition) const;
    +
    + /**
    + * Return a long if possible (e.g. within range LONG_MAX,
    + * LONG_MAX], and with no decimals), otherwise a double. If
    + * IntegerOnly is set, will stop at a decimal point (or equivalent;
    + * e.g. for rational numbers "1 2/3", will stop after the 1).
    + * <P>
    + * If no object can be parsed, parsePosition is unchanged, and NULL is
    + * returned.
    + *
    + * @param text The text to be parsed.
    + * @param result Formattable to be set to the parse result.
    + * If parse fails, return contents are undefined.
    + * @param status Output param with the formatted string.
    + * @see NumberFormat::isParseIntegerOnly
    + * @stable ICU 2.0
    + */
    + virtual void parse(const UnicodeString& text,
    + Formattable& result,
    + UErrorCode& status) const;
    +
    +
    +public:
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
    + * This method is to implement a simple version of RTTI, since not all
    + * C++ compilers support genuine RTTI. Polymorphic operator==() and
    + * clone() methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 2.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +
    + /**
    + * Return the class ID for this class. This is useful only for
    + * comparing to a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . Derived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 2.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    +private:
    + // static cache management (thread-safe)
    + // static NumberFormat* getNumberFormat(UErrorCode &status); // call this function to 'check out' a numberformat from the cache.
    + // static void releaseNumberFormat(NumberFormat *adopt); // call this function to 'return' the number format to the cache.
    +
    + /**
    + * Converts a string to a double value using a default NumberFormat object
    + * which is static (shared by all ChoiceFormat instances).
    + * @param string the string to be converted with.
    + * @return the converted double number.
    + */
    + static double stod(const UnicodeString& string);
    +
    + /**
    + * Converts a double value to a string using a default NumberFormat object
    + * which is static (shared by all ChoiceFormat instances).
    + * @param value the double number to be converted with.
    + * @param string the result string.
    + * @return the converted string.
    + */
    + static UnicodeString& dtos(double value, UnicodeString& string);
    +
    + ChoiceFormat(); // default constructor not implemented
    +
    + /**
    + * Construct a new ChoiceFormat with the limits and the corresponding formats
    + * based on the pattern.
    + *
    + * @param newPattern Pattern used to construct object.
    + * @param parseError Struct to recieve information on position
    + * of error if an error is encountered.
    + * @param status Output param to receive success code. If the
    + * pattern cannot be parsed, set to failure code.
    + * @stable ICU 2.0
    + */
    + ChoiceFormat(const UnicodeString& newPattern,
    + UParseError& parseError,
    + UErrorCode& status);
    +
    + friend class MessageFormat;
    + /**
    + * Each ChoiceFormat divides the range -Inf..+Inf into fCount
    + * intervals. The intervals are:
    + *
    + * 0: fChoiceLimits[0]..fChoiceLimits[1]
    + * 1: fChoiceLimits[1]..fChoiceLimits[2]
    + * ...
    + * fCount-2: fChoiceLimits[fCount-2]..fChoiceLimits[fCount-1]
    + * fCount-1: fChoiceLimits[fCount-1]..+Inf
    + *
    + * Interval 0 is special; during formatting (mapping numbers to
    + * strings), it also contains all numbers less than
    + * fChoiceLimits[0], as well as NaN values.
    + *
    + * Interval i maps to and from string fChoiceFormats[i]. When
    + * parsing (mapping strings to numbers), then intervals map to
    + * their lower limit, that is, interval i maps to fChoiceLimit[i].
    + *
    + * The intervals may be closed, half open, or open. This affects
    + * formatting but does not affect parsing. Interval i is affected
    + * by fClosures[i] and fClosures[i+1]. If fClosures[i]
    + * is FALSE, then the value fChoiceLimits[i] is in interval i.
    + * That is, intervals i and i are:
    + *
    + * i-1: ... x < fChoiceLimits[i]
    + * i: fChoiceLimits[i] <= x ...
    + *
    + * If fClosures[i] is TRUE, then the value fChoiceLimits[i] is
    + * in interval i-1. That is, intervals i-1 and i are:
    + *
    + * i-1: ... x <= fChoiceLimits[i]
    + * i: fChoiceLimits[i] < x ...
    + *
    + * Because of the nature of interval 0, fClosures[0] has no
    + * effect.
    +
    + */
    + double* fChoiceLimits;
    + UBool* fClosures;
    + UnicodeString* fChoiceFormats;
    + int32_t fCount;
    +};
    +
    +inline UnicodeString&
    +ChoiceFormat::format(const Formattable& obj,
    + UnicodeString& appendTo,
    + UErrorCode& status) const {
    + // Don't use Format:: - use immediate base class only,
    + // in case immediate base modifies behavior later.
    + return NumberFormat::format(obj, appendTo, status);
    +}
    +
    +inline UnicodeString&
    +ChoiceFormat::format(double number,
    + UnicodeString& appendTo) const {
    + return NumberFormat::format(number, appendTo);
    +}
    +
    +inline UnicodeString&
    +ChoiceFormat::format(int32_t number,
    + UnicodeString& appendTo) const {
    + return NumberFormat::format(number, appendTo);
    +}
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // _CHOICFMT
    +//eof

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/coleitr.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/coleitr.h b/platform/osx/icu/unicode/coleitr.h
    new file mode 100644
    index 0000000..4025a41
    --- /dev/null
    +++ b/platform/osx/icu/unicode/coleitr.h
    @@ -0,0 +1,400 @@
    +/*
    + ******************************************************************************
    + * Copyright (C) 1997-2008, International Business Machines
    + * Corporation and others. All Rights Reserved.
    + ******************************************************************************
    + */
    +
    +/**
    + * \file
    + * \brief C++ API: Collation Element Iterator.
    + */
    +
    +/**
    +* File coleitr.h
    +*
    +*
    +*
    +* Created by: Helena Shih
    +*
    +* Modification History:
    +*
    +* Date Name Description
    +*
    +* 8/18/97 helena Added internal API documentation.
    +* 08/03/98 erm Synched with 1.2 version CollationElementIterator.java
    +* 12/10/99 aliu Ported Thai collation support from Java.
    +* 01/25/01 swquek Modified into a C++ wrapper calling C APIs (ucoliter.h)
    +* 02/19/01 swquek Removed CollationElementsIterator() since it is
    +* private constructor and no calls are made to it
    +*/
    +
    +#ifndef COLEITR_H
    +#define COLEITR_H
    +
    +#include "unicode/utypes.h"
    +
    +
    +#if !UCONFIG_NO_COLLATION
    +
    +#include "unicode/uobject.h"
    +#include "unicode/tblcoll.h"
    +#include "unicode/ucoleitr.h"
    +
    +/**
    + * The UCollationElements struct.
    + * For usage in C programs.
    + * @stable ICU 2.0
    + */
    +typedef struct UCollationElements UCollationElements;
    +
    +U_NAMESPACE_BEGIN
    +
    +/**
    +* The CollationElementIterator class is used as an iterator to walk through
    +* each character of an international string. Use the iterator to return the
    +* ordering priority of the positioned character. The ordering priority of a
    +* character, which we refer to as a key, defines how a character is collated in
    +* the given collation object.
    +* For example, consider the following in Spanish:
    +* <pre>
    +* "ca" -> the first key is key('c') and second key is key('a').
    +* "cha" -> the first key is key('ch') and second key is key('a').</pre>
    +* And in German,
    +* <pre> \htmlonly "&#x00E6;b"-> the first key is key('a'), the second key is key('e'), and
    +* the third key is key('b'). \endhtmlonly </pre>
    +* The key of a character, is an integer composed of primary order(short),
    +* secondary order(char), and tertiary order(char). Java strictly defines the
    +* size and signedness of its primitive data types. Therefore, the static
    +* functions primaryOrder(), secondaryOrder(), and tertiaryOrder() return
    +* int32_t to ensure the correctness of the key value.
    +* <p>Example of the iterator usage: (without error checking)
    +* <pre>
    +* \code
    +* void CollationElementIterator_Example()
    +* {
    +* UnicodeString str = "This is a test";
    +* UErrorCode success = U_ZERO_ERROR;
    +* RuleBasedCollator* rbc =
    +* (RuleBasedCollator*) RuleBasedCollator::createInstance(success);
    +* CollationElementIterator* c =
    +* rbc->createCollationElementIterator( str );
    +* int32_t order = c->next(success);
    +* c->reset();
    +* order = c->previous(success);
    +* delete c;
    +* delete rbc;
    +* }
    +* \endcode
    +* </pre>
    +* <p>
    +* CollationElementIterator::next returns the collation order of the next
    +* character based on the comparison level of the collator.
    +* CollationElementIterator::previous returns the collation order of the
    +* previous character based on the comparison level of the collator.
    +* The Collation Element Iterator moves only in one direction between calls to
    +* CollationElementIterator::reset. That is, CollationElementIterator::next()
    +* and CollationElementIterator::previous can not be inter-used. Whenever
    +* CollationElementIterator::previous is to be called after
    +* CollationElementIterator::next() or vice versa,
    +* CollationElementIterator::reset has to be called first to reset the status,
    +* shifting pointers to either the end or the start of the string. Hence at the
    +* next call of CollationElementIterator::previous or
    +* CollationElementIterator::next(), the first or last collation order will be
    +* returned.
    +* If a change of direction is done without a CollationElementIterator::reset(),
    +* the result is undefined.
    +* The result of a forward iterate (CollationElementIterator::next) and
    +* reversed result of the backward iterate (CollationElementIterator::previous)
    +* on the same string are equivalent, if collation orders with the value
    +* UCOL_IGNORABLE are ignored.
    +* Character based on the comparison level of the collator. A collation order
    +* consists of primary order, secondary order and tertiary order. The data
    +* type of the collation order is <strong>t_int32</strong>.
    +*
    +* Note, CollationElementIterator should not be subclassed.
    +* @see Collator
    +* @see RuleBasedCollator
    +* @version 1.8 Jan 16 2001
    +*/
    +class U_I18N_API CollationElementIterator : public UObject {
    +public:
    +
    + // CollationElementIterator public data member ------------------------------
    +
    + enum {
    + /**
    + * NULLORDER indicates that an error has occured while processing
    + * @stable ICU 2.0
    + */
    + NULLORDER = (int32_t)0xffffffff
    + };
    +
    + // CollationElementIterator public constructor/destructor -------------------
    +
    + /**
    + * Copy constructor.
    + *
    + * @param other the object to be copied from
    + * @stable ICU 2.0
    + */
    + CollationElementIterator(const CollationElementIterator& other);
    +
    + /**
    + * Destructor
    + * @stable ICU 2.0
    + */
    + virtual ~CollationElementIterator();
    +
    + // CollationElementIterator public methods ----------------------------------
    +
    + /**
    + * Returns true if "other" is the same as "this"
    + *
    + * @param other the object to be compared
    + * @return true if "other" is the same as "this"
    + * @stable ICU 2.0
    + */
    + UBool operator==(const CollationElementIterator& other) const;
    +
    + /**
    + * Returns true if "other" is not the same as "this".
    + *
    + * @param other the object to be compared
    + * @return true if "other" is not the same as "this"
    + * @stable ICU 2.0
    + */
    + UBool operator!=(const CollationElementIterator& other) const;
    +
    + /**
    + * Resets the cursor to the beginning of the string.
    + * @stable ICU 2.0
    + */
    + void reset(void);
    +
    + /**
    + * Gets the ordering priority of the next character in the string.
    + * @param status the error code status.
    + * @return the next character's ordering. otherwise returns NULLORDER if an
    + * error has occured or if the end of string has been reached
    + * @stable ICU 2.0
    + */
    + int32_t next(UErrorCode& status);
    +
    + /**
    + * Get the ordering priority of the previous collation element in the string.
    + * @param status the error code status.
    + * @return the previous element's ordering. otherwise returns NULLORDER if an
    + * error has occured or if the start of string has been reached
    + * @stable ICU 2.0
    + */
    + int32_t previous(UErrorCode& status);
    +
    + /**
    + * Gets the primary order of a collation order.
    + * @param order the collation order
    + * @return the primary order of a collation order.
    + * @stable ICU 2.0
    + */
    + static inline int32_t primaryOrder(int32_t order);
    +
    + /**
    + * Gets the secondary order of a collation order.
    + * @param order the collation order
    + * @return the secondary order of a collation order.
    + * @stable ICU 2.0
    + */
    + static inline int32_t secondaryOrder(int32_t order);
    +
    + /**
    + * Gets the tertiary order of a collation order.
    + * @param order the collation order
    + * @return the tertiary order of a collation order.
    + * @stable ICU 2.0
    + */
    + static inline int32_t tertiaryOrder(int32_t order);
    +
    + /**
    + * Return the maximum length of any expansion sequences that end with the
    + * specified comparison order.
    + * @param order a collation order returned by previous or next.
    + * @return maximum size of the expansion sequences ending with the collation
    + * element or 1 if collation element does not occur at the end of any
    + * expansion sequence
    + * @stable ICU 2.0
    + */
    + int32_t getMaxExpansion(int32_t order) const;
    +
    + /**
    + * Gets the comparison order in the desired strength. Ignore the other
    + * differences.
    + * @param order The order value
    + * @stable ICU 2.0
    + */
    + int32_t strengthOrder(int32_t order) const;
    +
    + /**
    + * Sets the source string.
    + * @param str the source string.
    + * @param status the error code status.
    + * @stable ICU 2.0
    + */
    + void setText(const UnicodeString& str, UErrorCode& status);
    +
    + /**
    + * Sets the source string.
    + * @param str the source character iterator.
    + * @param status the error code status.
    + * @stable ICU 2.0
    + */
    + void setText(CharacterIterator& str, UErrorCode& status);
    +
    + /**
    + * Checks if a comparison order is ignorable.
    + * @param order the collation order.
    + * @return TRUE if a character is ignorable, FALSE otherwise.
    + * @stable ICU 2.0
    + */
    + static inline UBool isIgnorable(int32_t order);
    +
    + /**
    + * Gets the offset of the currently processed character in the source string.
    + * @return the offset of the character.
    + * @stable ICU 2.0
    + */
    + int32_t getOffset(void) const;
    +
    + /**
    + * Sets the offset of the currently processed character in the source string.
    + * @param newOffset the new offset.
    + * @param status the error code status.
    + * @return the offset of the character.
    + * @stable ICU 2.0
    + */
    + void setOffset(int32_t newOffset, UErrorCode& status);
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for the actual class.
    + *
    + * @stable ICU 2.2
    + */
    + virtual UClassID getDynamicClassID() const;
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for this class.
    + *
    + * @stable ICU 2.2
    + */
    + static UClassID U_EXPORT2 getStaticClassID();
    +
    +protected:
    +
    + // CollationElementIterator protected constructors --------------------------
    + /**
    + * @stable ICU 2.0
    + */
    + friend class RuleBasedCollator;
    +
    + /**
    + * CollationElementIterator constructor. This takes the source string and the
    + * collation object. The cursor will walk thru the source string based on the
    + * predefined collation rules. If the source string is empty, NULLORDER will
    + * be returned on the calls to next().
    + * @param sourceText the source string.
    + * @param order the collation object.
    + * @param status the error code status.
    + * @stable ICU 2.0
    + */
    + CollationElementIterator(const UnicodeString& sourceText,
    + const RuleBasedCollator* order, UErrorCode& status);
    +
    + /**
    + * CollationElementIterator constructor. This takes the source string and the
    + * collation object. The cursor will walk thru the source string based on the
    + * predefined collation rules. If the source string is empty, NULLORDER will
    + * be returned on the calls to next().
    + * @param sourceText the source string.
    + * @param order the collation object.
    + * @param status the error code status.
    + * @stable ICU 2.0
    + */
    + CollationElementIterator(const CharacterIterator& sourceText,
    + const RuleBasedCollator* order, UErrorCode& status);
    +
    + // CollationElementIterator protected methods -------------------------------
    +
    + /**
    + * Assignment operator
    + *
    + * @param other the object to be copied
    + * @stable ICU 2.0
    + */
    + const CollationElementIterator&
    + operator=(const CollationElementIterator& other);
    +
    +private:
    + CollationElementIterator(); // default constructor not implemented
    +
    + // CollationElementIterator private data members ----------------------------
    +
    + /**
    + * Data wrapper for collation elements
    + */
    + UCollationElements *m_data_;
    +
    + /**
    + * Indicates if m_data_ belongs to this object.
    + */
    + UBool isDataOwned_;
    +
    +};
    +
    +// CollationElementIterator inline method defination --------------------------
    +
    +/**
    +* Get the primary order of a collation order.
    +* @param order the collation order
    +* @return the primary order of a collation order.
    +*/
    +inline int32_t CollationElementIterator::primaryOrder(int32_t order)
    +{
    + order &= RuleBasedCollator::PRIMARYORDERMASK;
    + return (order >> RuleBasedCollator::PRIMARYORDERSHIFT);
    +}
    +
    +/**
    +* Get the secondary order of a collation order.
    +* @param order the collation order
    +* @return the secondary order of a collation order.
    +*/
    +inline int32_t CollationElementIterator::secondaryOrder(int32_t order)
    +{
    + order = order & RuleBasedCollator::SECONDARYORDERMASK;
    + return (order >> RuleBasedCollator::SECONDARYORDERSHIFT);
    +}
    +
    +/**
    +* Get the tertiary order of a collation order.
    +* @param order the collation order
    +* @return the tertiary order of a collation order.
    +*/
    +inline int32_t CollationElementIterator::tertiaryOrder(int32_t order)
    +{
    + return (order &= RuleBasedCollator::TERTIARYORDERMASK);
    +}
    +
    +inline int32_t CollationElementIterator::getMaxExpansion(int32_t order) const
    +{
    + return ucol_getMaxExpansion(m_data_, (uint32_t)order);
    +}
    +
    +inline UBool CollationElementIterator::isIgnorable(int32_t order)
    +{
    + return (primaryOrder(order) == RuleBasedCollator::PRIMIGNORABLE);
    +}
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_COLLATION */
    +
    +#endif
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/urep.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/urep.h b/platform/osx/icu/unicode/urep.h
    new file mode 100644
    index 0000000..57b547c
    --- /dev/null
    +++ b/platform/osx/icu/unicode/urep.h
    @@ -0,0 +1,155 @@
    +/*
    +******************************************************************************
    +* Copyright (C) 1997-2005, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +******************************************************************************
    +* Date Name Description
    +* 06/23/00 aliu Creation.
    +******************************************************************************
    +*/
    +
    +#ifndef __UREP_H
    +#define __UREP_H
    +
    +#include "unicode/utypes.h"
    +
    +U_CDECL_BEGIN
    +
    +/********************************************************************
    + * General Notes
    + ********************************************************************
    + * TODO
    + * Add usage scenario
    + * Add test code
    + * Talk about pinning
    + * Talk about "can truncate result if out of memory"
    + */
    +
    +/********************************************************************
    + * Data Structures
    + ********************************************************************/
    +/**
    + * \file
    + * \brief C API: Callbacks for UReplacebale
    + */
    +/**
    + * An opaque replaceable text object. This will be manipulated only
    + * through the caller-supplied UReplaceableFunctor struct. Related
    + * to the C++ class Replaceable.
    + * This is currently only used in the Transliterator C API, see utrans.h .
    + * @stable ICU 2.0
    + */
    +typedef void* UReplaceable;
    +
    +/**
    + * A set of function pointers that transliterators use to manipulate a
    + * UReplaceable. The caller should supply the required functions to
    + * manipulate their text appropriately. Related to the C++ class
    + * Replaceable.
    + * @stable ICU 2.0
    + */
    +typedef struct UReplaceableCallbacks {
    +
    + /**
    + * Function pointer that returns the number of UChar code units in
    + * this text.
    + *
    + * @param rep A pointer to "this" UReplaceable object.
    + * @return The length of the text.
    + * @stable ICU 2.0
    + */
    + int32_t (*length)(const UReplaceable* rep);
    +
    + /**
    + * Function pointer that returns a UChar code units at the given
    + * offset into this text; 0 <= offset < n, where n is the value
    + * returned by (*length)(rep). See unistr.h for a description of
    + * charAt() vs. char32At().
    + *
    + * @param rep A pointer to "this" UReplaceable object.
    + * @param offset The index at which to fetch the UChar (code unit).
    + * @return The UChar (code unit) at offset, or U+FFFF if the offset is out of bounds.
    + * @stable ICU 2.0
    + */
    + UChar (*charAt)(const UReplaceable* rep,
    + int32_t offset);
    +
    + /**
    + * Function pointer that returns a UChar32 code point at the given
    + * offset into this text. See unistr.h for a description of
    + * charAt() vs. char32At().
    + *
    + * @param rep A pointer to "this" UReplaceable object.
    + * @param offset The index at which to fetch the UChar32 (code point).
    + * @return The UChar32 (code point) at offset, or U+FFFF if the offset is out of bounds.
    + * @stable ICU 2.0
    + */
    + UChar32 (*char32At)(const UReplaceable* rep,
    + int32_t offset);
    +
    + /**
    + * Function pointer that replaces text between start and limit in
    + * this text with the given text. Attributes (out of band info)
    + * should be retained.
    + *
    + * @param rep A pointer to "this" UReplaceable object.
    + * @param start the starting index of the text to be replaced,
    + * inclusive.
    + * @param limit the ending index of the text to be replaced,
    + * exclusive.
    + * @param text the new text to replace the UChars from
    + * start..limit-1.
    + * @param textLength the number of UChars at text, or -1 if text
    + * is null-terminated.
    + * @stable ICU 2.0
    + */
    + void (*replace)(UReplaceable* rep,
    + int32_t start,
    + int32_t limit,
    + const UChar* text,
    + int32_t textLength);
    +
    + /**
    + * Function pointer that copies the characters in the range
    + * [<tt>start</tt>, <tt>limit</tt>) into the array <tt>dst</tt>.
    + *
    + * @param rep A pointer to "this" UReplaceable object.
    + * @param start offset of first character which will be copied
    + * into the array
    + * @param limit offset immediately following the last character to
    + * be copied
    + * @param dst array in which to copy characters. The length of
    + * <tt>dst</tt> must be at least <tt>(limit - start)</tt>.
    + * @stable ICU 2.1
    + */
    + void (*extract)(UReplaceable* rep,
    + int32_t start,
    + int32_t limit,
    + UChar* dst);
    +
    + /**
    + * Function pointer that copies text between start and limit in
    + * this text to another index in the text. Attributes (out of
    + * band info) should be retained. After this call, there will be
    + * (at least) two copies of the characters originally located at
    + * start..limit-1.
    + *
    + * @param rep A pointer to "this" UReplaceable object.
    + * @param start the starting index of the text to be copied,
    + * inclusive.
    + * @param limit the ending index of the text to be copied,
    + * exclusive.
    + * @param dest the index at which the copy of the UChars should be
    + * inserted.
    + * @stable ICU 2.0
    + */
    + void (*copy)(UReplaceable* rep,
    + int32_t start,
    + int32_t limit,
    + int32_t dest);
    +
    +} UReplaceableCallbacks;
    +
    +U_CDECL_END
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/ures.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/ures.h b/platform/osx/icu/unicode/ures.h
    new file mode 100644
    index 0000000..9cc2e89
    --- /dev/null
    +++ b/platform/osx/icu/unicode/ures.h
    @@ -0,0 +1,871 @@
    +/*
    +**********************************************************************
    +* Copyright (C) 1997-2007, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +**********************************************************************
    +*
    +* File URES.H (formerly CRESBUND.H)
    +*
    +* Modification History:
    +*
    +* Date Name Description
    +* 04/01/97 aliu Creation.
    +* 02/22/99 damiba overhaul.
    +* 04/04/99 helena Fixed internal header inclusion.
    +* 04/15/99 Madhu Updated Javadoc
    +* 06/14/99 stephen Removed functions taking a filename suffix.
    +* 07/20/99 stephen Language-independent ypedef to void*
    +* 11/09/99 weiv Added ures_getLocale()
    +* 06/24/02 weiv Added support for resource sharing
    +******************************************************************************
    +*/
    +
    +#ifndef URES_H
    +#define URES_H
    +
    +#include "unicode/utypes.h"
    +#include "unicode/uloc.h"
    +
    +/**
    + * \file
    + * \brief C API: Resource Bundle
    + *
    + * <h2>C API: Resource Bundle</h2>
    + *
    + * C API representing a collection of resource information pertaining to a given
    + * locale. A resource bundle provides a way of accessing locale- specific information in
    + * a data file. You create a resource bundle that manages the resources for a given
    + * locale and then ask it for individual resources.
    + * <P>
    + * Resource bundles in ICU4C are currently defined using text files which conform to the following
    + * <a href="http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt">BNF definition</a>.
    + * More on resource bundle concepts and syntax can be found in the
    + * <a href="http://icu-project.org/userguide/ResourceManagement.html">Users Guide</a>.
    + * <P>
    + */
    +
    +/**
    + * UResourceBundle is an opaque type for handles for resource bundles in C APIs.
    + * @stable ICU 2.0
    + */
    +struct UResourceBundle;
    +
    +/**
    + * @stable ICU 2.0
    + */
    +typedef struct UResourceBundle UResourceBundle;
    +
    +/**
    + * Numeric constants for types of resource items.
    + * @see ures_getType
    + * @stable ICU 2.0
    + */
    +typedef enum {
    + /** Resource type constant for "no resource". @stable ICU 2.6 */
    + URES_NONE=-1,
    +
    + /** Resource type constant for 16-bit Unicode strings. @stable ICU 2.6 */
    + URES_STRING=0,
    +
    + /** Resource type constant for binary data. @stable ICU 2.6 */
    + URES_BINARY=1,
    +
    + /** Resource type constant for tables of key-value pairs. @stable ICU 2.6 */
    + URES_TABLE=2,
    +
    + /**
    + * Resource type constant for aliases;
    + * internally stores a string which identifies the actual resource
    + * storing the data (can be in a different resource bundle).
    + * Resolved internally before delivering the actual resource through the API.
    + * @stable ICU 2.6
    + */
    + URES_ALIAS=3,
    +
    +#ifndef U_HIDE_INTERNAL_API
    +
    + /**
    + * Internal use only.
    + * Alternative resource type constant for tables of key-value pairs.
    + * Never returned by ures_getType().
    + * @internal
    + */
    + URES_TABLE32=4,
    +
    +#endif /* U_HIDE_INTERNAL_API */
    +
    + /**
    + * Resource type constant for a single 28-bit integer, interpreted as
    + * signed or unsigned by the ures_getInt() or ures_getUInt() function.
    + * @see ures_getInt
    + * @see ures_getUInt
    + * @stable ICU 2.6
    + */
    + URES_INT=7,
    +
    + /** Resource type constant for arrays of resources. @stable ICU 2.6 */
    + URES_ARRAY=8,
    +
    + /**
    + * Resource type constant for vectors of 32-bit integers.
    + * @see ures_getIntVector
    + * @stable ICU 2.6
    + */
    + URES_INT_VECTOR = 14,
    +#ifndef U_HIDE_DEPRECATED_API
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_NONE=URES_NONE,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_STRING=URES_STRING,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_BINARY=URES_BINARY,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_TABLE=URES_TABLE,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_ALIAS=URES_ALIAS,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_INT=URES_INT,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_ARRAY=URES_ARRAY,
    + /** @deprecated ICU 2.6 Use the URES_ constant instead. */
    + RES_INT_VECTOR=URES_INT_VECTOR,
    + /** @deprecated ICU 2.6 Not used. */
    + RES_RESERVED=15,
    +#endif /* U_HIDE_DEPRECATED_API */
    +
    + URES_LIMIT = 16
    +} UResType;
    +
    +/*
    + * Functions to create and destroy resource bundles.
    + */
    +
    +/**
    + * Opens a UResourceBundle, from which users can extract strings by using
    + * their corresponding keys.
    + * Note that the caller is responsible of calling <TT>ures_close</TT> on each succesfully
    + * opened resource bundle.
    + * @param packageName The packageName and locale together point to an ICU udata object,
    + * as defined by <code> udata_open( packageName, "res", locale, err) </code>
    + * or equivalent. Typically, packageName will refer to a (.dat) file, or to
    + * a package registered with udata_setAppData(). Using a full file or directory
    + * pathname for packageName is deprecated. If NULL, ICU data will be used.
    + * @param locale specifies the locale for which we want to open the resource
    + * if NULL, the default locale will be used. If strlen(locale) == 0
    + * root locale will be used.
    + *
    + * @param status fills in the outgoing error code.
    + * The UErrorCode err parameter is used to return status information to the user. To
    + * check whether the construction succeeded or not, you should check the value of
    + * U_SUCCESS(err). If you wish more detailed information, you can check for
    + * informational status results which still indicate success. U_USING_FALLBACK_WARNING
    + * indicates that a fall back locale was used. For example, 'de_CH' was requested,
    + * but nothing was found there, so 'de' was used. U_USING_DEFAULT_WARNING indicates that
    + * the default locale data or root locale data was used; neither the requested locale
    + * nor any of its fall back locales could be found. Please see the users guide for more
    + * information on this topic.
    + * @return a newly allocated resource bundle.
    + * @see ures_close
    + * @stable ICU 2.0
    + */
    +U_STABLE UResourceBundle* U_EXPORT2
    +ures_open(const char* packageName,
    + const char* locale,
    + UErrorCode* status);
    +
    +
    +/** This function does not care what kind of localeID is passed in. It simply opens a bundle with
    + * that name. Fallback mechanism is disabled for the new bundle. If the requested bundle contains
    + * an %%ALIAS directive, the results are undefined.
    + * @param packageName The packageName and locale together point to an ICU udata object,
    + * as defined by <code> udata_open( packageName, "res", locale, err) </code>
    + * or equivalent. Typically, packageName will refer to a (.dat) file, or to
    + * a package registered with udata_setAppData(). Using a full file or directory
    + * pathname for packageName is deprecated. If NULL, ICU data will be used.
    + * @param locale specifies the locale for which we want to open the resource
    + * if NULL, the default locale will be used. If strlen(locale) == 0
    + * root locale will be used.
    + *
    + * @param status fills in the outgoing error code. Either U_ZERO_ERROR or U_MISSING_RESOURCE_ERROR
    + * @return a newly allocated resource bundle or NULL if it doesn't exist.
    + * @see ures_close
    + * @stable ICU 2.0
    + */
    +U_STABLE UResourceBundle* U_EXPORT2
    +ures_openDirect(const char* packageName,
    + const char* locale,
    + UErrorCode* status);
    +
    +/**
    + * Same as ures_open() but takes a const UChar *path.
    + * This path will be converted to char * using the default converter,
    + * then ures_open() is called.
    + *
    + * @param packageName The packageName and locale together point to an ICU udata object,
    + * as defined by <code> udata_open( packageName, "res", locale, err) </code>
    + * or equivalent. Typically, packageName will refer to a (.dat) file, or to
    + * a package registered with udata_setAppData(). Using a full file or directory
    + * pathname for packageName is deprecated. If NULL, ICU data will be used.
    + * @param locale specifies the locale for which we want to open the resource
    + * if NULL, the default locale will be used. If strlen(locale) == 0
    + * root locale will be used.
    + * @param status fills in the outgoing error code.
    + * @return a newly allocated resource bundle.
    + * @see ures_open
    + * @stable ICU 2.0
    + */
    +U_STABLE UResourceBundle* U_EXPORT2
    +ures_openU(const UChar* packageName,
    + const char* locale,
    + UErrorCode* status);
    +
    +/**
    + * Returns the number of strings/arrays in resource bundles.
    + * Better to use ures_getSize, as this function will be deprecated.
    + *
    + *@param resourceBundle resource bundle containing the desired strings
    + *@param resourceKey key tagging the resource
    + *@param err fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_FALLBACK_WARNING </TT>
    + *@return: for <STRONG>Arrays</STRONG>: returns the number of resources in the array
    + * <STRONG>Tables</STRONG>: returns the number of resources in the table
    + * <STRONG>single string</STRONG>: returns 1
    + *@see ures_getSize
    + * @deprecated ICU 2.8 User ures_getSize instead
    + */
    +U_DEPRECATED int32_t U_EXPORT2
    +ures_countArrayItems(const UResourceBundle* resourceBundle,
    + const char* resourceKey,
    + UErrorCode* err);
    +/**
    + * Close a resource bundle, all pointers returned from the various ures_getXXX calls
    + * on this particular bundle should be considered invalid henceforth.
    + *
    + * @param resourceBundle a pointer to a resourceBundle struct. Can be NULL.
    + * @see ures_open
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ures_close(UResourceBundle* resourceBundle);
    +
    +/**
    + * Return the version number associated with this ResourceBundle as a string. Please
    + * use ures_getVersion as this function is going to be deprecated.
    + *
    + * @param resourceBundle The resource bundle for which the version is checked.
    + * @return A version number string as specified in the resource bundle or its parent.
    + * The caller does not own this string.
    + * @see ures_getVersion
    + * @deprecated ICU 2.8 Use ures_getVersion instead.
    + */
    +U_DEPRECATED const char* U_EXPORT2
    +ures_getVersionNumber(const UResourceBundle* resourceBundle);
    +
    +/**
    + * Return the version number associated with this ResourceBundle as an
    + * UVersionInfo array.
    + *
    + * @param resB The resource bundle for which the version is checked.
    + * @param versionInfo A UVersionInfo array that is filled with the version number
    + * as specified in the resource bundle or its parent.
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ures_getVersion(const UResourceBundle* resB,
    + UVersionInfo versionInfo);
    +
    +/**
    + * Return the name of the Locale associated with this ResourceBundle. This API allows
    + * you to query for the real locale of the resource. For example, if you requested
    + * "en_US_CALIFORNIA" and only "en_US" bundle exists, "en_US" will be returned.
    + * For subresources, the locale where this resource comes from will be returned.
    + * If fallback has occured, getLocale will reflect this.
    + *
    + * @param resourceBundle resource bundle in question
    + * @param status just for catching illegal arguments
    + * @return A Locale name
    + * @deprecated ICU 2.8 Use ures_getLocaleByType instead.
    + */
    +U_DEPRECATED const char* U_EXPORT2
    +ures_getLocale(const UResourceBundle* resourceBundle,
    + UErrorCode* status);
    +
    +
    +/**
    + * Return the name of the Locale associated with this ResourceBundle.
    + * You can choose between requested, valid and real locale.
    + *
    + * @param resourceBundle resource bundle in question
    + * @param type You can choose between requested, valid and actual
    + * locale. For description see the definition of
    + * ULocDataLocaleType in uloc.h
    + * @param status just for catching illegal arguments
    + * @return A Locale name
    + * @stable ICU 2.8
    + */
    +U_STABLE const char* U_EXPORT2
    +ures_getLocaleByType(const UResourceBundle* resourceBundle,
    + ULocDataLocaleType type,
    + UErrorCode* status);
    +
    +
    +/**
    + * Same as ures_open() but uses the fill-in parameter instead of allocating
    + * a bundle, if r!=NULL.
    + * TODO need to revisit usefulness of this function
    + * and usage model for fillIn parameters without knowing sizeof(UResourceBundle)
    + * @param r The resourcebundle to open
    + * @param packageName The packageName and locale together point to an ICU udata object,
    + * as defined by <code> udata_open( packageName, "res", locale, err) </code>
    + * or equivalent. Typically, packageName will refer to a (.dat) file, or to
    + * a package registered with udata_setAppData(). Using a full file or directory
    + * pathname for packageName is deprecated. If NULL, ICU data will be used.
    + * @param localeID specifies the locale for which we want to open the resource
    + * @param status The error code
    + * @return a newly allocated resource bundle or NULL if it doesn't exist.
    + * @internal
    + */
    +U_INTERNAL void U_EXPORT2
    +ures_openFillIn(UResourceBundle *r,
    + const char* packageName,
    + const char* localeID,
    + UErrorCode* status);
    +
    +/**
    + * Returns a string from a string resource type
    + *
    + * @param resourceBundle a string resource
    + * @param len fills in the length of resulting string
    + * @param status fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * Always check the value of status. Don't count on returning NULL.
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
    + * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
    + * @see ures_getBinary
    + * @see ures_getIntVector
    + * @see ures_getInt
    + * @see ures_getUInt
    + * @stable ICU 2.0
    + */
    +U_STABLE const UChar* U_EXPORT2
    +ures_getString(const UResourceBundle* resourceBundle,
    + int32_t* len,
    + UErrorCode* status);
    +
    +/**
    + * Returns a UTF-8 string from a string resource.
    + * The UTF-8 string may be returnable directly as a pointer, or
    + * it may need to be copied, or transformed from UTF-16 using u_strToUTF8()
    + * or equivalent.
    + *
    + * If forceCopy==TRUE, then the string is always written to the dest buffer
    + * and dest is returned.
    + *
    + * If forceCopy==FALSE, then the string is returned as a pointer if possible,
    + * without needing a dest buffer (it can be NULL). If the string needs to be
    + * copied or transformed, then it may be placed into dest at an arbitrary offset.
    + *
    + * If the string is to be written to dest, then U_BUFFER_OVERFLOW_ERROR and
    + * U_STRING_NOT_TERMINATED_WARNING are set if appropriate, as usual.
    + *
    + * If the string is transformed from UTF-16, then a conversion error may occur
    + * if an unpaired surrogate is encountered. If the function is successful, then
    + * the output UTF-8 string is always well-formed.
    + *
    + * @param resB Resource bundle.
    + * @param dest Destination buffer. Can be NULL only if capacity=*length==0.
    + * @param length Input: Capacity of destination buffer.
    + * Output: Actual length of the UTF-8 string, not counting the
    + * terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR.
    + * Can be NULL, meaning capacity=0 and the string length is not
    + * returned to the caller.
    + * @param forceCopy If TRUE, then the output string will always be written to
    + * dest, with U_BUFFER_OVERFLOW_ERROR and
    + * U_STRING_NOT_TERMINATED_WARNING set if appropriate.
    + * If FALSE, then the dest buffer may or may not contain a
    + * copy of the string. dest may or may not be modified.
    + * If a copy needs to be written, then the UErrorCode parameter
    + * indicates overflow etc. as usual.
    + * @param status Pointer to a standard ICU error code. Its input value must
    + * pass the U_SUCCESS() test, or else the function returns
    + * immediately. Check for U_FAILURE() on output or use with
    + * function chaining. (See User Guide for details.)
    + * @return The pointer to the UTF-8 string. It may be dest, or at some offset
    + * from dest (only if !forceCopy), or in unrelated memory.
    + * Always NUL-terminated unless the string was written to dest and
    + * length==capacity (in which case U_STRING_NOT_TERMINATED_WARNING is set).
    + *
    + * @see ures_getString
    + * @see u_strToUTF8
    + * @stable ICU 3.6
    + */
    +U_STABLE const char * U_EXPORT2
    +ures_getUTF8String(const UResourceBundle *resB,
    + char *dest, int32_t *length,
    + UBool forceCopy,
    + UErrorCode *status);
    +
    +/**
    + * Returns a binary data from a binary resource.
    + *
    + * @param resourceBundle a string resource
    + * @param len fills in the length of resulting byte chunk
    + * @param status fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * Always check the value of status. Don't count on returning NULL.
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
    + * @return a pointer to a chuck of unsigned bytes which live in a memory mapped/DLL file.
    + * @see ures_getString
    + * @see ures_getIntVector
    + * @see ures_getInt
    + * @see ures_getUInt
    + * @stable ICU 2.0
    + */
    +U_STABLE const uint8_t* U_EXPORT2
    +ures_getBinary(const UResourceBundle* resourceBundle,
    + int32_t* len,
    + UErrorCode* status);
    +
    +/**
    + * Returns a 32 bit integer array from a resource.
    + *
    + * @param resourceBundle an int vector resource
    + * @param len fills in the length of resulting byte chunk
    + * @param status fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * Always check the value of status. Don't count on returning NULL.
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
    + * @return a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.
    + * @see ures_getBinary
    + * @see ures_getString
    + * @see ures_getInt
    + * @see ures_getUInt
    + * @stable ICU 2.0
    + */
    +U_STABLE const int32_t* U_EXPORT2
    +ures_getIntVector(const UResourceBundle* resourceBundle,
    + int32_t* len,
    + UErrorCode* status);
    +
    +/**
    + * Returns an unsigned integer from a resource.
    + * This integer is originally 28 bits.
    + *
    + * @param resourceBundle a string resource
    + * @param status fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
    + * @return an integer value
    + * @see ures_getInt
    + * @see ures_getIntVector
    + * @see ures_getBinary
    + * @see ures_getString
    + * @stable ICU 2.0
    + */
    +U_STABLE uint32_t U_EXPORT2
    +ures_getUInt(const UResourceBundle* resourceBundle,
    + UErrorCode *status);
    +
    +/**
    + * Returns a signed integer from a resource.
    + * This integer is originally 28 bit and the sign gets propagated.
    + *
    + * @param resourceBundle a string resource
    + * @param status fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
    + * @return an integer value
    + * @see ures_getUInt
    + * @see ures_getIntVector
    + * @see ures_getBinary
    + * @see ures_getString
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ures_getInt(const UResourceBundle* resourceBundle,
    + UErrorCode *status);
    +
    +/**
    + * Returns the size of a resource. Size for scalar types is always 1,
    + * and for vector/table types is the number of child resources.
    + * @warning Integer array is treated as a scalar type. There are no
    + * APIs to access individual members of an integer array. It
    + * is always returned as a whole.
    + * @param resourceBundle a resource
    + * @return number of resources in a given resource.
    + * @stable ICU 2.0
    + */
    +U_STABLE int32_t U_EXPORT2
    +ures_getSize(const UResourceBundle *resourceBundle);
    +
    +/**
    + * Returns the type of a resource. Available types are defined in enum UResType
    + *
    + * @param resourceBundle a resource
    + * @return type of the given resource.
    + * @see UResType
    + * @stable ICU 2.0
    + */
    +U_STABLE UResType U_EXPORT2
    +ures_getType(const UResourceBundle *resourceBundle);
    +
    +/**
    + * Returns the key associated with a given resource. Not all the resources have a key - only
    + * those that are members of a table.
    + *
    + * @param resourceBundle a resource
    + * @return a key associated to this resource, or NULL if it doesn't have a key
    + * @stable ICU 2.0
    + */
    +U_STABLE const char * U_EXPORT2
    +ures_getKey(const UResourceBundle *resourceBundle);
    +
    +/* ITERATION API
    + This API provides means for iterating through a resource
    +*/
    +
    +/**
    + * Resets the internal context of a resource so that iteration starts from the first element.
    + *
    + * @param resourceBundle a resource
    + * @stable ICU 2.0
    + */
    +U_STABLE void U_EXPORT2
    +ures_resetIterator(UResourceBundle *resourceBundle);
    +
    +/**
    + * Checks whether the given resource has another element to iterate over.
    + *
    + * @param resourceBundle a resource
    + * @return TRUE if there are more elements, FALSE if there is no more elements
    + * @stable ICU 2.0
    + */
    +U_STABLE UBool U_EXPORT2
    +ures_hasNext(const UResourceBundle *resourceBundle);
    +
    +/**
    + * Returns the next resource in a given resource or NULL if there are no more resources
    + * to iterate over. Features a fill-in parameter.
    + *
    + * @param resourceBundle a resource
    + * @param fillIn if NULL a new UResourceBundle struct is allocated and must be closed by the caller.
    + * Alternatively, you can supply a struct to be filled by this function.
    + * @param status fills in the outgoing error code. You may still get a non NULL result even if an
    + * error occured. Check status instead.
    + * @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it
    + * @stable ICU 2.0
    + */
    +U_STABLE UResourceBundle* U_EXPORT2
    +ures_getNextResource(UResourceBundle *resourceBundle,
    + UResourceBundle *fillIn,
    + UErrorCode *status);
    +
    +/**
    + * Returns the next string in a given resource or NULL if there are no more resources
    + * to iterate over.
    + *
    + * @param resourceBundle a resource
    + * @param len fill in length of the string
    + * @param key fill in for key associated with this string. NULL if no key
    + * @param status fills in the outgoing error code. If an error occured, we may return NULL, but don't
    + * count on it. Check status instead!
    + * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
    + * @stable ICU 2.0
    + */
    +U_STABLE const UChar* U_EXPORT2
    +ures_getNextString(UResourceBundle *resourceBundle,
    + int32_t* len,
    + const char ** key,
    + UErrorCode *status);
    +
    +/**
    + * Returns the resource in a given resource at the specified index. Features a fill-in parameter.
    + *
    + * @param resourceBundle the resource bundle from which to get a sub-resource
    + * @param indexR an index to the wanted resource.
    + * @param fillIn if NULL a new UResourceBundle struct is allocated and must be closed by the caller.
    + * Alternatively, you can supply a struct to be filled by this function.
    + * @param status fills in the outgoing error code. Don't count on NULL being returned if an error has
    + * occured. Check status instead.
    + * @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it
    + * @stable ICU 2.0
    + */
    +U_STABLE UResourceBundle* U_EXPORT2
    +ures_getByIndex(const UResourceBundle *resourceBundle,
    + int32_t indexR,
    + UResourceBundle *fillIn,
    + UErrorCode *status);
    +
    +/**
    + * Returns the string in a given resource at the specified index.
    + *
    + * @param resourceBundle a resource
    + * @param indexS an index to the wanted string.
    + * @param len fill in length of the string
    + * @param status fills in the outgoing error code. If an error occured, we may return NULL, but don't
    + * count on it. Check status instead!
    + * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
    + * @stable ICU 2.0
    + */
    +U_STABLE const UChar* U_EXPORT2
    +ures_getStringByIndex(const UResourceBundle *resourceBundle,
    + int32_t indexS,
    + int32_t* len,
    + UErrorCode *status);
    +
    +/**
    + * Returns a UTF-8 string from a resource at the specified index.
    + * The UTF-8 string may be returnable directly as a pointer, or
    + * it may need to be copied, or transformed from UTF-16 using u_strToUTF8()
    + * or equivalent.
    + *
    + * If forceCopy==TRUE, then the string is always written to the dest buffer
    + * and dest is returned.
    + *
    + * If forceCopy==FALSE, then the string is returned as a pointer if possible,
    + * without needing a dest buffer (it can be NULL). If the string needs to be
    + * copied or transformed, then it may be placed into dest at an arbitrary offset.
    + *
    + * If the string is to be written to dest, then U_BUFFER_OVERFLOW_ERROR and
    + * U_STRING_NOT_TERMINATED_WARNING are set if appropriate, as usual.
    + *
    + * If the string is transformed from UTF-16, then a conversion error may occur
    + * if an unpaired surrogate is encountered. If the function is successful, then
    + * the output UTF-8 string is always well-formed.
    + *
    + * @param resB Resource bundle.
    + * @param index An index to the wanted string.
    + * @param dest Destination buffer. Can be NULL only if capacity=*length==0.
    + * @param pLength Input: Capacity of destination buffer.
    + * Output: Actual length of the UTF-8 string, not counting the
    + * terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR.
    + * Can be NULL, meaning capacity=0 and the string length is not
    + * returned to the caller.
    + * @param forceCopy If TRUE, then the output string will always be written to
    + * dest, with U_BUFFER_OVERFLOW_ERROR and
    + * U_STRING_NOT_TERMINATED_WARNING set if appropriate.
    + * If FALSE, then the dest buffer may or may not contain a
    + * copy of the string. dest may or may not be modified.
    + * If a copy needs to be written, then the UErrorCode parameter
    + * indicates overflow etc. as usual.
    + * @param status Pointer to a standard ICU error code. Its input value must
    + * pass the U_SUCCESS() test, or else the function returns
    + * immediately. Check for U_FAILURE() on output or use with
    + * function chaining. (See User Guide for details.)
    + * @return The pointer to the UTF-8 string. It may be dest, or at some offset
    + * from dest (only if !forceCopy), or in unrelated memory.
    + * Always NUL-terminated unless the string was written to dest and
    + * length==capacity (in which case U_STRING_NOT_TERMINATED_WARNING is set).
    + *
    + * @see ures_getStringByIndex
    + * @see u_strToUTF8
    + * @stable ICU 3.6
    + */
    +U_STABLE const char * U_EXPORT2
    +ures_getUTF8StringByIndex(const UResourceBundle *resB,
    + int32_t index,
    + char *dest, int32_t *pLength,
    + UBool forceCopy,
    + UErrorCode *status);
    +
    +/**
    + * Returns a resource in a given resource that has a given key. This procedure works only with table
    + * resources. Features a fill-in parameter.
    + *
    + * @param resourceBundle a resource
    + * @param key a key associated with the wanted resource
    + * @param fillIn if NULL a new UResourceBundle struct is allocated and must be closed by the caller.
    + * Alternatively, you can supply a struct to be filled by this function.
    + * @param status fills in the outgoing error code.
    + * @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it
    + * @stable ICU 2.0
    + */
    +U_STABLE UResourceBundle* U_EXPORT2
    +ures_getByKey(const UResourceBundle *resourceBundle,
    + const char* key,
    + UResourceBundle *fillIn,
    + UErrorCode *status);
    +
    +/**
    + * Returns a string in a given resource that has a given key. This procedure works only with table
    + * resources.
    + *
    + * @param resB a resource
    + * @param key a key associated with the wanted string
    + * @param len fill in length of the string
    + * @param status fills in the outgoing error code. If an error occured, we may return NULL, but don't
    + * count on it. Check status instead!
    + * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
    + * @stable ICU 2.0
    + */
    +U_STABLE const UChar* U_EXPORT2
    +ures_getStringByKey(const UResourceBundle *resB,
    + const char* key,
    + int32_t* len,
    + UErrorCode *status);
    +
    +/**
    + * Returns a UTF-8 string from a resource and a key.
    + * This function works only with table resources.
    + *
    + * The UTF-8 string may be returnable directly as a pointer, or
    + * it may need to be copied, or transformed from UTF-16 using u_strToUTF8()
    + * or equivalent.
    + *
    + * If forceCopy==TRUE, then the string is always written to the dest buffer
    + * and dest is returned.
    + *
    + * If forceCopy==FALSE, then the string is returned as a pointer if possible,
    + * without needing a dest buffer (it can be NULL). If the string needs to be
    + * copied or transformed, then it may be placed into dest at an arbitrary offset.
    + *
    + * If the string is to be written to dest, then U_BUFFER_OVERFLOW_ERROR and
    + * U_STRING_NOT_TERMINATED_WARNING are set if appropriate, as usual.
    + *
    + * If the string is transformed from UTF-16, then a conversion error may occur
    + * if an unpaired surrogate is encountered. If the function is successful, then
    + * the output UTF-8 string is always well-formed.
    + *
    + * @param resB Resource bundle.
    + * @param key A key associated with the wanted resource
    + * @param dest Destination buffer. Can be NULL only if capacity=*length==0.
    + * @param pLength Input: Capacity of destination buffer.
    + * Output: Actual length of the UTF-8 string, not counting the
    + * terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR.
    + * Can be NULL, meaning capacity=0 and the string length is not
    + * returned to the caller.
    + * @param forceCopy If TRUE, then the output string will always be written to
    + * dest, with U_BUFFER_OVERFLOW_ERROR and
    + * U_STRING_NOT_TERMINATED_WARNING set if appropriate.
    + * If FALSE, then the dest buffer may or may not contain a
    + * copy of the string. dest may or may not be modified.
    + * If a copy needs to be written, then the UErrorCode parameter
    + * indicates overflow etc. as usual.
    + * @param status Pointer to a standard ICU error code. Its input value must
    + * pass the U_SUCCESS() test, or else the function returns
    + * immediately. Check for U_FAILURE() on output or use with
    + * function chaining. (See User Guide for details.)
    + * @return The pointer to the UTF-8 string. It may be dest, or at some offset
    + * from dest (only if !forceCopy), or in unrelated memory.
    + * Always NUL-terminated unless the string was written to dest and
    + * length==capacity (in which case U_STRING_NOT_TERMINATED_WARNING is set).
    + *
    + * @see ures_getStringByKey
    + * @see u_strToUTF8
    + * @stable ICU 3.6
    + */
    +U_STABLE const char * U_EXPORT2
    +ures_getUTF8StringByKey(const UResourceBundle *resB,
    + const char *key,
    + char *dest, int32_t *pLength,
    + UBool forceCopy,
    + UErrorCode *status);
    +
    +#ifdef XP_CPLUSPLUS
    +#include "unicode/unistr.h"
    +
    +U_NAMESPACE_BEGIN
    +/**
    + * returns a string from a string resource type
    + *
    + * @param resB a resource
    + * @param status: fills in the outgoing error code
    + * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
    + * could be a non-failing error
    + * e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
    + * @return a UnicodeString object. If there is an error, string is bogus
    + * @stable ICU 2.0
    + */
    +inline UnicodeString
    +ures_getUnicodeString(const UResourceBundle *resB,
    + UErrorCode* status)
    +{
    + int32_t len = 0;
    + const UChar *r = ures_getString(resB, &len, status);
    + return UnicodeString(TRUE, r, len);
    +}
    +
    +/**
    + * Returns the next string in a resource or NULL if there are no more resources
    + * to iterate over.
    + *
    + * @param resB a resource
    + * @param key fill in for key associated with this string
    + * @param status fills in the outgoing error code
    + * @return an UnicodeString object.
    + * @stable ICU 2.0
    + */
    +inline UnicodeString
    +ures_getNextUnicodeString(UResourceBundle *resB,
    + const char ** key,
    + UErrorCode* status)
    +{
    + int32_t len = 0;
    + const UChar* r = ures_getNextString(resB, &len, key, status);
    + return UnicodeString(TRUE, r, len);
    +}
    +
    +/**
    + * Returns the string in a given resource at the specified index.
    + *
    + * @param resB a resource
    + * @param index an index to the wanted string.
    + * @param status fills in the outgoing error code
    + * @return an UnicodeString object. If there is an error, string is bogus
    + * @stable ICU 2.0
    + */
    +inline UnicodeString
    +ures_getUnicodeStringByIndex(const UResourceBundle *resB,
    + int32_t indexS,
    + UErrorCode* status)
    +{
    + int32_t len = 0;
    + const UChar* r = ures_getStringByIndex(resB, indexS, &len, status);
    + return UnicodeString(TRUE, r, len);
    +}
    +
    +/**
    + * Returns a string in a resource that has a given key. This procedure works only with table
    + * resources.
    + *
    + * @param resB a resource
    + * @param key a key associated with the wanted string
    + * @param status fills in the outgoing error code
    + * @return an UnicodeString object. If there is an error, string is bogus
    + * @stable ICU 2.0
    + */
    +inline UnicodeString
    +ures_getUnicodeStringByKey(const UResourceBundle *resB,
    + const char* key,
    + UErrorCode* status)
    +{
    + int32_t len = 0;
    + const UChar* r = ures_getStringByKey(resB, key, &len, status);
    + return UnicodeString(TRUE, r, len);
    +}
    +
    +U_NAMESPACE_END
    +
    +#endif
    +
    +/**
    + * Create a string enumerator, owned by the caller, of all locales located within
    + * the specified resource tree.
    + * @param packageName name of the tree, such as (NULL) or U_ICUDATA_ALIAS or or "ICUDATA-coll"
    + * This call is similar to uloc_getAvailable().
    + * @param status error code
    + * @stable ICU 3.2
    + */
    +U_STABLE UEnumeration* U_EXPORT2
    +ures_openAvailableLocales(const char *packageName, UErrorCode *status);
    +
    +
    +#endif /*_URES*/
    +/*eof*/

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/uscript.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/uscript.h b/platform/osx/icu/unicode/uscript.h
    new file mode 100644
    index 0000000..c915d8d
    --- /dev/null
    +++ b/platform/osx/icu/unicode/uscript.h
    @@ -0,0 +1,254 @@
    +/*
    + **********************************************************************
    + * Copyright (C) 1997-2008, International Business Machines
    + * Corporation and others. All Rights Reserved.
    + **********************************************************************
    + *
    + * File USCRIPT.H
    + *
    + * Modification History:
    + *
    + * Date Name Description
    + * 07/06/2001 Ram Creation.
    + ******************************************************************************
    + */
    +
    +#ifndef USCRIPT_H
    +#define USCRIPT_H
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C API: Unicode Script Information
    + */
    +
    +/**
    + * Constants for ISO 15924 script codes.
    + *
    + * Many of these script codes - those from Unicode's ScriptNames.txt -
    + * are character property values for Unicode's Script property.
    + * See UAX #24 Script Names (http://www.unicode.org/reports/tr24/).
    + *
    + * Starting with ICU 3.6, constants for most ISO 15924 script codes
    + * are included (currently excluding private-use codes Qaaa..Qabx).
    + * For scripts for which there are codes in ISO 15924 but which are not
    + * used in the Unicode Character Database (UCD), there are no Unicode characters
    + * associated with those scripts.
    + *
    + * For example, there are no characters that have a UCD script code of
    + * Hans or Hant. All Han ideographs have the Hani script code.
    + * The Hans and Hant script codes are used with CLDR data.
    + *
    + * ISO 15924 script codes are included for use with CLDR and similar.
    + *
    + * @stable ICU 2.2
    + */
    +typedef enum UScriptCode {
    + USCRIPT_INVALID_CODE = -1,
    + USCRIPT_COMMON = 0 , /* Zyyy */
    + USCRIPT_INHERITED = 1, /* Qaai */
    + USCRIPT_ARABIC = 2, /* Arab */
    + USCRIPT_ARMENIAN = 3, /* Armn */
    + USCRIPT_BENGALI = 4, /* Beng */
    + USCRIPT_BOPOMOFO = 5, /* Bopo */
    + USCRIPT_CHEROKEE = 6, /* Cher */
    + USCRIPT_COPTIC = 7, /* Copt */
    + USCRIPT_CYRILLIC = 8, /* Cyrl */
    + USCRIPT_DESERET = 9, /* Dsrt */
    + USCRIPT_DEVANAGARI = 10, /* Deva */
    + USCRIPT_ETHIOPIC = 11, /* Ethi */
    + USCRIPT_GEORGIAN = 12, /* Geor */
    + USCRIPT_GOTHIC = 13, /* Goth */
    + USCRIPT_GREEK = 14, /* Grek */
    + USCRIPT_GUJARATI = 15, /* Gujr */
    + USCRIPT_GURMUKHI = 16, /* Guru */
    + USCRIPT_HAN = 17, /* Hani */
    + USCRIPT_HANGUL = 18, /* Hang */
    + USCRIPT_HEBREW = 19, /* Hebr */
    + USCRIPT_HIRAGANA = 20, /* Hira */
    + USCRIPT_KANNADA = 21, /* Knda */
    + USCRIPT_KATAKANA = 22, /* Kana */
    + USCRIPT_KHMER = 23, /* Khmr */
    + USCRIPT_LAO = 24, /* Laoo */
    + USCRIPT_LATIN = 25, /* Latn */
    + USCRIPT_MALAYALAM = 26, /* Mlym */
    + USCRIPT_MONGOLIAN = 27, /* Mong */
    + USCRIPT_MYANMAR = 28, /* Mymr */
    + USCRIPT_OGHAM = 29, /* Ogam */
    + USCRIPT_OLD_ITALIC = 30, /* Ital */
    + USCRIPT_ORIYA = 31, /* Orya */
    + USCRIPT_RUNIC = 32, /* Runr */
    + USCRIPT_SINHALA = 33, /* Sinh */
    + USCRIPT_SYRIAC = 34, /* Syrc */
    + USCRIPT_TAMIL = 35, /* Taml */
    + USCRIPT_TELUGU = 36, /* Telu */
    + USCRIPT_THAANA = 37, /* Thaa */
    + USCRIPT_THAI = 38, /* Thai */
    + USCRIPT_TIBETAN = 39, /* Tibt */
    + /** Canadian_Aboriginal script. @stable ICU 2.6 */
    + USCRIPT_CANADIAN_ABORIGINAL = 40, /* Cans */
    + /** Canadian_Aboriginal script (alias). @stable ICU 2.2 */
    + USCRIPT_UCAS = USCRIPT_CANADIAN_ABORIGINAL,
    + USCRIPT_YI = 41, /* Yiii */
    + USCRIPT_TAGALOG = 42, /* Tglg */
    + USCRIPT_HANUNOO = 43, /* Hano */
    + USCRIPT_BUHID = 44, /* Buhd */
    + USCRIPT_TAGBANWA = 45, /* Tagb */
    +
    + /* New scripts in Unicode 4 @stable ICU 2.6 */
    + USCRIPT_BRAILLE = 46, /* Brai */
    + USCRIPT_CYPRIOT = 47, /* Cprt */
    + USCRIPT_LIMBU = 48, /* Limb */
    + USCRIPT_LINEAR_B = 49, /* Linb */
    + USCRIPT_OSMANYA = 50, /* Osma */
    + USCRIPT_SHAVIAN = 51, /* Shaw */
    + USCRIPT_TAI_LE = 52, /* Tale */
    + USCRIPT_UGARITIC = 53, /* Ugar */
    +
    + /** New script code in Unicode 4.0.1 @stable ICU 3.0 */
    + USCRIPT_KATAKANA_OR_HIRAGANA = 54,/*Hrkt */
    +
    + /* New scripts in Unicode 4.1 @stable ICU 3.4 */
    + USCRIPT_BUGINESE = 55, /* Bugi */
    + USCRIPT_GLAGOLITIC = 56, /* Glag */
    + USCRIPT_KHAROSHTHI = 57, /* Khar */
    + USCRIPT_SYLOTI_NAGRI = 58, /* Sylo */
    + USCRIPT_NEW_TAI_LUE = 59, /* Talu */
    + USCRIPT_TIFINAGH = 60, /* Tfng */
    + USCRIPT_OLD_PERSIAN = 61, /* Xpeo */
    +
    + /* New script codes from ISO 15924 @stable ICU 3.6 */
    + USCRIPT_BALINESE = 62, /* Bali */
    + USCRIPT_BATAK = 63, /* Batk */
    + USCRIPT_BLISSYMBOLS = 64, /* Blis */
    + USCRIPT_BRAHMI = 65, /* Brah */
    + USCRIPT_CHAM = 66, /* Cham */
    + USCRIPT_CIRTH = 67, /* Cirt */
    + USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC = 68, /* Cyrs */
    + USCRIPT_DEMOTIC_EGYPTIAN = 69, /* Egyd */
    + USCRIPT_HIERATIC_EGYPTIAN = 70, /* Egyh */
    + USCRIPT_EGYPTIAN_HIEROGLYPHS = 71, /* Egyp */
    + USCRIPT_KHUTSURI = 72, /* Geok */
    + USCRIPT_SIMPLIFIED_HAN = 73, /* Hans */
    + USCRIPT_TRADITIONAL_HAN = 74, /* Hant */
    + USCRIPT_PAHAWH_HMONG = 75, /* Hmng */
    + USCRIPT_OLD_HUNGARIAN = 76, /* Hung */
    + USCRIPT_HARAPPAN_INDUS = 77, /* Inds */
    + USCRIPT_JAVANESE = 78, /* Java */
    + USCRIPT_KAYAH_LI = 79, /* Kali */
    + USCRIPT_LATIN_FRAKTUR = 80, /* Latf */
    + USCRIPT_LATIN_GAELIC = 81, /* Latg */
    + USCRIPT_LEPCHA = 82, /* Lepc */
    + USCRIPT_LINEAR_A = 83, /* Lina */
    + USCRIPT_MANDAEAN = 84, /* Mand */
    + USCRIPT_MAYAN_HIEROGLYPHS = 85, /* Maya */
    + USCRIPT_MEROITIC = 86, /* Mero */
    + USCRIPT_NKO = 87, /* Nkoo */
    + USCRIPT_ORKHON = 88, /* Orkh */
    + USCRIPT_OLD_PERMIC = 89, /* Perm */
    + USCRIPT_PHAGS_PA = 90, /* Phag */
    + USCRIPT_PHOENICIAN = 91, /* Phnx */
    + USCRIPT_PHONETIC_POLLARD = 92, /* Plrd */
    + USCRIPT_RONGORONGO = 93, /* Roro */
    + USCRIPT_SARATI = 94, /* Sara */
    + USCRIPT_ESTRANGELO_SYRIAC = 95, /* Syre */
    + USCRIPT_WESTERN_SYRIAC = 96, /* Syrj */
    + USCRIPT_EASTERN_SYRIAC = 97, /* Syrn */
    + USCRIPT_TENGWAR = 98, /* Teng */
    + USCRIPT_VAI = 99, /* Vaii */
    + USCRIPT_VISIBLE_SPEECH = 100, /* Visp */
    + USCRIPT_CUNEIFORM = 101,/* Xsux */
    + USCRIPT_UNWRITTEN_LANGUAGES = 102,/* Zxxx */
    + USCRIPT_UNKNOWN = 103,/* Zzzz */ /* Unknown="Code for uncoded script", for unassigned code points */
    +
    + /* New script codes from ISO 15924 @stable ICU 4.0 */
    + USCRIPT_CARIAN = 104,/* Cari */
    + USCRIPT_JAPANESE = 105,/* Jpan */
    + USCRIPT_LANNA = 106,/* Lana */
    + USCRIPT_LYCIAN = 107,/* Lyci */
    + USCRIPT_LYDIAN = 108,/* Lydi */
    + USCRIPT_OL_CHIKI = 109,/* Olck */
    + USCRIPT_REJANG = 110,/* Rjng */
    + USCRIPT_SAURASHTRA = 111,/* Saur */
    + USCRIPT_SIGN_WRITING = 112,/* Sgnw */
    + USCRIPT_SUNDANESE = 113,/* Sund */
    + USCRIPT_MOON = 114,/* Moon */
    + USCRIPT_MEITEI_MAYEK = 115,/* Mtei */
    +
    + /* New script codes from ISO 15924 @draft ICU 4.0 */
    + USCRIPT_IMPERIAL_ARAMAIC = 116,/* Armi */
    + USCRIPT_AVESTAN = 117,/* Avst */
    + USCRIPT_CHAKMA = 118,/* Cakm */
    + USCRIPT_KOREAN = 119,/* Kore */
    + USCRIPT_KAITHI = 120,/* Kthi */
    + USCRIPT_MANICHAEAN = 121,/* Mani */
    + USCRIPT_INSCRIPTIONAL_PAHLAVI = 122,/* Phli */
    + USCRIPT_PSALTER_PAHLAVI = 123,/* Phlp */
    + USCRIPT_BOOK_PAHLAVI = 124,/* Phlv */
    + USCRIPT_INSCRIPTIONAL_PARTHIAN = 125,/* Prti */
    + USCRIPT_SAMARITAN = 126,/* Samr */
    + USCRIPT_TAI_VIET = 127,/* Tavt */
    + USCRIPT_MATHEMATICAL_NOTATION = 128,/* Zmth */
    + USCRIPT_SYMBOLS = 129,/* Zsym */
    +
    + /* Private use codes from Qaaa - Qabx are not supported*/
    + USCRIPT_CODE_LIMIT = 130
    +} UScriptCode;
    +
    +/**
    + * Gets script codes associated with the given locale or ISO 15924 abbreviation or name.
    + * Fills in USCRIPT_MALAYALAM given "Malayam" OR "Mlym".
    + * Fills in USCRIPT_LATIN given "en" OR "en_US"
    + * If required capacity is greater than capacity of the destination buffer then the error code
    + * is set to U_BUFFER_OVERFLOW_ERROR and the required capacity is returned
    + *
    + * <p>Note: To search by short or long script alias only, use
    + * u_getPropertyValueEnum(UCHAR_SCRIPT, alias) instead. This does
    + * a fast lookup with no access of the locale data.
    + * @param nameOrAbbrOrLocale name of the script, as given in
    + * PropertyValueAliases.txt, or ISO 15924 code or locale
    + * @param fillIn the UScriptCode buffer to fill in the script code
    + * @param capacity the capacity (size) fo UScriptCode buffer passed in.
    + * @param err the error status code.
    + * @return The number of script codes filled in the buffer passed in
    + * @stable ICU 2.4
    + */
    +U_STABLE int32_t U_EXPORT2
    +uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err);
    +
    +/**
    + * Gets a script name associated with the given script code.
    + * Returns "Malayam" given USCRIPT_MALAYALAM
    + * @param scriptCode UScriptCode enum
    + * @return script long name as given in
    + * PropertyValueAliases.txt, or NULL if scriptCode is invalid
    + * @stable ICU 2.4
    + */
    +U_STABLE const char* U_EXPORT2
    +uscript_getName(UScriptCode scriptCode);
    +
    +/**
    + * Gets a script name associated with the given script code.
    + * Returns "Mlym" given USCRIPT_MALAYALAM
    + * @param scriptCode UScriptCode enum
    + * @return script abbreviated name as given in
    + * PropertyValueAliases.txt, or NULL if scriptCode is invalid
    + * @stable ICU 2.4
    + */
    +U_STABLE const char* U_EXPORT2
    +uscript_getShortName(UScriptCode scriptCode);
    +
    +/**
    + * Gets the script code associated with the given codepoint.
    + * Returns USCRIPT_MALAYALAM given 0x0D02
    + * @param codepoint UChar32 codepoint
    + * @param err the error status code.
    + * @return The UScriptCode, or 0 if codepoint is invalid
    + * @stable ICU 2.4
    + */
    +U_STABLE UScriptCode U_EXPORT2
    +uscript_getScript(UChar32 codepoint, UErrorCode *err);
    +
    +#endif
    +
    +
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/rbnf.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/rbnf.h b/platform/osx/icu/unicode/rbnf.h
    new file mode 100644
    index 0000000..030565e
    --- /dev/null
    +++ b/platform/osx/icu/unicode/rbnf.h
    @@ -0,0 +1,1049 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 1997-2006, International Business Machines Corporation and others.
    +* All Rights Reserved.
    +*******************************************************************************
    +*/
    +
    +#ifndef RBNF_H
    +#define RBNF_H
    +
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Rule Based Number Format
    + */
    +
    +/**
    + * \def U_HAVE_RBNF
    + * This will be 0 if RBNF support is not included in ICU
    + * and 1 if it is.
    + *
    + * @stable ICU 2.4
    + */
    +#if UCONFIG_NO_FORMATTING
    +#define U_HAVE_RBNF 0
    +#else
    +#define U_HAVE_RBNF 1
    +
    +#include "unicode/coll.h"
    +#include "unicode/dcfmtsym.h"
    +#include "unicode/fmtable.h"
    +#include "unicode/locid.h"
    +#include "unicode/numfmt.h"
    +#include "unicode/unistr.h"
    +#include "unicode/strenum.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +class NFRuleSet;
    +class LocalizationInfo;
    +
    +/**
    + * Tags for the predefined rulesets.
    + *
    + * @stable ICU 2.2
    + */
    +enum URBNFRuleSetTag {
    + URBNF_SPELLOUT,
    + URBNF_ORDINAL,
    + URBNF_DURATION,
    + URBNF_COUNT
    +};
    +
    +#if UCONFIG_NO_COLLATION
    +class Collator;
    +#endif
    +
    +/**
    + * The RuleBasedNumberFormat class formats numbers according to a set of rules. This number formatter is
    + * typically used for spelling out numeric values in words (e.g., 25,3476 as
    + * &quot;twenty-five thousand three hundred seventy-six&quot; or &quot;vingt-cinq mille trois
    + * cents soixante-seize&quot; or
    + * &quot;f&uuml;nfundzwanzigtausenddreihundertsechsundsiebzig&quot;), but can also be used for
    + * other complicated formatting tasks, such as formatting a number of seconds as hours,
    + * minutes and seconds (e.g., 3,730 as &quot;1:02:10&quot;).
    + *
    + * <p>The resources contain three predefined formatters for each locale: spellout, which
    + * spells out a value in words (123 is &quot;one hundred twenty-three&quot;); ordinal, which
    + * appends an ordinal suffix to the end of a numeral (123 is &quot;123rd&quot;); and
    + * duration, which shows a duration in seconds as hours, minutes, and seconds (123 is
    + * &quot;2:03&quot;).&nbsp; The client can also define more specialized <tt>RuleBasedNumberFormat</tt>s
    + * by supplying programmer-defined rule sets.</p>
    + *
    + * <p>The behavior of a <tt>RuleBasedNumberFormat</tt> is specified by a textual description
    + * that is either passed to the constructor as a <tt>String</tt> or loaded from a resource
    + * bundle. In its simplest form, the description consists of a semicolon-delimited list of <em>rules.</em>
    + * Each rule has a string of output text and a value or range of values it is applicable to.
    + * In a typical spellout rule set, the first twenty rules are the words for the numbers from
    + * 0 to 19:</p>
    + *
    + * <pre>zero; one; two; three; four; five; six; seven; eight; nine;
    + * ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen; seventeen; eighteen; nineteen;</pre>
    + *
    + * <p>For larger numbers, we can use the preceding set of rules to format the ones place, and
    + * we only have to supply the words for the multiples of 10:</p>
    + *
    + * <pre> 20: twenty[-&gt;&gt;];
    + * 30: thirty[-&gt;&gt;];
    + * 40: forty[-&gt;&gt;];
    + * 50: fifty[-&gt;&gt;];
    + * 60: sixty[-&gt;&gt;];
    + * 70: seventy[-&gt;&gt;];
    + * 80: eighty[-&gt;&gt;];
    + * 90: ninety[-&gt;&gt;];</pre>
    + *
    + * <p>In these rules, the <em>base value</em> is spelled out explicitly and set off from the
    + * rule's output text with a colon. The rules are in a sorted list, and a rule is applicable
    + * to all numbers from its own base value to one less than the next rule's base value. The
    + * &quot;&gt;&gt;&quot; token is called a <em>substitution</em> and tells the fomatter to
    + * isolate the number's ones digit, format it using this same set of rules, and place the
    + * result at the position of the &quot;&gt;&gt;&quot; token. Text in brackets is omitted if
    + * the number being formatted is an even multiple of 10 (the hyphen is a literal hyphen; 24
    + * is &quot;twenty-four,&quot; not &quot;twenty four&quot;).</p>
    + *
    + * <p>For even larger numbers, we can actually look up several parts of the number in the
    + * list:</p>
    + *
    + * <pre>100: &lt;&lt; hundred[ &gt;&gt;];</pre>
    + *
    + * <p>The &quot;&lt;&lt;&quot; represents a new kind of substitution. The &lt;&lt; isolates
    + * the hundreds digit (and any digits to its left), formats it using this same rule set, and
    + * places the result where the &quot;&lt;&lt;&quot; was. Notice also that the meaning of
    + * &gt;&gt; has changed: it now refers to both the tens and the ones digits. The meaning of
    + * both substitutions depends on the rule's base value. The base value determines the rule's <em>divisor,</em>
    + * which is the highest power of 10 that is less than or equal to the base value (the user
    + * can change this). To fill in the substitutions, the formatter divides the number being
    + * formatted by the divisor. The integral quotient is used to fill in the &lt;&lt;
    + * substitution, and the remainder is used to fill in the &gt;&gt; substitution. The meaning
    + * of the brackets changes similarly: text in brackets is omitted if the value being
    + * formatted is an even multiple of the rule's divisor. The rules are applied recursively, so
    + * if a substitution is filled in with text that includes another substitution, that
    + * substitution is also filled in.</p>
    + *
    + * <p>This rule covers values up to 999, at which point we add another rule:</p>
    + *
    + * <pre>1000: &lt;&lt; thousand[ &gt;&gt;];</pre>
    + *
    + * <p>Again, the meanings of the brackets and substitution tokens shift because the rule's
    + * base value is a higher power of 10, changing the rule's divisor. This rule can actually be
    + * used all the way up to 999,999. This allows us to finish out the rules as follows:</p>
    + *
    + * <pre> 1,000,000: &lt;&lt; million[ &gt;&gt;];
    + * 1,000,000,000: &lt;&lt; billion[ &gt;&gt;];
    + * 1,000,000,000,000: &lt;&lt; trillion[ &gt;&gt;];
    + * 1,000,000,000,000,000: OUT OF RANGE!;</pre>
    + *
    + * <p>Commas, periods, and spaces can be used in the base values to improve legibility and
    + * are ignored by the rule parser. The last rule in the list is customarily treated as an
    + * &quot;overflow rule,&quot; applying to everything from its base value on up, and often (as
    + * in this example) being used to print out an error message or default representation.
    + * Notice also that the size of the major groupings in large numbers is controlled by the
    + * spacing of the rules: because in English we group numbers by thousand, the higher rules
    + * are separated from each other by a factor of 1,000.</p>
    + *
    + * <p>To see how these rules actually work in practice, consider the following example:
    + * Formatting 25,430 with this rule set would work like this:</p>
    + *
    + * <table border="0" width="100%">
    + * <tr>
    + * <td><strong>&lt;&lt; thousand &gt;&gt;</strong></td>
    + * <td>[the rule whose base value is 1,000 is applicable to 25,340]</td>
    + * </tr>
    + * <tr>
    + * <td><strong>twenty-&gt;&gt;</strong> thousand &gt;&gt;</td>
    + * <td>[25,340 over 1,000 is 25. The rule for 20 applies.]</td>
    + * </tr>
    + * <tr>
    + * <td>twenty-<strong>five</strong> thousand &gt;&gt;</td>
    + * <td>[25 mod 10 is 5. The rule for 5 is &quot;five.&quot;</td>
    + * </tr>
    + * <tr>
    + * <td>twenty-five thousand <strong>&lt;&lt; hundred &gt;&gt;</strong></td>
    + * <td>[25,340 mod 1,000 is 340. The rule for 100 applies.]</td>
    + * </tr>
    + * <tr>
    + * <td>twenty-five thousand <strong>three</strong> hundred &gt;&gt;</td>
    + * <td>[340 over 100 is 3. The rule for 3 is &quot;three.&quot;]</td>
    + * </tr>
    + * <tr>
    + * <td>twenty-five thousand three hundred <strong>forty</strong></td>
    + * <td>[340 mod 100 is 40. The rule for 40 applies. Since 40 divides
    + * evenly by 10, the hyphen and substitution in the brackets are omitted.]</td>
    + * </tr>
    + * </table>
    + *
    + * <p>The above syntax suffices only to format positive integers. To format negative numbers,
    + * we add a special rule:</p>
    + *
    + * <pre>-x: minus &gt;&gt;;</pre>
    + *
    + * <p>This is called a <em>negative-number rule,</em> and is identified by &quot;-x&quot;
    + * where the base value would be. This rule is used to format all negative numbers. the
    + * &gt;&gt; token here means &quot;find the number's absolute value, format it with these
    + * rules, and put the result here.&quot;</p>
    + *
    + * <p>We also add a special rule called a <em>fraction rule </em>for numbers with fractional
    + * parts:</p>
    + *
    + * <pre>x.x: &lt;&lt; point &gt;&gt;;</pre>
    + *
    + * <p>This rule is used for all positive non-integers (negative non-integers pass through the
    + * negative-number rule first and then through this rule). Here, the &lt;&lt; token refers to
    + * the number's integral part, and the &gt;&gt; to the number's fractional part. The
    + * fractional part is formatted as a series of single-digit numbers (e.g., 123.456 would be
    + * formatted as &quot;one hundred twenty-three point four five six&quot;).</p>
    + *
    + * <p>To see how this rule syntax is applied to various languages, examine the resource data.</p>
    + *
    + * <p>There is actually much more flexibility built into the rule language than the
    + * description above shows. A formatter may own multiple rule sets, which can be selected by
    + * the caller, and which can use each other to fill in their substitutions. Substitutions can
    + * also be filled in with digits, using a DecimalFormat object. There is syntax that can be
    + * used to alter a rule's divisor in various ways. And there is provision for much more
    + * flexible fraction handling. A complete description of the rule syntax follows:</p>
    + *
    + * <hr>
    + *
    + * <p>The description of a <tt>RuleBasedNumberFormat</tt>'s behavior consists of one or more <em>rule
    + * sets.</em> Each rule set consists of a name, a colon, and a list of <em>rules.</em> A rule
    + * set name must begin with a % sign. Rule sets with names that begin with a single % sign
    + * are <em>public:</em> the caller can specify that they be used to format and parse numbers.
    + * Rule sets with names that begin with %% are <em>private:</em> they exist only for the use
    + * of other rule sets. If a formatter only has one rule set, the name may be omitted.</p>
    + *
    + * <p>The user can also specify a special &quot;rule set&quot; named <tt>%%lenient-parse</tt>.
    + * The body of <tt>%%lenient-parse</tt> isn't a set of number-formatting rules, but a <tt>RuleBasedCollator</tt>
    + * description which is used to define equivalences for lenient parsing. For more information
    + * on the syntax, see <tt>RuleBasedCollator</tt>. For more information on lenient parsing,
    + * see <tt>setLenientParse()</tt>. <em>Note:</em> symbols that have syntactic meaning
    + * in collation rules, such as '&amp;', have no particular meaning when appearing outside
    + * of the <tt>lenient-parse</tt> rule set.</p>
    + *
    + * <p>The body of a rule set consists of an ordered, semicolon-delimited list of <em>rules.</em>
    + * Internally, every rule has a base value, a divisor, rule text, and zero, one, or two <em>substitutions.</em>
    + * These parameters are controlled by the description syntax, which consists of a <em>rule
    + * descriptor,</em> a colon, and a <em>rule body.</em></p>
    + *
    + * <p>A rule descriptor can take one of the following forms (text in <em>italics</em> is the
    + * name of a token):</p>
    + *
    + * <table border="0" width="100%">
    + * <tr>
    + * <td><em>bv</em>:</td>
    + * <td><em>bv</em> specifies the rule's base value. <em>bv</em> is a decimal
    + * number expressed using ASCII digits. <em>bv</em> may contain spaces, period, and commas,
    + * which are ignored. The rule's divisor is the highest power of 10 less than or equal to
    + * the base value.</td>
    + * </tr>
    + * <tr>
    + * <td><em>bv</em>/<em>rad</em>:</td>
    + * <td><em>bv</em> specifies the rule's base value. The rule's divisor is the
    + * highest power of <em>rad</em> less than or equal to the base value.</td>
    + * </tr>
    + * <tr>
    + * <td><em>bv</em>&gt;:</td>
    + * <td><em>bv</em> specifies the rule's base value. To calculate the divisor,
    + * let the radix be 10, and the exponent be the highest exponent of the radix that yields a
    + * result less than or equal to the base value. Every &gt; character after the base value
    + * decreases the exponent by 1. If the exponent is positive or 0, the divisor is the radix
    + * raised to the power of the exponent; otherwise, the divisor is 1.</td>
    + * </tr>
    + * <tr>
    + * <td><em>bv</em>/<em>rad</em>&gt;:</td>
    + * <td><em>bv</em> specifies the rule's base value. To calculate the divisor,
    + * let the radix be <em>rad</em>, and the exponent be the highest exponent of the radix that
    + * yields a result less than or equal to the base value. Every &gt; character after the radix
    + * decreases the exponent by 1. If the exponent is positive or 0, the divisor is the radix
    + * raised to the power of the exponent; otherwise, the divisor is 1.</td>
    + * </tr>
    + * <tr>
    + * <td>-x:</td>
    + * <td>The rule is a negative-number rule.</td>
    + * </tr>
    + * <tr>
    + * <td>x.x:</td>
    + * <td>The rule is an <em>improper fraction rule.</em></td>
    + * </tr>
    + * <tr>
    + * <td>0.x:</td>
    + * <td>The rule is a <em>proper fraction rule.</em></td>
    + * </tr>
    + * <tr>
    + * <td>x.0:</td>
    + * <td>The rule is a <em>master rule.</em></td>
    + * </tr>
    + * <tr>
    + * <td><em>nothing</em></td>
    + * <td>If the rule's rule descriptor is left out, the base value is one plus the
    + * preceding rule's base value (or zero if this is the first rule in the list) in a normal
    + * rule set.&nbsp; In a fraction rule set, the base value is the same as the preceding rule's
    + * base value.</td>
    + * </tr>
    + * </table>
    + *
    + * <p>A rule set may be either a regular rule set or a <em>fraction rule set,</em> depending
    + * on whether it is used to format a number's integral part (or the whole number) or a
    + * number's fractional part. Using a rule set to format a rule's fractional part makes it a
    + * fraction rule set.</p>
    + *
    + * <p>Which rule is used to format a number is defined according to one of the following
    + * algorithms: If the rule set is a regular rule set, do the following:
    + *
    + * <ul>
    + * <li>If the rule set includes a master rule (and the number was passed in as a <tt>double</tt>),
    + * use the master rule.&nbsp; (If the number being formatted was passed in as a <tt>long</tt>,
    + * the master rule is ignored.)</li>
    + * <li>If the number is negative, use the negative-number rule.</li>
    + * <li>If the number has a fractional part and is greater than 1, use the improper fraction
    + * rule.</li>
    + * <li>If the number has a fractional part and is between 0 and 1, use the proper fraction
    + * rule.</li>
    + * <li>Binary-search the rule list for the rule with the highest base value less than or equal
    + * to the number. If that rule has two substitutions, its base value is not an even multiple
    + * of its divisor, and the number <em>is</em> an even multiple of the rule's divisor, use the
    + * rule that precedes it in the rule list. Otherwise, use the rule itself.</li>
    + * </ul>
    + *
    + * <p>If the rule set is a fraction rule set, do the following:
    + *
    + * <ul>
    + * <li>Ignore negative-number and fraction rules.</li>
    + * <li>For each rule in the list, multiply the number being formatted (which will always be
    + * between 0 and 1) by the rule's base value. Keep track of the distance between the result
    + * the nearest integer.</li>
    + * <li>Use the rule that produced the result closest to zero in the above calculation. In the
    + * event of a tie or a direct hit, use the first matching rule encountered. (The idea here is
    + * to try each rule's base value as a possible denominator of a fraction. Whichever
    + * denominator produces the fraction closest in value to the number being formatted wins.) If
    + * the rule following the matching rule has the same base value, use it if the numerator of
    + * the fraction is anything other than 1; if the numerator is 1, use the original matching
    + * rule. (This is to allow singular and plural forms of the rule text without a lot of extra
    + * hassle.)</li>
    + * </ul>
    + *
    + * <p>A rule's body consists of a string of characters terminated by a semicolon. The rule
    + * may include zero, one, or two <em>substitution tokens,</em> and a range of text in
    + * brackets. The brackets denote optional text (and may also include one or both
    + * substitutions). The exact meanings of the substitution tokens, and under what conditions
    + * optional text is omitted, depend on the syntax of the substitution token and the context.
    + * The rest of the text in a rule body is literal text that is output when the rule matches
    + * the number being formatted.</p>
    + *
    + * <p>A substitution token begins and ends with a <em>token character.</em> The token
    + * character and the context together specify a mathematical operation to be performed on the
    + * number being formatted. An optional <em>substitution descriptor </em>specifies how the
    + * value resulting from that operation is used to fill in the substitution. The position of
    + * the substitution token in the rule body specifies the location of the resultant text in
    + * the original rule text.</p>
    + *
    + * <p>The meanings of the substitution token characters are as follows:</p>
    + *
    + * <table border="0" width="100%">
    + * <tr>
    + * <td>&gt;&gt;</td>
    + * <td>in normal rule</td>
    + * <td>Divide the number by the rule's divisor and format the remainder</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in negative-number rule</td>
    + * <td>Find the absolute value of the number and format the result</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in fraction or master rule</td>
    + * <td>Isolate the number's fractional part and format it.</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in rule in fraction rule set</td>
    + * <td>Not allowed.</td>
    + * </tr>
    + * <tr>
    + * <td>&gt;&gt;&gt;</td>
    + * <td>in normal rule</td>
    + * <td>Divide the number by the rule's divisor and format the remainder,
    + * but bypass the normal rule-selection process and just use the
    + * rule that precedes this one in this rule list.</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in all other rules</td>
    + * <td>Not allowed.</td>
    + * </tr>
    + * <tr>
    + * <td>&lt;&lt;</td>
    + * <td>in normal rule</td>
    + * <td>Divide the number by the rule's divisor and format the quotient</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in negative-number rule</td>
    + * <td>Not allowed.</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in fraction or master rule</td>
    + * <td>Isolate the number's integral part and format it.</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in rule in fraction rule set</td>
    + * <td>Multiply the number by the rule's base value and format the result.</td>
    + * </tr>
    + * <tr>
    + * <td>==</td>
    + * <td>in all rule sets</td>
    + * <td>Format the number unchanged</td>
    + * </tr>
    + * <tr>
    + * <td>[]</td>
    + * <td>in normal rule</td>
    + * <td>Omit the optional text if the number is an even multiple of the rule's divisor</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in negative-number rule</td>
    + * <td>Not allowed.</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in improper-fraction rule</td>
    + * <td>Omit the optional text if the number is between 0 and 1 (same as specifying both an
    + * x.x rule and a 0.x rule)</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in master rule</td>
    + * <td>Omit the optional text if the number is an integer (same as specifying both an x.x
    + * rule and an x.0 rule)</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in proper-fraction rule</td>
    + * <td>Not allowed.</td>
    + * </tr>
    + * <tr>
    + * <td></td>
    + * <td>in rule in fraction rule set</td>
    + * <td>Omit the optional text if multiplying the number by the rule's base value yields 1.</td>
    + * </tr>
    + * </table>
    + *
    + * <p>The substitution descriptor (i.e., the text between the token characters) may take one
    + * of three forms:</p>
    + *
    + * <table border="0" width="100%">
    + * <tr>
    + * <td>a rule set name</td>
    + * <td>Perform the mathematical operation on the number, and format the result using the
    + * named rule set.</td>
    + * </tr>
    + * <tr>
    + * <td>a DecimalFormat pattern</td>
    + * <td>Perform the mathematical operation on the number, and format the result using a
    + * DecimalFormat with the specified pattern.&nbsp; The pattern must begin with 0 or #.</td>
    + * </tr>
    + * <tr>
    + * <td>nothing</td>
    + * <td>Perform the mathematical operation on the number, and format the result using the rule
    + * set containing the current rule, except:
    + * <ul>
    + * <li>You can't have an empty substitution descriptor with a == substitution.</li>
    + * <li>If you omit the substitution descriptor in a &gt;&gt; substitution in a fraction rule,
    + * format the result one digit at a time using the rule set containing the current rule.</li>
    + * <li>If you omit the substitution descriptor in a &lt;&lt; substitution in a rule in a
    + * fraction rule set, format the result using the default rule set for this formatter.</li>
    + * </ul>
    + * </td>
    + * </tr>
    + * </table>
    + *
    + * <p>Whitespace is ignored between a rule set name and a rule set body, between a rule
    + * descriptor and a rule body, or between rules. If a rule body begins with an apostrophe,
    + * the apostrophe is ignored, but all text after it becomes significant (this is how you can
    + * have a rule's rule text begin with whitespace). There is no escape function: the semicolon
    + * is not allowed in rule set names or in rule text, and the colon is not allowed in rule set
    + * names. The characters beginning a substitution token are always treated as the beginning
    + * of a substitution token.</p>
    + *
    + * <p>See the resource data and the demo program for annotated examples of real rule sets
    + * using these features.</p>
    + *
    + * <p><em>User subclasses are not supported.</em> While clients may write
    + * subclasses, such code will not necessarily work and will not be
    + * guaranteed to work stably from release to release.
    + *
    + * <p><b>Localizations</b></p>
    + * <p>Constructors are available that allow the specification of localizations for the
    + * public rule sets (and also allow more control over what public rule sets are available).
    + * Localization data is represented as a textual description. The description represents
    + * an array of arrays of string. The first element is an array of the public rule set names,
    + * each of these must be one of the public rule set names that appear in the rules. Only
    + * names in this array will be treated as public rule set names by the API. Each subsequent
    + * element is an array of localizations of these names. The first element of one of these
    + * subarrays is the locale name, and the remaining elements are localizations of the
    + * public rule set names, in the same order as they were listed in the first arrray.</p>
    + * <p>In the syntax, angle brackets '<', '>' are used to delimit the arrays, and comma ',' is used
    + * to separate elements of an array. Whitespace is ignored, unless quoted.</p>
    + * <p>For example:<pre>
    + * < < %foo, %bar, %baz >,
    + * < en, Foo, Bar, Baz >,
    + * < fr, 'le Foo', 'le Bar', 'le Baz' >
    + * < zh, \\u7532, \\u4e59, \\u4e19 > >
    + * </pre></p>
    + * @author Richard Gillam
    + * @see NumberFormat
    + * @see DecimalFormat
    + * @stable ICU 2.0
    + */
    +class U_I18N_API RuleBasedNumberFormat : public NumberFormat {
    +public:
    +
    + //-----------------------------------------------------------------------
    + // constructors
    + //-----------------------------------------------------------------------
    +
    + /**
    + * Creates a RuleBasedNumberFormat that behaves according to the description
    + * passed in. The formatter uses the default locale.
    + * @param rules A description of the formatter's desired behavior.
    + * See the class documentation for a complete explanation of the description
    + * syntax.
    + * @param perror The parse error if an error was encountered.
    + * @param status The status indicating whether the constructor succeeded.
    + * @stable ICU 3.2
    + */
    + RuleBasedNumberFormat(const UnicodeString& rules, UParseError& perror, UErrorCode& status);
    +
    + /**
    + * Creates a RuleBasedNumberFormat that behaves according to the description
    + * passed in. The formatter uses the default locale.
    + * <p>
    + * The localizations data provides information about the public
    + * rule sets and their localized display names for different
    + * locales. The first element in the list is an array of the names
    + * of the public rule sets. The first element in this array is
    + * the initial default ruleset. The remaining elements in the
    + * list are arrays of localizations of the names of the public
    + * rule sets. Each of these is one longer than the initial array,
    + * with the first String being the ULocale ID, and the remaining
    + * Strings being the localizations of the rule set names, in the
    + * same order as the initial array. Arrays are NULL-terminated.
    + * @param rules A description of the formatter's desired behavior.
    + * See the class documentation for a complete explanation of the description
    + * syntax.
    + * @param localizations the localization information.
    + * names in the description. These will be copied by the constructor.
    + * @param perror The parse error if an error was encountered.
    + * @param status The status indicating whether the constructor succeeded.
    + * @stable ICU 3.2
    + */
    + RuleBasedNumberFormat(const UnicodeString& rules, const UnicodeString& localizations,
    + UParseError& perror, UErrorCode& status);
    +
    + /**
    + * Creates a RuleBasedNumberFormat that behaves according to the rules
    + * passed in. The formatter uses the specified locale to determine the
    + * characters to use when formatting numerals, and to define equivalences
    + * for lenient parsing.
    + * @param rules The formatter rules.
    + * See the class documentation for a complete explanation of the rule
    + * syntax.
    + * @param locale A locale that governs which characters are used for
    + * formatting values in numerals and which characters are equivalent in
    + * lenient parsing.
    + * @param perror The parse error if an error was encountered.
    + * @param status The status indicating whether the constructor succeeded.
    + * @stable ICU 2.0
    + */
    + RuleBasedNumberFormat(const UnicodeString& rules, const Locale& locale,
    + UParseError& perror, UErrorCode& status);
    +
    + /**
    + * Creates a RuleBasedNumberFormat that behaves according to the description
    + * passed in. The formatter uses the default locale.
    + * <p>
    + * The localizations data provides information about the public
    + * rule sets and their localized display names for different
    + * locales. The first element in the list is an array of the names
    + * of the public rule sets. The first element in this array is
    + * the initial default ruleset. The remaining elements in the
    + * list are arrays of localizations of the names of the public
    + * rule sets. Each of these is one longer than the initial array,
    + * with the first String being the ULocale ID, and the remaining
    + * Strings being the localizations of the rule set names, in the
    + * same order as the initial array. Arrays are NULL-terminated.
    + * @param rules A description of the formatter's desired behavior.
    + * See the class documentation for a complete explanation of the description
    + * syntax.
    + * @param localizations a list of localizations for the rule set
    + * names in the description. These will be copied by the constructor.
    + * @param locale A locale that governs which characters are used for
    + * formatting values in numerals and which characters are equivalent in
    + * lenient parsing.
    + * @param perror The parse error if an error was encountered.
    + * @param status The status indicating whether the constructor succeeded.
    + * @stable ICU 3.2
    + */
    + RuleBasedNumberFormat(const UnicodeString& rules, const UnicodeString& localizations,
    + const Locale& locale, UParseError& perror, UErrorCode& status);
    +
    + /**
    + * Creates a RuleBasedNumberFormat from a predefined ruleset. The selector
    + * code choosed among three possible predefined formats: spellout, ordinal,
    + * and duration.
    + * @param tag A selector code specifying which kind of formatter to create for that
    + * locale. There are three legal values: URBNF_SPELLOUT, which creates a formatter that
    + * spells out a value in words in the desired language, URBNF_ORDINAL, which attaches
    + * an ordinal suffix from the desired language to the end of a number (e.g. "123rd"),
    + * and URBNF_DURATION, which formats a duration in seconds as hours, minutes, and seconds.
    + * @param locale The locale for the formatter.
    + * @param status The status indicating whether the constructor succeeded.
    + * @stable ICU 2.0
    + */
    + RuleBasedNumberFormat(URBNFRuleSetTag tag, const Locale& locale, UErrorCode& status);
    +
    + //-----------------------------------------------------------------------
    + // boilerplate
    + //-----------------------------------------------------------------------
    +
    + /**
    + * Copy constructor
    + * @param rhs the object to be copied from.
    + * @stable ICU 2.6
    + */
    + RuleBasedNumberFormat(const RuleBasedNumberFormat& rhs);
    +
    + /**
    + * Assignment operator
    + * @param rhs the object to be copied from.
    + * @stable ICU 2.6
    + */
    + RuleBasedNumberFormat& operator=(const RuleBasedNumberFormat& rhs);
    +
    + /**
    + * Release memory allocated for a RuleBasedNumberFormat when you are finished with it.
    + * @stable ICU 2.6
    + */
    + virtual ~RuleBasedNumberFormat();
    +
    + /**
    + * Clone this object polymorphically. The caller is responsible
    + * for deleting the result when done.
    + * @return A copy of the object.
    + * @stable ICU 2.6
    + */
    + virtual Format* clone(void) const;
    +
    + /**
    + * Return true if the given Format objects are semantically equal.
    + * Objects of different subclasses are considered unequal.
    + * @param other the object to be compared with.
    + * @return true if the given Format objects are semantically equal.
    + * @stable ICU 2.6
    + */
    + virtual UBool operator==(const Format& other) const;
    +
    +//-----------------------------------------------------------------------
    +// public API functions
    +//-----------------------------------------------------------------------
    +
    + /**
    + * return the rules that were provided to the RuleBasedNumberFormat.
    + * @return the result String that was passed in
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString getRules() const;
    +
    + /**
    + * Return the number of public rule set names.
    + * @return the number of public rule set names.
    + * @stable ICU 2.0
    + */
    + virtual int32_t getNumberOfRuleSetNames() const;
    +
    + /**
    + * Return the name of the index'th public ruleSet. If index is not valid,
    + * the function returns null.
    + * @param index the index of the ruleset
    + * @return the name of the index'th public ruleSet.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString getRuleSetName(int32_t index) const;
    +
    + /**
    + * Return the number of locales for which we have localized rule set display names.
    + * @return the number of locales for which we have localized rule set display names.
    + * @stable ICU 3.2
    + */
    + virtual int32_t getNumberOfRuleSetDisplayNameLocales(void) const;
    +
    + /**
    + * Return the index'th display name locale.
    + * @param index the index of the locale
    + * @param status set to a failure code when this function fails
    + * @return the locale
    + * @see #getNumberOfRuleSetDisplayNameLocales
    + * @stable ICU 3.2
    + */
    + virtual Locale getRuleSetDisplayNameLocale(int32_t index, UErrorCode& status) const;
    +
    + /**
    + * Return the rule set display names for the provided locale. These are in the same order
    + * as those returned by getRuleSetName. The locale is matched against the locales for
    + * which there is display name data, using normal fallback rules. If no locale matches,
    + * the default display names are returned. (These are the internal rule set names minus
    + * the leading '%'.)
    + * @param index the index of the rule set
    + * @param locale the locale (returned by getRuleSetDisplayNameLocales) for which the localized
    + * display name is desired
    + * @return the display name for the given index, which might be bogus if there is an error
    + * @see #getRuleSetName
    + * @stable ICU 3.2
    + */
    + virtual UnicodeString getRuleSetDisplayName(int32_t index,
    + const Locale& locale = Locale::getDefault());
    +
    + /**
    + * Return the rule set display name for the provided rule set and locale.
    + * The locale is matched against the locales for which there is display name data, using
    + * normal fallback rules. If no locale matches, the default display name is returned.
    + * @return the display name for the rule set
    + * @stable ICU 3.2
    + * @see #getRuleSetDisplayName
    + */
    + virtual UnicodeString getRuleSetDisplayName(const UnicodeString& ruleSetName,
    + const Locale& locale = Locale::getDefault());
    +
    + /**
    + * Formats the specified 32-bit number using the default ruleset.
    + * @param number The number to format.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @return A textual representation of the number.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(int32_t number,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos) const;
    +
    + /**
    + * Formats the specified 64-bit number using the default ruleset.
    + * @param number The number to format.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @return A textual representation of the number.
    + * @stable ICU 2.1
    + */
    + virtual UnicodeString& format(int64_t number,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos) const;
    + /**
    + * Formats the specified number using the default ruleset.
    + * @param number The number to format.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @return A textual representation of the number.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(double number,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos) const;
    +
    + /**
    + * Formats the specified number using the named ruleset.
    + * @param number The number to format.
    + * @param ruleSetName The name of the rule set to format the number with.
    + * This must be the name of a valid public rule set for this formatter.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @param status the status
    + * @return A textual representation of the number.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(int32_t number,
    + const UnicodeString& ruleSetName,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    + /**
    + * Formats the specified 64-bit number using the named ruleset.
    + * @param number The number to format.
    + * @param ruleSetName The name of the rule set to format the number with.
    + * This must be the name of a valid public rule set for this formatter.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @param status the status
    + * @return A textual representation of the number.
    + * @stable ICU 2.1
    + */
    + virtual UnicodeString& format(int64_t number,
    + const UnicodeString& ruleSetName,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    + /**
    + * Formats the specified number using the named ruleset.
    + * @param number The number to format.
    + * @param ruleSetName The name of the rule set to format the number with.
    + * This must be the name of a valid public rule set for this formatter.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @param status the status
    + * @return A textual representation of the number.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(double number,
    + const UnicodeString& ruleSetName,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    +
    + /**
    + * Formats the specified number using the default ruleset.
    + * @param obj The number to format.
    + * @param toAppendTo the string that will hold the (appended) result
    + * @param pos the fieldposition
    + * @param status the status
    + * @return A textual representation of the number.
    + * @stable ICU 2.0
    + */
    + virtual UnicodeString& format(const Formattable& obj,
    + UnicodeString& toAppendTo,
    + FieldPosition& pos,
    + UErrorCode& status) const;
    + /**
    + * Redeclared Format method.
    + * @param obj the object to be formatted.
    + * @param result Output param which will receive the formatted string.
    + * @param status Output param set to success/failure code
    + * @return A reference to 'result'.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(const Formattable& obj,
    + UnicodeString& result,
    + UErrorCode& status) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * @param number the double value to be formatted.
    + * @param output Output param which will receive the formatted string.
    + * @return A reference to 'output'.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(double number,
    + UnicodeString& output) const;
    +
    + /**
    + * Redeclared NumberFormat method.
    + * @param number the long value to be formatted.
    + * @param output Output param which will receive the formatted string.
    + * @return A reference to 'output'.
    + * @stable ICU 2.0
    + */
    + UnicodeString& format(int32_t number,
    + UnicodeString& output) const;
    +
    + /**
    + * Parses the specfied string, beginning at the specified position, according
    + * to this formatter's rules. This will match the string against all of the
    + * formatter's public rule sets and return the value corresponding to the longest
    + * parseable substring. This function's behavior is affected by the lenient
    + * parse mode.
    + * @param text The string to parse
    + * @param result the result of the parse, either a double or a long.
    + * @param parsePosition On entry, contains the position of the first character
    + * in "text" to examine. On exit, has been updated to contain the position
    + * of the first character in "text" that wasn't consumed by the parse.
    + * @see #setLenient
    + * @stable ICU 2.0
    + */
    + virtual void parse(const UnicodeString& text,
    + Formattable& result,
    + ParsePosition& parsePosition) const;
    +
    +
    + /**
    + * Redeclared Format method.
    + * @param text The string to parse
    + * @param result the result of the parse, either a double or a long.
    + * @param status Output param set to failure code when a problem occurs.
    + * @stable ICU 2.0
    + */
    + virtual inline void parse(const UnicodeString& text,
    + Formattable& result,
    + UErrorCode& status) const;
    +
    +#if !UCONFIG_NO_COLLATION
    +
    + /**
    + * Turns lenient parse mode on and off.
    + *
    + * When in lenient parse mode, the formatter uses a Collator for parsing the text.
    + * Only primary differences are treated as significant. This means that case
    + * differences, accent differences, alternate spellings of the same letter
    + * (e.g., ae and a-umlaut in German), ignorable characters, etc. are ignored in
    + * matching the text. In many cases, numerals will be accepted in place of words
    + * or phrases as well.
    + *
    + * For example, all of the following will correctly parse as 255 in English in
    + * lenient-parse mode:
    + * <br>"two hundred fifty-five"
    + * <br>"two hundred fifty five"
    + * <br>"TWO HUNDRED FIFTY-FIVE"
    + * <br>"twohundredfiftyfive"
    + * <br>"2 hundred fifty-5"
    + *
    + * The Collator used is determined by the locale that was
    + * passed to this object on construction. The description passed to this object
    + * on construction may supply additional collation rules that are appended to the
    + * end of the default collator for the locale, enabling additional equivalences
    + * (such as adding more ignorable characters or permitting spelled-out version of
    + * symbols; see the demo program for examples).
    + *
    + * It's important to emphasize that even strict parsing is relatively lenient: it
    + * will accept some text that it won't produce as output. In English, for example,
    + * it will correctly parse "two hundred zero" and "fifteen hundred".
    + *
    + * @param enabled If true, turns lenient-parse mode on; if false, turns it off.
    + * @see RuleBasedCollator
    + * @stable ICU 2.0
    + */
    + virtual void setLenient(UBool enabled);
    +
    + /**
    + * Returns true if lenient-parse mode is turned on. Lenient parsing is off
    + * by default.
    + * @return true if lenient-parse mode is turned on.
    + * @see #setLenient
    + * @stable ICU 2.0
    + */
    + virtual inline UBool isLenient(void) const;
    +
    +#endif
    +
    + /**
    + * Override the default rule set to use. If ruleSetName is null, reset
    + * to the initial default rule set. If the rule set is not a public rule set name,
    + * U_ILLEGAL_ARGUMENT_ERROR is returned in status.
    + * @param ruleSetName the name of the rule set, or null to reset the initial default.
    + * @param status set to failure code when a problem occurs.
    + * @stable ICU 2.6
    + */
    + virtual void setDefaultRuleSet(const UnicodeString& ruleSetName, UErrorCode& status);
    +
    + /**
    + * Return the name of the current default rule set. If the current rule set is
    + * not public, returns a bogus (and empty) UnicodeString.
    + * @return the name of the current default rule set
    + * @stable ICU 3.0
    + */
    + virtual UnicodeString getDefaultRuleSetName() const;
    +
    +public:
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for this class.
    + *
    + * @stable ICU 2.8
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * ICU "poor man's RTTI", returns a UClassID for the actual class.
    + *
    + * @stable ICU 2.8
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +
    +private:
    + RuleBasedNumberFormat(); // default constructor not implemented
    +
    + // this will ref the localizations if they are not NULL
    + // caller must deref to get adoption
    + RuleBasedNumberFormat(const UnicodeString& description, LocalizationInfo* localizations,
    + const Locale& locale, UParseError& perror, UErrorCode& status);
    +
    + void init(const UnicodeString& rules, LocalizationInfo* localizations, UParseError& perror, UErrorCode& status);
    + void dispose();
    + void stripWhitespace(UnicodeString& src);
    + void initDefaultRuleSet();
    + void format(double number, NFRuleSet& ruleSet);
    + NFRuleSet* findRuleSet(const UnicodeString& name, UErrorCode& status) const;
    +
    + /* friend access */
    + friend class NFSubstitution;
    + friend class NFRule;
    + friend class FractionalPartSubstitution;
    +
    + inline NFRuleSet * getDefaultRuleSet() const;
    + Collator * getCollator() const;
    + DecimalFormatSymbols * getDecimalFormatSymbols() const;
    +
    +private:
    + NFRuleSet **ruleSets;
    + NFRuleSet *defaultRuleSet;
    + Locale locale;
    + Collator* collator;
    + DecimalFormatSymbols* decimalFormatSymbols;
    + UBool lenient;
    + UnicodeString* lenientParseRules;
    + LocalizationInfo* localizations;
    +};
    +
    +// ---------------
    +
    +inline UnicodeString&
    +RuleBasedNumberFormat::format(const Formattable& obj,
    + UnicodeString& result,
    + UErrorCode& status) const
    +{
    + // Don't use Format:: - use immediate base class only,
    + // in case immediate base modifies behavior later.
    + // dlf - the above comment is bogus, if there were a reason to modify
    + // it, it would be virtual, and there's no reason because it is
    + // a one-line macro in NumberFormat anyway, just like this one.
    + return NumberFormat::format(obj, result, status);
    +}
    +
    +inline UnicodeString&
    +RuleBasedNumberFormat::format(double number, UnicodeString& output) const {
    + FieldPosition pos(0);
    + return format(number, output, pos);
    +}
    +
    +inline UnicodeString&
    +RuleBasedNumberFormat::format(int32_t number, UnicodeString& output) const {
    + FieldPosition pos(0);
    + return format(number, output, pos);
    +}
    +
    +inline void
    +RuleBasedNumberFormat::parse(const UnicodeString& text, Formattable& result, UErrorCode& status) const
    +{
    + NumberFormat::parse(text, result, status);
    +}
    +
    +#if !UCONFIG_NO_COLLATION
    +
    +inline UBool
    +RuleBasedNumberFormat::isLenient(void) const {
    + return lenient;
    +}
    +
    +#endif
    +
    +inline NFRuleSet*
    +RuleBasedNumberFormat::getDefaultRuleSet() const {
    + return defaultRuleSet;
    +}
    +
    +U_NAMESPACE_END
    +
    +/* U_HAVE_RBNF */
    +#endif
    +
    +/* RBNF_H */
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/rbtz.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/rbtz.h b/platform/osx/icu/unicode/rbtz.h
    new file mode 100644
    index 0000000..78215f3
    --- /dev/null
    +++ b/platform/osx/icu/unicode/rbtz.h
    @@ -0,0 +1,361 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2007-2008, International Business Machines Corporation and *
    +* others. All Rights Reserved. *
    +*******************************************************************************
    +*/
    +#ifndef RBTZ_H
    +#define RBTZ_H
    +
    +#include "unicode/utypes.h"
    +
    +/**
    + * \file
    + * \brief C++ API: Rule based customizable time zone
    + */
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +#include "unicode/basictz.h"
    +#include "unicode/unistr.h"
    +
    +U_NAMESPACE_BEGIN
    +
    +// forward declaration
    +class UVector;
    +struct Transition;
    +
    +/**
    + * a BasicTimeZone subclass implemented in terms of InitialTimeZoneRule and TimeZoneRule instances
    + * @see BasicTimeZone
    + * @see InitialTimeZoneRule
    + * @see TimeZoneRule
    + */
    +class U_I18N_API RuleBasedTimeZone : public BasicTimeZone {
    +public:
    + /**
    + * Constructs a <code>RuleBasedTimeZone</code> object with the ID and the
    + * <code>InitialTimeZoneRule</code>. The input <code>InitialTimeZoneRule</code>
    + * is adopted by this <code>RuleBasedTimeZone</code>, thus the caller must not
    + * delete it.
    + * @param id The time zone ID.
    + * @param initialRule The initial time zone rule.
    + * @stable ICU 4.0
    + */
    + RuleBasedTimeZone(const UnicodeString& id, InitialTimeZoneRule* initialRule);
    +
    + /**
    + * Copy constructor.
    + * @param source The RuleBasedTimeZone object to be copied.
    + * @stable ICU 4.0
    + */
    + RuleBasedTimeZone(const RuleBasedTimeZone& source);
    +
    + /**
    + * Destructor.
    + * @stable ICU 4.0
    + */
    + virtual ~RuleBasedTimeZone();
    +
    + /**
    + * Assignment operator.
    + * @param right The object to be copied.
    + * @stable ICU 4.0
    + */
    + RuleBasedTimeZone& operator=(const RuleBasedTimeZone& right);
    +
    + /**
    + * Return true if the given <code>TimeZone</code> objects are
    + * semantically equal. Objects of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZone</code> objects are
    + *semantically equal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator==(const TimeZone& that) const;
    +
    + /**
    + * Return true if the given <code>TimeZone</code> objects are
    + * semantically unequal. Objects of different subclasses are considered unequal.
    + * @param that The object to be compared with.
    + * @return true if the given <code>TimeZone</code> objects are
    + * semantically unequal.
    + * @stable ICU 4.0
    + */
    + virtual UBool operator!=(const TimeZone& that) const;
    +
    + /**
    + * Adds the <code>TimeZoneRule</code> which represents time transitions.
    + * The <code>TimeZoneRule</code> must have start times, that is, the result
    + * of isTransitionRule() must be true. Otherwise, U_ILLEGAL_ARGUMENT_ERROR
    + * is set to the error code.
    + * The input <code>TimeZoneRule</code> is adopted by this
    + * <code>RuleBasedTimeZone</code> on successful completion of this method,
    + * thus, the caller must not delete it when no error is returned.
    + * After all rules are added, the caller must call complete() method to
    + * make this <code>RuleBasedTimeZone</code> ready to handle common time
    + * zone functions.
    + * @param rule The <code>TimeZoneRule</code>.
    + * @param status Output param to filled in with a success or an error.
    + * @stable ICU 4.0
    + */
    + void addTransitionRule(TimeZoneRule* rule, UErrorCode& status);
    +
    + /**
    + * Makes the <code>TimeZoneRule</code> ready to handle actual timezone
    + * calcuation APIs. This method collects time zone rules specified
    + * by the caller via the constructor and addTransitionRule() and
    + * builds internal structure for making the object ready to support
    + * time zone APIs such as getOffset(), getNextTransition() and others.
    + * @param status Output param to filled in with a success or an error.
    + * @stable ICU 4.0
    + */
    + void complete(UErrorCode& status);
    +
    + /**
    + * Clones TimeZone objects polymorphically. Clients are responsible for deleting
    + * the TimeZone object cloned.
    + *
    + * @return A new copy of this TimeZone object.
    + * @stable ICU 4.0
    + */
    + virtual TimeZone* clone(void) const;
    +
    + /**
    + * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add
    + * to GMT to get local time in this time zone, taking daylight savings time into
    + * account) as of a particular reference date. The reference date is used to determine
    + * whether daylight savings time is in effect and needs to be figured into the offset
    + * that is returned (in other words, what is the adjusted GMT offset in this time zone
    + * at this particular date and time?). For the time zones produced by createTimeZone(),
    + * the reference data is specified according to the Gregorian calendar, and the date
    + * and time fields are local standard time.
    + *
    + * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload,
    + * which returns both the raw and the DST offset for a given time. This method
    + * is retained only for backward compatibility.
    + *
    + * @param era The reference date's era
    + * @param year The reference date's year
    + * @param month The reference date's month (0-based; 0 is January)
    + * @param day The reference date's day-in-month (1-based)
    + * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday)
    + * @param millis The reference date's milliseconds in day, local standard time
    + * @param status Output param to filled in with a success or an error.
    + * @return The offset in milliseconds to add to GMT to get local time.
    + * @stable ICU 4.0
    + */
    + virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
    + uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const;
    +
    + /**
    + * Gets the time zone offset, for current date, modified in case of
    + * daylight savings. This is the offset to add *to* UTC to get local time.
    + *
    + * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload,
    + * which returns both the raw and the DST offset for a given time. This method
    + * is retained only for backward compatibility.
    + *
    + * @param era The reference date's era
    + * @param year The reference date's year
    + * @param month The reference date's month (0-based; 0 is January)
    + * @param day The reference date's day-in-month (1-based)
    + * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday)
    + * @param millis The reference date's milliseconds in day, local standard time
    + * @param monthLength The length of the given month in days.
    + * @param status Output param to filled in with a success or an error.
    + * @return The offset in milliseconds to add to GMT to get local time.
    + * @stable ICU 4.0
    + */
    + virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
    + uint8_t dayOfWeek, int32_t millis,
    + int32_t monthLength, UErrorCode& status) const;
    +
    + /**
    + * Returns the time zone raw and GMT offset for the given moment
    + * in time. Upon return, local-millis = GMT-millis + rawOffset +
    + * dstOffset. All computations are performed in the proleptic
    + * Gregorian calendar. The default implementation in the TimeZone
    + * class delegates to the 8-argument getOffset().
    + *
    + * @param date moment in time for which to return offsets, in
    + * units of milliseconds from January 1, 1970 0:00 GMT, either GMT
    + * time or local wall time, depending on `local'.
    + * @param local if true, `date' is local wall time; otherwise it
    + * is in GMT time.
    + * @param rawOffset output parameter to receive the raw offset, that
    + * is, the offset not including DST adjustments
    + * @param dstOffset output parameter to receive the DST offset,
    + * that is, the offset to be added to `rawOffset' to obtain the
    + * total offset between local and GMT time. If DST is not in
    + * effect, this value is zero; otherwise it is a positive value,
    + * typically one hour.
    + * @param ec input-output error code
    + * @stable ICU 4.0
    + */
    + virtual void getOffset(UDate date, UBool local, int32_t& rawOffset,
    + int32_t& dstOffset, UErrorCode& ec) const;
    +
    + /**
    + * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
    + * to GMT to get local time, before taking daylight savings time into account).
    + *
    + * @param offsetMillis The new raw GMT offset for this time zone.
    + * @stable ICU 4.0
    + */
    + virtual void setRawOffset(int32_t offsetMillis);
    +
    + /**
    + * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
    + * to GMT to get local time, before taking daylight savings time into account).
    + *
    + * @return The TimeZone's raw GMT offset.
    + * @stable ICU 4.0
    + */
    + virtual int32_t getRawOffset(void) const;
    +
    + /**
    + * Queries if this time zone uses daylight savings time.
    + * @return true if this time zone uses daylight savings time,
    + * false, otherwise.
    + * @stable ICU 4.0
    + */
    + virtual UBool useDaylightTime(void) const;
    +
    + /**
    + * Queries if the given date is in daylight savings time in
    + * this time zone.
    + * This method is wasteful since it creates a new GregorianCalendar and
    + * deletes it each time it is called. This is a deprecated method
    + * and provided only for Java compatibility.
    + *
    + * @param date the given UDate.
    + * @param status Output param filled in with success/error code.
    + * @return true if the given date is in daylight savings time,
    + * false, otherwise.
    + * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead.
    + */
    + virtual UBool inDaylightTime(UDate date, UErrorCode& status) const;
    +
    + /**
    + * Returns true if this zone has the same rule and offset as another zone.
    + * That is, if this zone differs only in ID, if at all.
    + * @param other the <code>TimeZone</code> object to be compared with
    + * @return true if the given zone is the same as this one,
    + * with the possible exception of the ID
    + * @stable ICU 4.0
    + */
    + virtual UBool hasSameRules(const TimeZone& other) const;
    +
    + /**
    + * Gets the first time zone transition after the base time.
    + * @param base The base time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives the first transition after the base time.
    + * @return TRUE if the transition is found.
    + * @stable ICU 4.0
    + */
    + virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/;
    +
    + /**
    + * Gets the most recent time zone transition before the base time.
    + * @param base The base time.
    + * @param inclusive Whether the base time is inclusive or not.
    + * @param result Receives the most recent transition before the base time.
    + * @return TRUE if the transition is found.
    + * @stable ICU 4.0
    + */
    + virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) /*const*/;
    +
    + /**
    + * Returns the number of <code>TimeZoneRule</code>s which represents time transitions,
    + * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except
    + * <code>InitialTimeZoneRule</code>. The return value range is 0 or any positive value.
    + * @param status Receives error status code.
    + * @return The number of <code>TimeZoneRule</code>s representing time transitions.
    + * @stable ICU 4.0
    + */
    + virtual int32_t countTransitionRules(UErrorCode& status) /*const*/;
    +
    + /**
    + * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZoneRule</code>
    + * which represent time transitions for this time zone. On successful return,
    + * the argument initial points to non-NULL <code>InitialTimeZoneRule</code> and
    + * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</code>
    + * instances up to the size specified by trscount. The results are referencing the
    + * rule instance held by this time zone instance. Therefore, after this time zone
    + * is destructed, they are no longer available.
    + * @param initial Receives the initial timezone rule
    + * @param trsrules Receives the timezone transition rules
    + * @param trscount On input, specify the size of the array 'transitions' receiving
    + * the timezone transition rules. On output, actual number of
    + * rules filled in the array will be set.
    + * @param status Receives error status code.
    + * @stable ICU 4.0
    + */
    + virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
    + const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) /*const*/;
    +
    + /**
    + * Get time zone offsets from local wall time.
    + * @internal
    + */
    + virtual void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt,
    + int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) /*const*/;
    +
    +private:
    + void deleteRules(void);
    + void deleteTransitions(void);
    + UVector* copyRules(UVector* source);
    + TimeZoneRule* findRuleInFinal(UDate date, UBool local,
    + int32_t NonExistingTimeOpt, int32_t DuplicatedTimeOpt) const;
    + UBool findNext(UDate base, UBool inclusive, UDate& time, TimeZoneRule*& from, TimeZoneRule*& to) const;
    + UBool findPrev(UDate base, UBool inclusive, UDate& time, TimeZoneRule*& from, TimeZoneRule*& to) const;
    + int32_t getLocalDelta(int32_t rawBefore, int32_t dstBefore, int32_t rawAfter, int32_t dstAfter,
    + int32_t NonExistingTimeOpt, int32_t DuplicatedTimeOpt) const;
    + UDate getTransitionTime(Transition* transition, UBool local,
    + int32_t NonExistingTimeOpt, int32_t DuplicatedTimeOpt) const;
    + void getOffsetInternal(UDate date, UBool local, int32_t NonExistingTimeOpt, int32_t DuplicatedTimeOpt,
    + int32_t& rawOffset, int32_t& dstOffset, UErrorCode& ec) const;
    +
    + InitialTimeZoneRule *fInitialRule;
    + UVector *fHistoricRules;
    + UVector *fFinalRules;
    + UVector *fHistoricTransitions;
    + UBool fUpToDate;
    +
    +public:
    + /**
    + * Return the class ID for this class. This is useful only for comparing to
    + * a return value from getDynamicClassID(). For example:
    + * <pre>
    + * . Base* polymorphic_pointer = createPolymorphicObject();
    + * . if (polymorphic_pointer->getDynamicClassID() ==
    + * . erived::getStaticClassID()) ...
    + * </pre>
    + * @return The class ID for all objects of this class.
    + * @stable ICU 4.0
    + */
    + static UClassID U_EXPORT2 getStaticClassID(void);
    +
    + /**
    + * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
    + * method is to implement a simple version of RTTI, since not all C++
    + * compilers support genuine RTTI. Polymorphic operator==() and clone()
    + * methods call this method.
    + *
    + * @return The class ID for this object. All objects of a
    + * given class have the same class ID. Objects of
    + * other classes have different class IDs.
    + * @stable ICU 4.0
    + */
    + virtual UClassID getDynamicClassID(void) const;
    +};
    +
    +U_NAMESPACE_END
    +
    +#endif /* #if !UCONFIG_NO_FORMATTING */
    +
    +#endif // RBTZ_H
    +
    +//eof
  • Davisp at Feb 6, 2014 at 5:30 pm
    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/utf8.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/utf8.h b/platform/osx/icu/unicode/utf8.h
    new file mode 100644
    index 0000000..1142c44
    --- /dev/null
    +++ b/platform/osx/icu/unicode/utf8.h
    @@ -0,0 +1,652 @@
    +/*
    +*******************************************************************************
    +*
    +* Copyright (C) 1999-2007, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +*******************************************************************************
    +* file name: utf8.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* created on: 1999sep13
    +* created by: Markus W. Scherer
    +*/
    +
    +/**
    + * \file
    + * \brief C API: 8-bit Unicode handling macros
    + *
    + * This file defines macros to deal with 8-bit Unicode (UTF-8) code units (bytes) and strings.
    + * utf8.h is included by utf.h after unicode/umachine.h
    + * and some common definitions.
    + *
    + * For more information see utf.h and the ICU User Guide Strings chapter
    + * (http://icu-project.org/userguide/strings.html).
    + *
    + * <em>Usage:</em>
    + * ICU coding guidelines for if() statements should be followed when using these macros.
    + * Compound statements (curly braces {}) must be used for if-else-while...
    + * bodies and all macro statements should be terminated with semicolon.
    + */
    +
    +#ifndef __UTF8_H__
    +#define __UTF8_H__
    +
    +/* utf.h must be included first. */
    +#ifndef __UTF_H__
    +# include "unicode/utf.h"
    +#endif
    +
    +/* internal definitions ----------------------------------------------------- */
    +
    +/**
    + * \var utf8_countTrailBytes
    + * Internal array with numbers of trail bytes for any given byte used in
    + * lead byte position.
    + * @internal
    + */
    +#ifdef U_UTF8_IMPL
    +U_EXPORT const uint8_t
    +#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
    +U_CFUNC const uint8_t
    +#else
    +U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/
    +#endif
    +utf8_countTrailBytes[256];
    +
    +/**
    + * Count the trail bytes for a UTF-8 lead byte.
    + * @internal
    + */
    +#define U8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadByte])
    +
    +/**
    + * Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value.
    + * @internal
    + */
    +#define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1)
    +
    +/**
    + * Function for handling "next code point" with error-checking.
    + * @internal
    + */
    +U_INTERNAL UChar32 U_EXPORT2
    +utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict);
    +
    +/**
    + * Function for handling "append code point" with error-checking.
    + * @internal
    + */
    +U_INTERNAL int32_t U_EXPORT2
    +utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool *pIsError);
    +
    +/**
    + * Function for handling "previous code point" with error-checking.
    + * @internal
    + */
    +U_INTERNAL UChar32 U_EXPORT2
    +utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict);
    +
    +/**
    + * Function for handling "skip backward one code point" with error-checking.
    + * @internal
    + */
    +U_INTERNAL int32_t U_EXPORT2
    +utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
    +
    +/* single-code point definitions -------------------------------------------- */
    +
    +/**
    + * Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x7f)?
    + * @param c 8-bit code unit (byte)
    + * @return TRUE or FALSE
    + * @stable ICU 2.4
    + */
    +#define U8_IS_SINGLE(c) (((c)&0x80)==0)
    +
    +/**
    + * Is this code unit (byte) a UTF-8 lead byte?
    + * @param c 8-bit code unit (byte)
    + * @return TRUE or FALSE
    + * @stable ICU 2.4
    + */
    +#define U8_IS_LEAD(c) ((uint8_t)((c)-0xc0)<0x3e)
    +
    +/**
    + * Is this code unit (byte) a UTF-8 trail byte?
    + * @param c 8-bit code unit (byte)
    + * @return TRUE or FALSE
    + * @stable ICU 2.4
    + */
    +#define U8_IS_TRAIL(c) (((c)&0xc0)==0x80)
    +
    +/**
    + * How many code units (bytes) are used for the UTF-8 encoding
    + * of this Unicode code point?
    + * @param c 32-bit code point
    + * @return 1..4, or 0 if c is a surrogate or not a Unicode code point
    + * @stable ICU 2.4
    + */
    +#define U8_LENGTH(c) \
    + ((uint32_t)(c)<=0x7f ? 1 : \
    + ((uint32_t)(c)<=0x7ff ? 2 : \
    + ((uint32_t)(c)<=0xd7ff ? 3 : \
    + ((uint32_t)(c)<=0xdfff || (uint32_t)(c)>0x10ffff ? 0 : \
    + ((uint32_t)(c)<=0xffff ? 3 : 4)\
    + ) \
    + ) \
    + ) \
    + )
    +
    +/**
    + * The maximum number of UTF-8 code units (bytes) per Unicode code point (U+0000..U+10ffff).
    + * @return 4
    + * @stable ICU 2.4
    + */
    +#define U8_MAX_LENGTH 4
    +
    +/**
    + * Get a code point from a string at a random-access offset,
    + * without changing the offset.
    + * The offset may point to either the lead byte or one of the trail bytes
    + * for a code point, in which case the macro will read all of the bytes
    + * for the code point.
    + * The result is undefined if the offset points to an illegal UTF-8
    + * byte sequence.
    + * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @param c output UChar32 variable
    + * @see U8_GET
    + * @stable ICU 2.4
    + */
    +#define U8_GET_UNSAFE(s, i, c) { \
    + int32_t _u8_get_unsafe_index=(int32_t)(i); \
    + U8_SET_CP_START_UNSAFE(s, _u8_get_unsafe_index); \
    + U8_NEXT_UNSAFE(s, _u8_get_unsafe_index, c); \
    +}
    +
    +/**
    + * Get a code point from a string at a random-access offset,
    + * without changing the offset.
    + * The offset may point to either the lead byte or one of the trail bytes
    + * for a code point, in which case the macro will read all of the bytes
    + * for the code point.
    + * If the offset points to an illegal UTF-8 byte sequence, then
    + * c is set to a negative value.
    + * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT.
    + *
    + * @param s const uint8_t * string
    + * @param start starting string offset
    + * @param i string offset, must be start<=i<length
    + * @param length string length
    + * @param c output UChar32 variable, set to <0 in case of an error
    + * @see U8_GET_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_GET(s, start, i, length, c) { \
    + int32_t _u8_get_index=(int32_t)(i); \
    + U8_SET_CP_START(s, start, _u8_get_index); \
    + U8_NEXT(s, _u8_get_index, length, c); \
    +}
    +
    +/* definitions with forward iteration --------------------------------------- */
    +
    +/**
    + * Get a code point from a string at a code point boundary offset,
    + * and advance the offset to the next code point boundary.
    + * (Post-incrementing forward iteration.)
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * The offset may point to the lead byte of a multi-byte sequence,
    + * in which case the macro will read the whole sequence.
    + * The result is undefined if the offset points to a trail byte
    + * or an illegal UTF-8 sequence.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @param c output UChar32 variable
    + * @see U8_NEXT
    + * @stable ICU 2.4
    + */
    +#define U8_NEXT_UNSAFE(s, i, c) { \
    + (c)=(uint8_t)(s)[(i)++]; \
    + if((uint8_t)((c)-0xc0)<0x35) { \
    + uint8_t __count=U8_COUNT_TRAIL_BYTES(c); \
    + U8_MASK_LEAD_BYTE(c, __count); \
    + switch(__count) { \
    + /* each following branch falls through to the next one */ \
    + case 3: \
    + (c)=((c)<<6)|((s)[(i)++]&0x3f); \
    + case 2: \
    + (c)=((c)<<6)|((s)[(i)++]&0x3f); \
    + case 1: \
    + (c)=((c)<<6)|((s)[(i)++]&0x3f); \
    + /* no other branches to optimize switch() */ \
    + break; \
    + } \
    + } \
    +}
    +
    +/**
    + * Get a code point from a string at a code point boundary offset,
    + * and advance the offset to the next code point boundary.
    + * (Post-incrementing forward iteration.)
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * The offset may point to the lead byte of a multi-byte sequence,
    + * in which case the macro will read the whole sequence.
    + * If the offset points to a trail byte or an illegal UTF-8 sequence, then
    + * c is set to a negative value.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset, must be i<length
    + * @param length string length
    + * @param c output UChar32 variable, set to <0 in case of an error
    + * @see U8_NEXT_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_NEXT(s, i, length, c) { \
    + (c)=(uint8_t)(s)[(i)++]; \
    + if((c)>=0x80) { \
    + uint8_t __t1, __t2; \
    + if( /* handle U+1000..U+CFFF inline */ \
    + (0xe0<(c) && (c)<=0xec) && \
    + (((i)+1)<(length)) && \
    + (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \
    + (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \
    + ) { \
    + /* no need for (c&0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */ \
    + (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \
    + (i)+=2; \
    + } else if( /* handle U+0080..U+07FF inline */ \
    + ((c)<0xe0 && (c)>=0xc2) && \
    + ((i)<(length)) && \
    + (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \
    + ) { \
    + (c)=(UChar)((((c)&0x1f)<<6)|__t1); \
    + ++(i); \
    + } else if(U8_IS_LEAD(c)) { \
    + /* function call for "complicated" and error cases */ \
    + (c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (int32_t)(length), c, -1); \
    + } else { \
    + (c)=U_SENTINEL; \
    + } \
    + } \
    +}
    +
    +/**
    + * Append a code point to a string, overwriting 1 to 4 bytes.
    + * The offset points to the current end of the string contents
    + * and is advanced (post-increment).
    + * "Unsafe" macro, assumes a valid code point and sufficient space in the string.
    + * Otherwise, the result is undefined.
    + *
    + * @param s const uint8_t * string buffer
    + * @param i string offset
    + * @param c code point to append
    + * @see U8_APPEND
    + * @stable ICU 2.4
    + */
    +#define U8_APPEND_UNSAFE(s, i, c) { \
    + if((uint32_t)(c)<=0x7f) { \
    + (s)[(i)++]=(uint8_t)(c); \
    + } else { \
    + if((uint32_t)(c)<=0x7ff) { \
    + (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \
    + } else { \
    + if((uint32_t)(c)<=0xffff) { \
    + (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \
    + } else { \
    + (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); \
    + (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); \
    + } \
    + (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \
    + } \
    + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
    + } \
    +}
    +
    +/**
    + * Append a code point to a string, overwriting 1 to 4 bytes.
    + * The offset points to the current end of the string contents
    + * and is advanced (post-increment).
    + * "Safe" macro, checks for a valid code point.
    + * If a non-ASCII code point is written, checks for sufficient space in the string.
    + * If the code point is not valid or trail bytes do not fit,
    + * then isError is set to TRUE.
    + *
    + * @param s const uint8_t * string buffer
    + * @param i string offset, must be i<capacity
    + * @param capacity size of the string buffer
    + * @param c code point to append
    + * @param isError output UBool set to TRUE if an error occurs, otherwise not modified
    + * @see U8_APPEND_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_APPEND(s, i, capacity, c, isError) { \
    + if((uint32_t)(c)<=0x7f) { \
    + (s)[(i)++]=(uint8_t)(c); \
    + } else if((uint32_t)(c)<=0x7ff && (i)+1<(capacity)) { \
    + (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \
    + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
    + } else if((uint32_t)(c)<=0xd7ff && (i)+2<(capacity)) { \
    + (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \
    + (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \
    + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
    + } else { \
    + (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(capacity), c, &(isError)); \
    + } \
    +}
    +
    +/**
    + * Advance the string offset from one code point boundary to the next.
    + * (Post-incrementing iteration.)
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @see U8_FWD_1
    + * @stable ICU 2.4
    + */
    +#define U8_FWD_1_UNSAFE(s, i) { \
    + (i)+=1+U8_COUNT_TRAIL_BYTES((s)[i]); \
    +}
    +
    +/**
    + * Advance the string offset from one code point boundary to the next.
    + * (Post-incrementing iteration.)
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset, must be i<length
    + * @param length string length
    + * @see U8_FWD_1_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_FWD_1(s, i, length) { \
    + uint8_t __b=(uint8_t)(s)[(i)++]; \
    + if(U8_IS_LEAD(__b)) { \
    + uint8_t __count=U8_COUNT_TRAIL_BYTES(__b); \
    + if((i)+__count>(length)) { \
    + __count=(uint8_t)((length)-(i)); \
    + } \
    + while(__count>0 && U8_IS_TRAIL((s)[i])) { \
    + ++(i); \
    + --__count; \
    + } \
    + } \
    +}
    +
    +/**
    + * Advance the string offset from one code point boundary to the n-th next one,
    + * i.e., move forward by n code points.
    + * (Post-incrementing iteration.)
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @param n number of code points to skip
    + * @see U8_FWD_N
    + * @stable ICU 2.4
    + */
    +#define U8_FWD_N_UNSAFE(s, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0) { \
    + U8_FWD_1_UNSAFE(s, i); \
    + --__N; \
    + } \
    +}
    +
    +/**
    + * Advance the string offset from one code point boundary to the n-th next one,
    + * i.e., move forward by n code points.
    + * (Post-incrementing iteration.)
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset, must be i<length
    + * @param length string length
    + * @param n number of code points to skip
    + * @see U8_FWD_N_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_FWD_N(s, i, length, n) { \
    + int32_t __N=(n); \
    + while(__N>0 && (i)<(length)) { \
    + U8_FWD_1(s, i, length); \
    + --__N; \
    + } \
    +}
    +
    +/**
    + * Adjust a random-access offset to a code point boundary
    + * at the start of a code point.
    + * If the offset points to a UTF-8 trail byte,
    + * then the offset is moved backward to the corresponding lead byte.
    + * Otherwise, it is not modified.
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @see U8_SET_CP_START
    + * @stable ICU 2.4
    + */
    +#define U8_SET_CP_START_UNSAFE(s, i) { \
    + while(U8_IS_TRAIL((s)[i])) { --(i); } \
    +}
    +
    +/**
    + * Adjust a random-access offset to a code point boundary
    + * at the start of a code point.
    + * If the offset points to a UTF-8 trail byte,
    + * then the offset is moved backward to the corresponding lead byte.
    + * Otherwise, it is not modified.
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * @param s const uint8_t * string
    + * @param start starting string offset (usually 0)
    + * @param i string offset, must be start<=i
    + * @see U8_SET_CP_START_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_SET_CP_START(s, start, i) { \
    + if(U8_IS_TRAIL((s)[(i)])) { \
    + (i)=utf8_back1SafeBody(s, start, (int32_t)(i)); \
    + } \
    +}
    +
    +/* definitions with backward iteration -------------------------------------- */
    +
    +/**
    + * Move the string offset from one code point boundary to the previous one
    + * and get the code point between them.
    + * (Pre-decrementing backward iteration.)
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * The input offset may be the same as the string length.
    + * If the offset is behind a multi-byte sequence, then the macro will read
    + * the whole sequence.
    + * If the offset is behind a lead byte, then that itself
    + * will be returned as the code point.
    + * The result is undefined if the offset is behind an illegal UTF-8 sequence.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @param c output UChar32 variable
    + * @see U8_PREV
    + * @stable ICU 2.4
    + */
    +#define U8_PREV_UNSAFE(s, i, c) { \
    + (c)=(uint8_t)(s)[--(i)]; \
    + if(U8_IS_TRAIL(c)) { \
    + uint8_t __b, __count=1, __shift=6; \
    +\
    + /* c is a trail byte */ \
    + (c)&=0x3f; \
    + for(;;) { \
    + __b=(uint8_t)(s)[--(i)]; \
    + if(__b>=0xc0) { \
    + U8_MASK_LEAD_BYTE(__b, __count); \
    + (c)|=(UChar32)__b<<__shift; \
    + break; \
    + } else { \
    + (c)|=(UChar32)(__b&0x3f)<<__shift; \
    + ++__count; \
    + __shift+=6; \
    + } \
    + } \
    + } \
    +}
    +
    +/**
    + * Move the string offset from one code point boundary to the previous one
    + * and get the code point between them.
    + * (Pre-decrementing backward iteration.)
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * The input offset may be the same as the string length.
    + * If the offset is behind a multi-byte sequence, then the macro will read
    + * the whole sequence.
    + * If the offset is behind a lead byte, then that itself
    + * will be returned as the code point.
    + * If the offset is behind an illegal UTF-8 sequence, then c is set to a negative value.
    + *
    + * @param s const uint8_t * string
    + * @param start starting string offset (usually 0)
    + * @param i string offset, must be start<i
    + * @param c output UChar32 variable, set to <0 in case of an error
    + * @see U8_PREV_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_PREV(s, start, i, c) { \
    + (c)=(uint8_t)(s)[--(i)]; \
    + if((c)>=0x80) { \
    + if((c)<=0xbf) { \
    + (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -1); \
    + } else { \
    + (c)=U_SENTINEL; \
    + } \
    + } \
    +}
    +
    +/**
    + * Move the string offset from one code point boundary to the previous one.
    + * (Pre-decrementing backward iteration.)
    + * The input offset may be the same as the string length.
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @see U8_BACK_1
    + * @stable ICU 2.4
    + */
    +#define U8_BACK_1_UNSAFE(s, i) { \
    + while(U8_IS_TRAIL((s)[--(i)])) {} \
    +}
    +
    +/**
    + * Move the string offset from one code point boundary to the previous one.
    + * (Pre-decrementing backward iteration.)
    + * The input offset may be the same as the string length.
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * @param s const uint8_t * string
    + * @param start starting string offset (usually 0)
    + * @param i string offset, must be start<i
    + * @see U8_BACK_1_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_BACK_1(s, start, i) { \
    + if(U8_IS_TRAIL((s)[--(i)])) { \
    + (i)=utf8_back1SafeBody(s, start, (int32_t)(i)); \
    + } \
    +}
    +
    +/**
    + * Move the string offset from one code point boundary to the n-th one before it,
    + * i.e., move backward by n code points.
    + * (Pre-decrementing backward iteration.)
    + * The input offset may be the same as the string length.
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @param n number of code points to skip
    + * @see U8_BACK_N
    + * @stable ICU 2.4
    + */
    +#define U8_BACK_N_UNSAFE(s, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0) { \
    + U8_BACK_1_UNSAFE(s, i); \
    + --__N; \
    + } \
    +}
    +
    +/**
    + * Move the string offset from one code point boundary to the n-th one before it,
    + * i.e., move backward by n code points.
    + * (Pre-decrementing backward iteration.)
    + * The input offset may be the same as the string length.
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * @param s const uint8_t * string
    + * @param start index of the start of the string
    + * @param i string offset, must be start<i
    + * @param n number of code points to skip
    + * @see U8_BACK_N_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_BACK_N(s, start, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0 && (i)>(start)) { \
    + U8_BACK_1(s, start, i); \
    + --__N; \
    + } \
    +}
    +
    +/**
    + * Adjust a random-access offset to a code point boundary after a code point.
    + * If the offset is behind a partial multi-byte sequence,
    + * then the offset is incremented to behind the whole sequence.
    + * Otherwise, it is not modified.
    + * The input offset may be the same as the string length.
    + * "Unsafe" macro, assumes well-formed UTF-8.
    + *
    + * @param s const uint8_t * string
    + * @param i string offset
    + * @see U8_SET_CP_LIMIT
    + * @stable ICU 2.4
    + */
    +#define U8_SET_CP_LIMIT_UNSAFE(s, i) { \
    + U8_BACK_1_UNSAFE(s, i); \
    + U8_FWD_1_UNSAFE(s, i); \
    +}
    +
    +/**
    + * Adjust a random-access offset to a code point boundary after a code point.
    + * If the offset is behind a partial multi-byte sequence,
    + * then the offset is incremented to behind the whole sequence.
    + * Otherwise, it is not modified.
    + * The input offset may be the same as the string length.
    + * "Safe" macro, checks for illegal sequences and for string boundaries.
    + *
    + * @param s const uint8_t * string
    + * @param start starting string offset (usually 0)
    + * @param i string offset, must be start<=i<=length
    + * @param length string length
    + * @see U8_SET_CP_LIMIT_UNSAFE
    + * @stable ICU 2.4
    + */
    +#define U8_SET_CP_LIMIT(s, start, i, length) { \
    + if((start)<(i) && (i)<(length)) { \
    + U8_BACK_1(s, start, i); \
    + U8_FWD_1(s, i, length); \
    + } \
    +}
    +
    +#endif

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/utf_old.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/utf_old.h b/platform/osx/icu/unicode/utf_old.h
    new file mode 100644
    index 0000000..2397889
    --- /dev/null
    +++ b/platform/osx/icu/unicode/utf_old.h
    @@ -0,0 +1,1171 @@
    +/*
    +*******************************************************************************
    +*
    +* Copyright (C) 2002-2005, International Business Machines
    +* Corporation and others. All Rights Reserved.
    +*
    +*******************************************************************************
    +* file name: utf.h
    +* encoding: US-ASCII
    +* tab size: 8 (not used)
    +* indentation:4
    +*
    +* created on: 2002sep21
    +* created by: Markus W. Scherer
    +*/
    +
    +/**
    + * \file
    + * \brief C API: Deprecated macros for Unicode string handling
    + */
    +
    +/**
    + *
    + * The macros in utf_old.h are all deprecated and their use discouraged.
    + * Some of the design principles behind the set of UTF macros
    + * have changed or proved impractical.
    + * Almost all of the old "UTF macros" are at least renamed.
    + * If you are looking for a new equivalent to an old macro, please see the
    + * comment at the old one.
    + *
    + * utf_old.h is included by utf.h after unicode/umachine.h
    + * and some common definitions, to not break old code.
    + *
    + * Brief summary of reasons for deprecation:
    + * - Switch on UTF_SIZE (selection of UTF-8/16/32 default string processing)
    + * was impractical.
    + * - Switch on UTF_SAFE etc. (selection of unsafe/safe/strict default string processing)
    + * was of little use and impractical.
    + * - Whole classes of macros became obsolete outside of the UTF_SIZE/UTF_SAFE
    + * selection framework: UTF32_ macros (all trivial)
    + * and UTF_ default and intermediate macros (all aliases).
    + * - The selection framework also caused many macro aliases.
    + * - Change in Unicode standard: "irregular" sequences (3.0) became illegal (3.2).
    + * - Change of language in Unicode standard:
    + * Growing distinction between internal x-bit Unicode strings and external UTF-x
    + * forms, with the former more lenient.
    + * Suggests renaming of UTF16_ macros to U16_.
    + * - The prefix "UTF_" without a width number confused some users.
    + * - "Safe" append macros needed the addition of an error indicator output.
    + * - "Safe" UTF-8 macros used legitimate (if rarely used) code point values
    + * to indicate error conditions.
    + * - The use of the "_CHAR" infix for code point operations confused some users.
    + *
    + * More details:
    + *
    + * Until ICU 2.2, utf.h theoretically allowed to choose among UTF-8/16/32
    + * for string processing, and among unsafe/safe/strict default macros for that.
    + *
    + * It proved nearly impossible to write non-trivial, high-performance code
    + * that is UTF-generic.
    + * Unsafe default macros would be dangerous for default string processing,
    + * and the main reason for the "strict" versions disappeared:
    + * Between Unicode 3.0 and 3.2 all "irregular" UTF-8 sequences became illegal.
    + * The only other conditions that "strict" checked for were non-characters,
    + * which are valid during processing. Only during text input/output should they
    + * be checked, and at that time other well-formedness checks may be
    + * necessary or useful as well.
    + * This can still be done by using U16_NEXT and U_IS_UNICODE_NONCHAR
    + * or U_IS_UNICODE_CHAR.
    + *
    + * The old UTF8_..._SAFE macros also used some normal Unicode code points
    + * to indicate malformed sequences.
    + * The new UTF8_ macros without suffix use negative values instead.
    + *
    + * The entire contents of utf32.h was moved here without replacement
    + * because all those macros were trivial and
    + * were meaningful only in the framework of choosing the UTF size.
    + *
    + * See Jitterbug 2150 and its discussion on the ICU mailing list
    + * in September 2002.
    + *
    + * <hr>
    + *
    + * <em>Obsolete part</em> of pre-ICU 2.4 utf.h file documentation:
    + *
    + * <p>The original concept for these files was for ICU to allow
    + * in principle to set which UTF (UTF-8/16/32) is used internally
    + * by defining UTF_SIZE to either 8, 16, or 32. utf.h would then define the UChar type
    + * accordingly. UTF-16 was the default.</p>
    + *
    + * <p>This concept has been abandoned.
    + * A lot of the ICU source code assumes UChar strings are in UTF-16.
    + * This is especially true for low-level code like
    + * conversion, normalization, and collation.
    + * The utf.h header enforces the default of UTF-16.
    + * The UTF-8 and UTF-32 macros remain for now for completeness and backward compatibility.</p>
    + *
    + * <p>Accordingly, utf.h defines UChar to be an unsigned 16-bit integer. If this matches wchar_t, then
    + * UChar is defined to be exactly wchar_t, otherwise uint16_t.</p>
    + *
    + * <p>UChar32 is defined to be a signed 32-bit integer (int32_t), large enough for a 21-bit
    + * Unicode code point (Unicode scalar value, 0..0x10ffff).
    + * Before ICU 2.4, the definition of UChar32 was similarly platform-dependent as
    + * the definition of UChar. For details see the documentation for UChar32 itself.</p>
    + *
    + * <p>utf.h also defines a number of C macros for handling single Unicode code points and
    + * for using UTF Unicode strings. It includes utf8.h, utf16.h, and utf32.h for the actual
    + * implementations of those macros and then aliases one set of them (for UTF-16) for general use.
    + * The UTF-specific macros have the UTF size in the macro name prefixes (UTF16_...), while
    + * the general alias macros always begin with UTF_...</p>
    + *
    + * <p>Many string operations can be done with or without error checking.
    + * Where such a distinction is useful, there are two versions of the macros, "unsafe" and "safe"
    + * ones with ..._UNSAFE and ..._SAFE suffixes. The unsafe macros are fast but may cause
    + * program failures if the strings are not well-formed. The safe macros have an additional, boolean
    + * parameter "strict". If strict is FALSE, then only illegal sequences are detected.
    + * Otherwise, irregular sequences and non-characters are detected as well (like single surrogates).
    + * Safe macros return special error code points for illegal/irregular sequences:
    + * Typically, U+ffff, or values that would result in a code unit sequence of the same length
    + * as the erroneous input sequence.<br>
    + * Note that _UNSAFE macros have fewer parameters: They do not have the strictness parameter, and
    + * they do not have start/length parameters for boundary checking.</p>
    + *
    + * <p>Here, the macros are aliased in two steps:
    + * In the first step, the UTF-specific macros with UTF16_ prefix and _UNSAFE and _SAFE suffixes are
    + * aliased according to the UTF_SIZE to macros with UTF_ prefix and the same suffixes and signatures.
    + * Then, in a second step, the default, general alias macros are set to use either the unsafe or
    + * the safe/not strict (default) or the safe/strict macro;
    + * these general macros do not have a strictness parameter.</p>
    + *
    + * <p>It is possible to change the default choice for the general alias macros to be unsafe, safe/not strict or safe/strict.
    + * The default is safe/not strict. It is not recommended to select the unsafe macros as the basis for
    + * Unicode string handling in ICU! To select this, define UTF_SAFE, UTF_STRICT, or UTF_UNSAFE.</p>
    + *
    + * <p>For general use, one should use the default, general macros with UTF_ prefix and no _SAFE/_UNSAFE suffix.
    + * Only in some cases it may be necessary to control the choice of macro directly and use a less generic alias.
    + * For example, if it can be assumed that a string is well-formed and the index will stay within the bounds,
    + * then the _UNSAFE version may be used.
    + * If a UTF-8 string is to be processed, then the macros with UTF8_ prefixes need to be used.</p>
    + *
    + * <hr>
    + *
    + * @deprecated ICU 2.4. Use the macros in utf.h, utf16.h, utf8.h instead.
    + */
    +
    +#ifndef __UTF_OLD_H__
    +#define __UTF_OLD_H__
    +
    +#ifndef U_HIDE_DEPRECATED_API
    +
    +/* utf.h must be included first. */
    +#ifndef __UTF_H__
    +# include "unicode/utf.h"
    +#endif
    +
    +/* Formerly utf.h, part 1 --------------------------------------------------- */
    +
    +#ifdef U_USE_UTF_DEPRECATES
    +/**
    + * Unicode string and array offset and index type.
    + * ICU always counts Unicode code units (UChars) for
    + * string offsets, indexes, and lengths, not Unicode code points.
    + *
    + * @obsolete ICU 2.6. Use int32_t directly instead since this API will be removed in that release.
    + */
    +typedef int32_t UTextOffset;
    +#endif
    +
    +/** Number of bits in a Unicode string code unit - ICU uses 16-bit Unicode. @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF_SIZE 16
    +
    +/**
    + * The default choice for general Unicode string macros is to use the ..._SAFE macro implementations
    + * with strict=FALSE.
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF_SAFE
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#undef UTF_UNSAFE
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#undef UTF_STRICT
    +
    +/**
    + * <p>UTF8_ERROR_VALUE_1 and UTF8_ERROR_VALUE_2 are special error values for UTF-8,
    + * which need 1 or 2 bytes in UTF-8:<br>
    + * U+0015 = NAK = Negative Acknowledge, C0 control character<br>
    + * U+009f = highest C1 control character</p>
    + *
    + * <p>These are used by UTF8_..._SAFE macros so that they can return an error value
    + * that needs the same number of code units (bytes) as were seen by
    + * a macro. They should be tested with UTF_IS_ERROR() or UTF_IS_VALID().</p>
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF8_ERROR_VALUE_1 0x15
    +
    +/**
    + * See documentation on UTF8_ERROR_VALUE_1 for details.
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF8_ERROR_VALUE_2 0x9f
    +
    +/**
    + * Error value for all UTFs. This code point value will be set by macros with error
    + * checking if an error is detected.
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF_ERROR_VALUE 0xffff
    +
    +/**
    + * Is a given 32-bit code an error value
    + * as returned by one of the macros for any UTF?
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF_IS_ERROR(c) \
    + (((c)&0xfffe)==0xfffe || (c)==UTF8_ERROR_VALUE_1 || (c)==UTF8_ERROR_VALUE_2)
    +
    +/**
    + * This is a combined macro: Is c a valid Unicode value _and_ not an error code?
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF_IS_VALID(c) \
    + (UTF_IS_UNICODE_CHAR(c) && \
    + (c)!=UTF8_ERROR_VALUE_1 && (c)!=UTF8_ERROR_VALUE_2)
    +
    +/**
    + * Is this code unit or code point a surrogate (U+d800..U+dfff)?
    + * @deprecated ICU 2.4. Renamed to U_IS_SURROGATE and U16_IS_SURROGATE, see utf_old.h.
    + */
    +#define UTF_IS_SURROGATE(uchar) (((uchar)&0xfffff800)==0xd800)
    +
    +/**
    + * Is a given 32-bit code point a Unicode noncharacter?
    + *
    + * @deprecated ICU 2.4. Renamed to U_IS_UNICODE_NONCHAR, see utf_old.h.
    + */
    +#define UTF_IS_UNICODE_NONCHAR(c) \
    + ((c)>=0xfdd0 && \
    + ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \
    + (uint32_t)(c)<=0x10ffff)
    +
    +/**
    + * Is a given 32-bit value a Unicode code point value (0..U+10ffff)
    + * that can be assigned a character?
    + *
    + * Code points that are not characters include:
    + * - single surrogate code points (U+d800..U+dfff, 2048 code points)
    + * - the last two code points on each plane (U+__fffe and U+__ffff, 34 code points)
    + * - U+fdd0..U+fdef (new with Unicode 3.1, 32 code points)
    + * - the highest Unicode code point value is U+10ffff
    + *
    + * This means that all code points below U+d800 are character code points,
    + * and that boundary is tested first for performance.
    + *
    + * @deprecated ICU 2.4. Renamed to U_IS_UNICODE_CHAR, see utf_old.h.
    + */
    +#define UTF_IS_UNICODE_CHAR(c) \
    + ((uint32_t)(c)<0xd800 || \
    + ((uint32_t)(c)>0xdfff && \
    + (uint32_t)(c)<=0x10ffff && \
    + !UTF_IS_UNICODE_NONCHAR(c)))
    +
    +/* Formerly utf8.h ---------------------------------------------------------- */
    +
    +/**
    + * Count the trail bytes for a UTF-8 lead byte.
    + * @deprecated ICU 2.4. Renamed to U8_COUNT_TRAIL_BYTES, see utf_old.h.
    + */
    +#define UTF8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadByte])
    +
    +/**
    + * Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value.
    + * @deprecated ICU 2.4. Renamed to U8_MASK_LEAD_BYTE, see utf_old.h.
    + */
    +#define UTF8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1)
    +
    +/** Is this this code point a single code unit (byte)? @deprecated ICU 2.4. Renamed to U8_IS_SINGLE, see utf_old.h. */
    +#define UTF8_IS_SINGLE(uchar) (((uchar)&0x80)==0)
    +/** Is this this code unit the lead code unit (byte) of a code point? @deprecated ICU 2.4. Renamed to U8_IS_LEAD, see utf_old.h. */
    +#define UTF8_IS_LEAD(uchar) ((uint8_t)((uchar)-0xc0)<0x3e)
    +/** Is this this code unit a trailing code unit (byte) of a code point? @deprecated ICU 2.4. Renamed to U8_IS_TRAIL, see utf_old.h. */
    +#define UTF8_IS_TRAIL(uchar) (((uchar)&0xc0)==0x80)
    +
    +/** Does this scalar Unicode value need multiple code units for storage? @deprecated ICU 2.4. Use U8_LENGTH or test ((uint32_t)(c)>0x7f) instead, see utf_old.h. */
    +#define UTF8_NEED_MULTIPLE_UCHAR(c) ((uint32_t)(c)>0x7f)
    +
    +/**
    + * Given the lead character, how many bytes are taken by this code point.
    + * ICU does not deal with code points >0x10ffff
    + * unless necessary for advancing in the byte stream.
    + *
    + * These length macros take into account that for values >0x10ffff
    + * the UTF8_APPEND_CHAR_SAFE macros would write the error code point 0xffff
    + * with 3 bytes.
    + * Code point comparisons need to be in uint32_t because UChar32
    + * may be a signed type, and negative values must be recognized.
    + *
    + * @deprecated ICU 2.4. Use U8_LENGTH instead, see utf_old.h.
    + */
    +#if 1
    +# define UTF8_CHAR_LENGTH(c) \
    + ((uint32_t)(c)<=0x7f ? 1 : \
    + ((uint32_t)(c)<=0x7ff ? 2 : \
    + ((uint32_t)((c)-0x10000)>0xfffff ? 3 : 4) \
    + ) \
    + )
    +#else
    +# define UTF8_CHAR_LENGTH(c) \
    + ((uint32_t)(c)<=0x7f ? 1 : \
    + ((uint32_t)(c)<=0x7ff ? 2 : \
    + ((uint32_t)(c)<=0xffff ? 3 : \
    + ((uint32_t)(c)<=0x10ffff ? 4 : \
    + ((uint32_t)(c)<=0x3ffffff ? 5 : \
    + ((uint32_t)(c)<=0x7fffffff ? 6 : 3) \
    + ) \
    + ) \
    + ) \
    + ) \
    + )
    +#endif
    +
    +/** The maximum number of bytes per code point. @deprecated ICU 2.4. Renamed to U8_MAX_LENGTH, see utf_old.h. */
    +#define UTF8_MAX_CHAR_LENGTH 4
    +
    +/** Average number of code units compared to UTF-16. @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF8_ARRAY_SIZE(size) ((5*(size))/2)
    +
    +/** @deprecated ICU 2.4. Renamed to U8_GET_UNSAFE, see utf_old.h. */
    +#define UTF8_GET_CHAR_UNSAFE(s, i, c) { \
    + int32_t _utf8_get_char_unsafe_index=(int32_t)(i); \
    + UTF8_SET_CHAR_START_UNSAFE(s, _utf8_get_char_unsafe_index); \
    + UTF8_NEXT_CHAR_UNSAFE(s, _utf8_get_char_unsafe_index, c); \
    +}
    +
    +/** @deprecated ICU 2.4. Use U8_GET instead, see utf_old.h. */
    +#define UTF8_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
    + int32_t _utf8_get_char_safe_index=(int32_t)(i); \
    + UTF8_SET_CHAR_START_SAFE(s, start, _utf8_get_char_safe_index); \
    + UTF8_NEXT_CHAR_SAFE(s, _utf8_get_char_safe_index, length, c, strict); \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_NEXT_UNSAFE, see utf_old.h. */
    +#define UTF8_NEXT_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[(i)++]; \
    + if((uint8_t)((c)-0xc0)<0x35) { \
    + uint8_t __count=UTF8_COUNT_TRAIL_BYTES(c); \
    + UTF8_MASK_LEAD_BYTE(c, __count); \
    + switch(__count) { \
    + /* each following branch falls through to the next one */ \
    + case 3: \
    + (c)=((c)<<6)|((s)[(i)++]&0x3f); \
    + case 2: \
    + (c)=((c)<<6)|((s)[(i)++]&0x3f); \
    + case 1: \
    + (c)=((c)<<6)|((s)[(i)++]&0x3f); \
    + /* no other branches to optimize switch() */ \
    + break; \
    + } \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_APPEND_UNSAFE, see utf_old.h. */
    +#define UTF8_APPEND_CHAR_UNSAFE(s, i, c) { \
    + if((uint32_t)(c)<=0x7f) { \
    + (s)[(i)++]=(uint8_t)(c); \
    + } else { \
    + if((uint32_t)(c)<=0x7ff) { \
    + (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \
    + } else { \
    + if((uint32_t)(c)<=0xffff) { \
    + (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \
    + } else { \
    + (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); \
    + (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); \
    + } \
    + (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \
    + } \
    + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_FWD_1_UNSAFE, see utf_old.h. */
    +#define UTF8_FWD_1_UNSAFE(s, i) { \
    + (i)+=1+UTF8_COUNT_TRAIL_BYTES((s)[i]); \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_FWD_N_UNSAFE, see utf_old.h. */
    +#define UTF8_FWD_N_UNSAFE(s, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0) { \
    + UTF8_FWD_1_UNSAFE(s, i); \
    + --__N; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_SET_CP_START_UNSAFE, see utf_old.h. */
    +#define UTF8_SET_CHAR_START_UNSAFE(s, i) { \
    + while(UTF8_IS_TRAIL((s)[i])) { --(i); } \
    +}
    +
    +/** @deprecated ICU 2.4. Use U8_NEXT instead, see utf_old.h. */
    +#define UTF8_NEXT_CHAR_SAFE(s, i, length, c, strict) { \
    + (c)=(s)[(i)++]; \
    + if((c)>=0x80) { \
    + if(UTF8_IS_LEAD(c)) { \
    + (c)=utf8_nextCharSafeBody(s, &(i), (int32_t)(length), c, strict); \
    + } else { \
    + (c)=UTF8_ERROR_VALUE_1; \
    + } \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Use U8_APPEND instead, see utf_old.h. */
    +#define UTF8_APPEND_CHAR_SAFE(s, i, length, c) { \
    + if((uint32_t)(c)<=0x7f) { \
    + (s)[(i)++]=(uint8_t)(c); \
    + } else { \
    + (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(length), c, NULL); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_FWD_1, see utf_old.h. */
    +#define UTF8_FWD_1_SAFE(s, i, length) U8_FWD_1(s, i, length)
    +
    +/** @deprecated ICU 2.4. Renamed to U8_FWD_N, see utf_old.h. */
    +#define UTF8_FWD_N_SAFE(s, i, length, n) U8_FWD_N(s, i, length, n)
    +
    +/** @deprecated ICU 2.4. Renamed to U8_SET_CP_START, see utf_old.h. */
    +#define UTF8_SET_CHAR_START_SAFE(s, start, i) U8_SET_CP_START(s, start, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U8_PREV_UNSAFE, see utf_old.h. */
    +#define UTF8_PREV_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[--(i)]; \
    + if(UTF8_IS_TRAIL(c)) { \
    + uint8_t __b, __count=1, __shift=6; \
    +\
    + /* c is a trail byte */ \
    + (c)&=0x3f; \
    + for(;;) { \
    + __b=(s)[--(i)]; \
    + if(__b>=0xc0) { \
    + UTF8_MASK_LEAD_BYTE(__b, __count); \
    + (c)|=(UChar32)__b<<__shift; \
    + break; \
    + } else { \
    + (c)|=(UChar32)(__b&0x3f)<<__shift; \
    + ++__count; \
    + __shift+=6; \
    + } \
    + } \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_BACK_1_UNSAFE, see utf_old.h. */
    +#define UTF8_BACK_1_UNSAFE(s, i) { \
    + while(UTF8_IS_TRAIL((s)[--(i)])) {} \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_BACK_N_UNSAFE, see utf_old.h. */
    +#define UTF8_BACK_N_UNSAFE(s, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0) { \
    + UTF8_BACK_1_UNSAFE(s, i); \
    + --__N; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_SET_CP_LIMIT_UNSAFE, see utf_old.h. */
    +#define UTF8_SET_CHAR_LIMIT_UNSAFE(s, i) { \
    + UTF8_BACK_1_UNSAFE(s, i); \
    + UTF8_FWD_1_UNSAFE(s, i); \
    +}
    +
    +/** @deprecated ICU 2.4. Use U8_PREV instead, see utf_old.h. */
    +#define UTF8_PREV_CHAR_SAFE(s, start, i, c, strict) { \
    + (c)=(s)[--(i)]; \
    + if((c)>=0x80) { \
    + if((c)<=0xbf) { \
    + (c)=utf8_prevCharSafeBody(s, start, &(i), c, strict); \
    + } else { \
    + (c)=UTF8_ERROR_VALUE_1; \
    + } \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U8_BACK_1, see utf_old.h. */
    +#define UTF8_BACK_1_SAFE(s, start, i) U8_BACK_1(s, start, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U8_BACK_N, see utf_old.h. */
    +#define UTF8_BACK_N_SAFE(s, start, i, n) U8_BACK_N(s, start, i, n)
    +
    +/** @deprecated ICU 2.4. Renamed to U8_SET_CP_LIMIT, see utf_old.h. */
    +#define UTF8_SET_CHAR_LIMIT_SAFE(s, start, i, length) U8_SET_CP_LIMIT(s, start, i, length)
    +
    +/* Formerly utf16.h --------------------------------------------------------- */
    +
    +/** Is uchar a first/lead surrogate? @deprecated ICU 2.4. Renamed to U_IS_LEAD and U16_IS_LEAD, see utf_old.h. */
    +#define UTF_IS_FIRST_SURROGATE(uchar) (((uchar)&0xfffffc00)==0xd800)
    +
    +/** Is uchar a second/trail surrogate? @deprecated ICU 2.4. Renamed to U_IS_TRAIL and U16_IS_TRAIL, see utf_old.h. */
    +#define UTF_IS_SECOND_SURROGATE(uchar) (((uchar)&0xfffffc00)==0xdc00)
    +
    +/** Assuming c is a surrogate, is it a first/lead surrogate? @deprecated ICU 2.4. Renamed to U_IS_SURROGATE_LEAD and U16_IS_SURROGATE_LEAD, see utf_old.h. */
    +#define UTF_IS_SURROGATE_FIRST(c) (((c)&0x400)==0)
    +
    +/** Helper constant for UTF16_GET_PAIR_VALUE. @deprecated ICU 2.4. Renamed to U16_SURROGATE_OFFSET, see utf_old.h. */
    +#define UTF_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000)
    +
    +/** Get the UTF-32 value from the surrogate code units. @deprecated ICU 2.4. Renamed to U16_GET_SUPPLEMENTARY, see utf_old.h. */
    +#define UTF16_GET_PAIR_VALUE(first, second) \
    + (((first)<<10UL)+(second)-UTF_SURROGATE_OFFSET)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_LEAD, see utf_old.h. */
    +#define UTF_FIRST_SURROGATE(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_TRAIL, see utf_old.h. */
    +#define UTF_SECOND_SURROGATE(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_LEAD, see utf_old.h. */
    +#define UTF16_LEAD(supplementary) UTF_FIRST_SURROGATE(supplementary)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_TRAIL, see utf_old.h. */
    +#define UTF16_TRAIL(supplementary) UTF_SECOND_SURROGATE(supplementary)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_IS_SINGLE, see utf_old.h. */
    +#define UTF16_IS_SINGLE(uchar) !UTF_IS_SURROGATE(uchar)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_IS_LEAD, see utf_old.h. */
    +#define UTF16_IS_LEAD(uchar) UTF_IS_FIRST_SURROGATE(uchar)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_IS_TRAIL, see utf_old.h. */
    +#define UTF16_IS_TRAIL(uchar) UTF_IS_SECOND_SURROGATE(uchar)
    +
    +/** Does this scalar Unicode value need multiple code units for storage? @deprecated ICU 2.4. Use U16_LENGTH or test ((uint32_t)(c)>0xffff) instead, see utf_old.h. */
    +#define UTF16_NEED_MULTIPLE_UCHAR(c) ((uint32_t)(c)>0xffff)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_LENGTH, see utf_old.h. */
    +#define UTF16_CHAR_LENGTH(c) ((uint32_t)(c)<=0xffff ? 1 : 2)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_MAX_LENGTH, see utf_old.h. */
    +#define UTF16_MAX_CHAR_LENGTH 2
    +
    +/** Average number of code units compared to UTF-16. @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF16_ARRAY_SIZE(size) (size)
    +
    +/**
    + * Get a single code point from an offset that points to any
    + * of the code units that belong to that code point.
    + * Assume 0<=i<length.
    + *
    + * This could be used for iteration together with
    + * UTF16_CHAR_LENGTH() and UTF_IS_ERROR(),
    + * but the use of UTF16_NEXT_CHAR[_UNSAFE]() and
    + * UTF16_PREV_CHAR[_UNSAFE]() is more efficient for that.
    + * @deprecated ICU 2.4. Renamed to U16_GET_UNSAFE, see utf_old.h.
    + */
    +#define UTF16_GET_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[i]; \
    + if(UTF_IS_SURROGATE(c)) { \
    + if(UTF_IS_SURROGATE_FIRST(c)) { \
    + (c)=UTF16_GET_PAIR_VALUE((c), (s)[(i)+1]); \
    + } else { \
    + (c)=UTF16_GET_PAIR_VALUE((s)[(i)-1], (c)); \
    + } \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Use U16_GET instead, see utf_old.h. */
    +#define UTF16_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
    + (c)=(s)[i]; \
    + if(UTF_IS_SURROGATE(c)) { \
    + uint16_t __c2; \
    + if(UTF_IS_SURROGATE_FIRST(c)) { \
    + if((i)+1<(length) && UTF_IS_SECOND_SURROGATE(__c2=(s)[(i)+1])) { \
    + (c)=UTF16_GET_PAIR_VALUE((c), __c2); \
    + /* strict: ((c)&0xfffe)==0xfffe is caught by UTF_IS_ERROR() and UTF_IS_UNICODE_CHAR() */ \
    + } else if(strict) {\
    + /* unmatched first surrogate */ \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    + } else { \
    + if((i)-1>=(start) && UTF_IS_FIRST_SURROGATE(__c2=(s)[(i)-1])) { \
    + (c)=UTF16_GET_PAIR_VALUE(__c2, (c)); \
    + /* strict: ((c)&0xfffe)==0xfffe is caught by UTF_IS_ERROR() and UTF_IS_UNICODE_CHAR() */ \
    + } else if(strict) {\
    + /* unmatched second surrogate */ \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    + } \
    + } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_NEXT_UNSAFE, see utf_old.h. */
    +#define UTF16_NEXT_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[(i)++]; \
    + if(UTF_IS_FIRST_SURROGATE(c)) { \
    + (c)=UTF16_GET_PAIR_VALUE((c), (s)[(i)++]); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_APPEND_UNSAFE, see utf_old.h. */
    +#define UTF16_APPEND_CHAR_UNSAFE(s, i, c) { \
    + if((uint32_t)(c)<=0xffff) { \
    + (s)[(i)++]=(uint16_t)(c); \
    + } else { \
    + (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
    + (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_1_UNSAFE, see utf_old.h. */
    +#define UTF16_FWD_1_UNSAFE(s, i) { \
    + if(UTF_IS_FIRST_SURROGATE((s)[(i)++])) { \
    + ++(i); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_N_UNSAFE, see utf_old.h. */
    +#define UTF16_FWD_N_UNSAFE(s, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0) { \
    + UTF16_FWD_1_UNSAFE(s, i); \
    + --__N; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_START_UNSAFE, see utf_old.h. */
    +#define UTF16_SET_CHAR_START_UNSAFE(s, i) { \
    + if(UTF_IS_SECOND_SURROGATE((s)[i])) { \
    + --(i); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Use U16_NEXT instead, see utf_old.h. */
    +#define UTF16_NEXT_CHAR_SAFE(s, i, length, c, strict) { \
    + (c)=(s)[(i)++]; \
    + if(UTF_IS_FIRST_SURROGATE(c)) { \
    + uint16_t __c2; \
    + if((i)<(length) && UTF_IS_SECOND_SURROGATE(__c2=(s)[(i)])) { \
    + ++(i); \
    + (c)=UTF16_GET_PAIR_VALUE((c), __c2); \
    + /* strict: ((c)&0xfffe)==0xfffe is caught by UTF_IS_ERROR() and UTF_IS_UNICODE_CHAR() */ \
    + } else if(strict) {\
    + /* unmatched first surrogate */ \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    + } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
    + /* unmatched second surrogate or other non-character */ \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Use U16_APPEND instead, see utf_old.h. */
    +#define UTF16_APPEND_CHAR_SAFE(s, i, length, c) { \
    + if((uint32_t)(c)<=0xffff) { \
    + (s)[(i)++]=(uint16_t)(c); \
    + } else if((uint32_t)(c)<=0x10ffff) { \
    + if((i)+1<(length)) { \
    + (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
    + (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
    + } else /* not enough space */ { \
    + (s)[(i)++]=UTF_ERROR_VALUE; \
    + } \
    + } else /* c>0x10ffff, write error value */ { \
    + (s)[(i)++]=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_1, see utf_old.h. */
    +#define UTF16_FWD_1_SAFE(s, i, length) U16_FWD_1(s, i, length)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_N, see utf_old.h. */
    +#define UTF16_FWD_N_SAFE(s, i, length, n) U16_FWD_N(s, i, length, n)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_START, see utf_old.h. */
    +#define UTF16_SET_CHAR_START_SAFE(s, start, i) U16_SET_CP_START(s, start, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_PREV_UNSAFE, see utf_old.h. */
    +#define UTF16_PREV_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[--(i)]; \
    + if(UTF_IS_SECOND_SURROGATE(c)) { \
    + (c)=UTF16_GET_PAIR_VALUE((s)[--(i)], (c)); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_1_UNSAFE, see utf_old.h. */
    +#define UTF16_BACK_1_UNSAFE(s, i) { \
    + if(UTF_IS_SECOND_SURROGATE((s)[--(i)])) { \
    + --(i); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_N_UNSAFE, see utf_old.h. */
    +#define UTF16_BACK_N_UNSAFE(s, i, n) { \
    + int32_t __N=(n); \
    + while(__N>0) { \
    + UTF16_BACK_1_UNSAFE(s, i); \
    + --__N; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_LIMIT_UNSAFE, see utf_old.h. */
    +#define UTF16_SET_CHAR_LIMIT_UNSAFE(s, i) { \
    + if(UTF_IS_FIRST_SURROGATE((s)[(i)-1])) { \
    + ++(i); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Use U16_PREV instead, see utf_old.h. */
    +#define UTF16_PREV_CHAR_SAFE(s, start, i, c, strict) { \
    + (c)=(s)[--(i)]; \
    + if(UTF_IS_SECOND_SURROGATE(c)) { \
    + uint16_t __c2; \
    + if((i)>(start) && UTF_IS_FIRST_SURROGATE(__c2=(s)[(i)-1])) { \
    + --(i); \
    + (c)=UTF16_GET_PAIR_VALUE(__c2, (c)); \
    + /* strict: ((c)&0xfffe)==0xfffe is caught by UTF_IS_ERROR() and UTF_IS_UNICODE_CHAR() */ \
    + } else if(strict) {\
    + /* unmatched second surrogate */ \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    + } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
    + /* unmatched first surrogate or other non-character */ \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_1, see utf_old.h. */
    +#define UTF16_BACK_1_SAFE(s, start, i) U16_BACK_1(s, start, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_N, see utf_old.h. */
    +#define UTF16_BACK_N_SAFE(s, start, i, n) U16_BACK_N(s, start, i, n)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_LIMIT, see utf_old.h. */
    +#define UTF16_SET_CHAR_LIMIT_SAFE(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
    +
    +/* Formerly utf32.h --------------------------------------------------------- */
    +
    +/*
    +* Old documentation:
    +*
    +* This file defines macros to deal with UTF-32 code units and code points.
    +* Signatures and semantics are the same as for the similarly named macros
    +* in utf16.h.
    +* utf32.h is included by utf.h after unicode/umachine.h</p>
    +* and some common definitions.
    +* <p><b>Usage:</b> ICU coding guidelines for if() statements should be followed when using these macros.
    +* Compound statements (curly braces {}) must be used for if-else-while...
    +* bodies and all macro statements should be terminated with semicolon.</p>
    +*/
    +
    +/* internal definitions ----------------------------------------------------- */
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_IS_SAFE(c, strict) \
    + (!(strict) ? \
    + (uint32_t)(c)<=0x10ffff : \
    + UTF_IS_UNICODE_CHAR(c))
    +
    +/*
    + * For the semantics of all of these macros, see utf16.h.
    + * The UTF-32 versions are trivial because any code point is
    + * encoded using exactly one code unit.
    + */
    +
    +/* single-code point definitions -------------------------------------------- */
    +
    +/* classes of code unit values */
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_IS_SINGLE(uchar) 1
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_IS_LEAD(uchar) 0
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_IS_TRAIL(uchar) 0
    +
    +/* number of code units per code point */
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_NEED_MULTIPLE_UCHAR(c) 0
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_CHAR_LENGTH(c) 1
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_MAX_CHAR_LENGTH 1
    +
    +/* average number of code units compared to UTF-16 */
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_ARRAY_SIZE(size) (size)
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_GET_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[i]; \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
    + (c)=(s)[i]; \
    + if(!UTF32_IS_SAFE(c, strict)) { \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/* definitions with forward iteration --------------------------------------- */
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_NEXT_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[(i)++]; \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_APPEND_CHAR_UNSAFE(s, i, c) { \
    + (s)[(i)++]=(c); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_FWD_1_UNSAFE(s, i) { \
    + ++(i); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_FWD_N_UNSAFE(s, i, n) { \
    + (i)+=(n); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_SET_CHAR_START_UNSAFE(s, i) { \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_NEXT_CHAR_SAFE(s, i, length, c, strict) { \
    + (c)=(s)[(i)++]; \
    + if(!UTF32_IS_SAFE(c, strict)) { \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_APPEND_CHAR_SAFE(s, i, length, c) { \
    + if((uint32_t)(c)<=0x10ffff) { \
    + (s)[(i)++]=(c); \
    + } else /* c>0x10ffff, write 0xfffd */ { \
    + (s)[(i)++]=0xfffd; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_FWD_1_SAFE(s, i, length) { \
    + ++(i); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_FWD_N_SAFE(s, i, length, n) { \
    + if(((i)+=(n))>(length)) { \
    + (i)=(length); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_SET_CHAR_START_SAFE(s, start, i) { \
    +}
    +
    +/* definitions with backward iteration -------------------------------------- */
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_PREV_CHAR_UNSAFE(s, i, c) { \
    + (c)=(s)[--(i)]; \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_BACK_1_UNSAFE(s, i) { \
    + --(i); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_BACK_N_UNSAFE(s, i, n) { \
    + (i)-=(n); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_SET_CHAR_LIMIT_UNSAFE(s, i) { \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_PREV_CHAR_SAFE(s, start, i, c, strict) { \
    + (c)=(s)[--(i)]; \
    + if(!UTF32_IS_SAFE(c, strict)) { \
    + (c)=UTF_ERROR_VALUE; \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_BACK_1_SAFE(s, start, i) { \
    + --(i); \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_BACK_N_SAFE(s, start, i, n) { \
    + (i)-=(n); \
    + if((i)<(start)) { \
    + (i)=(start); \
    + } \
    +}
    +
    +/** @deprecated ICU 2.4. Obsolete, see utf_old.h. */
    +#define UTF32_SET_CHAR_LIMIT_SAFE(s, i, length) { \
    +}
    +
    +/* Formerly utf.h, part 2 --------------------------------------------------- */
    +
    +/**
    + * Estimate the number of code units for a string based on the number of UTF-16 code units.
    + *
    + * @deprecated ICU 2.4. Obsolete, see utf_old.h.
    + */
    +#define UTF_ARRAY_SIZE(size) UTF16_ARRAY_SIZE(size)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_GET_UNSAFE, see utf_old.h. */
    +#define UTF_GET_CHAR_UNSAFE(s, i, c) UTF16_GET_CHAR_UNSAFE(s, i, c)
    +
    +/** @deprecated ICU 2.4. Use U16_GET instead, see utf_old.h. */
    +#define UTF_GET_CHAR_SAFE(s, start, i, length, c, strict) UTF16_GET_CHAR_SAFE(s, start, i, length, c, strict)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_NEXT_UNSAFE, see utf_old.h. */
    +#define UTF_NEXT_CHAR_UNSAFE(s, i, c) UTF16_NEXT_CHAR_UNSAFE(s, i, c)
    +
    +/** @deprecated ICU 2.4. Use U16_NEXT instead, see utf_old.h. */
    +#define UTF_NEXT_CHAR_SAFE(s, i, length, c, strict) UTF16_NEXT_CHAR_SAFE(s, i, length, c, strict)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_APPEND_UNSAFE, see utf_old.h. */
    +#define UTF_APPEND_CHAR_UNSAFE(s, i, c) UTF16_APPEND_CHAR_UNSAFE(s, i, c)
    +
    +/** @deprecated ICU 2.4. Use U16_APPEND instead, see utf_old.h. */
    +#define UTF_APPEND_CHAR_SAFE(s, i, length, c) UTF16_APPEND_CHAR_SAFE(s, i, length, c)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_1_UNSAFE, see utf_old.h. */
    +#define UTF_FWD_1_UNSAFE(s, i) UTF16_FWD_1_UNSAFE(s, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_1, see utf_old.h. */
    +#define UTF_FWD_1_SAFE(s, i, length) UTF16_FWD_1_SAFE(s, i, length)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_N_UNSAFE, see utf_old.h. */
    +#define UTF_FWD_N_UNSAFE(s, i, n) UTF16_FWD_N_UNSAFE(s, i, n)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_FWD_N, see utf_old.h. */
    +#define UTF_FWD_N_SAFE(s, i, length, n) UTF16_FWD_N_SAFE(s, i, length, n)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_START_UNSAFE, see utf_old.h. */
    +#define UTF_SET_CHAR_START_UNSAFE(s, i) UTF16_SET_CHAR_START_UNSAFE(s, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_START, see utf_old.h. */
    +#define UTF_SET_CHAR_START_SAFE(s, start, i) UTF16_SET_CHAR_START_SAFE(s, start, i)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_PREV_UNSAFE, see utf_old.h. */
    +#define UTF_PREV_CHAR_UNSAFE(s, i, c) UTF16_PREV_CHAR_UNSAFE(s, i, c)
    +
    +/** @deprecated ICU 2.4. Use U16_PREV instead, see utf_old.h. */
    +#define UTF_PREV_CHAR_SAFE(s, start, i, c, strict) UTF16_PREV_CHAR_SAFE(s, start, i, c, strict)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_1_UNSAFE, see utf_old.h. */
    +#define UTF_BACK_1_UNSAFE(s, i) UTF16_BACK_1_UNSAFE(s, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_1, see utf_old.h. */
    +#define UTF_BACK_1_SAFE(s, start, i) UTF16_BACK_1_SAFE(s, start, i)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_N_UNSAFE, see utf_old.h. */
    +#define UTF_BACK_N_UNSAFE(s, i, n) UTF16_BACK_N_UNSAFE(s, i, n)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_BACK_N, see utf_old.h. */
    +#define UTF_BACK_N_SAFE(s, start, i, n) UTF16_BACK_N_SAFE(s, start, i, n)
    +
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_LIMIT_UNSAFE, see utf_old.h. */
    +#define UTF_SET_CHAR_LIMIT_UNSAFE(s, i) UTF16_SET_CHAR_LIMIT_UNSAFE(s, i)
    +
    +/** @deprecated ICU 2.4. Renamed to U16_SET_CP_LIMIT, see utf_old.h. */
    +#define UTF_SET_CHAR_LIMIT_SAFE(s, start, i, length) UTF16_SET_CHAR_LIMIT_SAFE(s, start, i, length)
    +
    +/* Define default macros (UTF-16 "safe") ------------------------------------ */
    +
    +/**
    + * Does this code unit alone encode a code point (BMP, not a surrogate)?
    + * Same as UTF16_IS_SINGLE.
    + * @deprecated ICU 2.4. Renamed to U_IS_SINGLE and U16_IS_SINGLE, see utf_old.h.
    + */
    +#define UTF_IS_SINGLE(uchar) U16_IS_SINGLE(uchar)
    +
    +/**
    + * Is this code unit the first one of several (a lead surrogate)?
    + * Same as UTF16_IS_LEAD.
    + * @deprecated ICU 2.4. Renamed to U_IS_LEAD and U16_IS_LEAD, see utf_old.h.
    + */
    +#define UTF_IS_LEAD(uchar) U16_IS_LEAD(uchar)
    +
    +/**
    + * Is this code unit one of several but not the first one (a trail surrogate)?
    + * Same as UTF16_IS_TRAIL.
    + * @deprecated ICU 2.4. Renamed to U_IS_TRAIL and U16_IS_TRAIL, see utf_old.h.
    + */
    +#define UTF_IS_TRAIL(uchar) U16_IS_TRAIL(uchar)
    +
    +/**
    + * Does this code point require multiple code units (is it a supplementary code point)?
    + * Same as UTF16_NEED_MULTIPLE_UCHAR.
    + * @deprecated ICU 2.4. Use U16_LENGTH or test ((uint32_t)(c)>0xffff) instead.
    + */
    +#define UTF_NEED_MULTIPLE_UCHAR(c) UTF16_NEED_MULTIPLE_UCHAR(c)
    +
    +/**
    + * How many code units are used to encode this code point (1 or 2)?
    + * Same as UTF16_CHAR_LENGTH.
    + * @deprecated ICU 2.4. Renamed to U16_LENGTH, see utf_old.h.
    + */
    +#define UTF_CHAR_LENGTH(c) U16_LENGTH(c)
    +
    +/**
    + * How many code units are used at most for any Unicode code point (2)?
    + * Same as UTF16_MAX_CHAR_LENGTH.
    + * @deprecated ICU 2.4. Renamed to U16_MAX_LENGTH, see utf_old.h.
    + */
    +#define UTF_MAX_CHAR_LENGTH U16_MAX_LENGTH
    +
    +/**
    + * Set c to the code point that contains the code unit i.
    + * i could point to the lead or the trail surrogate for the code point.
    + * i is not modified.
    + * Same as UTF16_GET_CHAR.
    + * \pre 0<=i<length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_GET, see utf_old.h.
    + */
    +#define UTF_GET_CHAR(s, start, i, length, c) U16_GET(s, start, i, length, c)
    +
    +/**
    + * Set c to the code point that starts at code unit i
    + * and advance i to beyond the code units of this code point (post-increment).
    + * i must point to the first code unit of a code point.
    + * Otherwise c is set to the trail unit (surrogate) itself.
    + * Same as UTF16_NEXT_CHAR.
    + * \pre 0<=i<length
    + * \post 0<i<=length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_NEXT, see utf_old.h.
    + */
    +#define UTF_NEXT_CHAR(s, i, length, c) U16_NEXT(s, i, length, c)
    +
    +/**
    + * Append the code units of code point c to the string at index i
    + * and advance i to beyond the new code units (post-increment).
    + * The code units beginning at index i will be overwritten.
    + * Same as UTF16_APPEND_CHAR.
    + * \pre 0<=c<=0x10ffff
    + * \pre 0<=i<length
    + * \post 0<i<=length
    + *
    + * @deprecated ICU 2.4. Use U16_APPEND instead, see utf_old.h.
    + */
    +#define UTF_APPEND_CHAR(s, i, length, c) UTF16_APPEND_CHAR_SAFE(s, i, length, c)
    +
    +/**
    + * Advance i to beyond the code units of the code point that begins at i.
    + * I.e., advance i by one code point.
    + * Same as UTF16_FWD_1.
    + * \pre 0<=i<length
    + * \post 0<i<=length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_FWD_1, see utf_old.h.
    + */
    +#define UTF_FWD_1(s, i, length) U16_FWD_1(s, i, length)
    +
    +/**
    + * Advance i to beyond the code units of the n code points where the first one begins at i.
    + * I.e., advance i by n code points.
    + * Same as UT16_FWD_N.
    + * \pre 0<=i<length
    + * \post 0<i<=length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_FWD_N, see utf_old.h.
    + */
    +#define UTF_FWD_N(s, i, length, n) U16_FWD_N(s, i, length, n)
    +
    +/**
    + * Take the random-access index i and adjust it so that it points to the beginning
    + * of a code point.
    + * The input index points to any code unit of a code point and is moved to point to
    + * the first code unit of the same code point. i is never incremented.
    + * In other words, if i points to a trail surrogate that is preceded by a matching
    + * lead surrogate, then i is decremented. Otherwise it is not modified.
    + * This can be used to start an iteration with UTF_NEXT_CHAR() from a random index.
    + * Same as UTF16_SET_CHAR_START.
    + * \pre start<=i<length
    + * \post start<=i<length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_SET_CP_START, see utf_old.h.
    + */
    +#define UTF_SET_CHAR_START(s, start, i) U16_SET_CP_START(s, start, i)
    +
    +/**
    + * Set c to the code point that has code units before i
    + * and move i backward (towards the beginning of the string)
    + * to the first code unit of this code point (pre-increment).
    + * i must point to the first code unit after the last unit of a code point (i==length is allowed).
    + * Same as UTF16_PREV_CHAR.
    + * \pre start<i<=length
    + * \post start<=i<length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_PREV, see utf_old.h.
    + */
    +#define UTF_PREV_CHAR(s, start, i, c) U16_PREV(s, start, i, c)
    +
    +/**
    + * Move i backward (towards the beginning of the string)
    + * to the first code unit of the code point that has code units before i.
    + * I.e., move i backward by one code point.
    + * i must point to the first code unit after the last unit of a code point (i==length is allowed).
    + * Same as UTF16_BACK_1.
    + * \pre start<i<=length
    + * \post start<=i<length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_BACK_1, see utf_old.h.
    + */
    +#define UTF_BACK_1(s, start, i) U16_BACK_1(s, start, i)
    +
    +/**
    + * Move i backward (towards the beginning of the string)
    + * to the first code unit of the n code points that have code units before i.
    + * I.e., move i backward by n code points.
    + * i must point to the first code unit after the last unit of a code point (i==length is allowed).
    + * Same as UTF16_BACK_N.
    + * \pre start<i<=length
    + * \post start<=i<length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_BACK_N, see utf_old.h.
    + */
    +#define UTF_BACK_N(s, start, i, n) U16_BACK_N(s, start, i, n)
    +
    +/**
    + * Take the random-access index i and adjust it so that it points beyond
    + * a code point. The input index points beyond any code unit
    + * of a code point and is moved to point beyond the last code unit of the same
    + * code point. i is never decremented.
    + * In other words, if i points to a trail surrogate that is preceded by a matching
    + * lead surrogate, then i is incremented. Otherwise it is not modified.
    + * This can be used to start an iteration with UTF_PREV_CHAR() from a random index.
    + * Same as UTF16_SET_CHAR_LIMIT.
    + * \pre start<i<=length
    + * \post start<i<=length
    + *
    + * @deprecated ICU 2.4. Renamed to U16_SET_CP_LIMIT, see utf_old.h.
    + */
    +#define UTF_SET_CHAR_LIMIT(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
    +
    +#endif /* U_HIDE_DEPRECATED_API */
    +
    +#endif
    +

    http://git-wip-us.apache.org/repos/asf/couchdb-couch-collate/blob/32ffa429/platform/osx/icu/unicode/utmscale.h
    ----------------------------------------------------------------------
    diff --git a/platform/osx/icu/unicode/utmscale.h b/platform/osx/icu/unicode/utmscale.h
    new file mode 100644
    index 0000000..368e426
    --- /dev/null
    +++ b/platform/osx/icu/unicode/utmscale.h
    @@ -0,0 +1,481 @@
    +/*
    +*******************************************************************************
    +* Copyright (C) 2004 - 2008, International Business Machines Corporation and
    +* others. All Rights Reserved.
    +*******************************************************************************
    +*/
    +
    +#ifndef UTMSCALE_H
    +#define UTMSCALE_H
    +
    +#include "unicode/utypes.h"
    +
    +#if !UCONFIG_NO_FORMATTING
    +
    +/**
    + * \file
    + * \brief C API: Universal Time Scale
    + *
    + * There are quite a few different conventions for binary datetime, depending on different
    + * platforms and protocols. Some of these have severe drawbacks. For example, people using
    + * Unix time (seconds since Jan 1, 1970) think that they are safe until near the year 2038.
    + * But cases can and do arise where arithmetic manipulations causes serious problems. Consider
    + * the computation of the average of two datetimes, for example: if one calculates them with
    + * <code>averageTime = (time1 + time2)/2</code>, there will be overflow even with dates
    + * around the present. Moreover, even if these problems don't occur, there is the issue of
    + * conversion back and forth between different systems.
    + *
    + * <p>
    + * Binary datetimes differ in a number of ways: the datatype, the unit,
    + * and the epoch (origin). We'll refer to these as time scales. For example:
    + *
    + * <table border="1" cellspacing="0" cellpadding="4">
    + * <caption>Table 1: Binary Time Scales</caption>
    + * <tr>
    + * <th align="left">Source</th>
    + * <th align="left">Datatype</th>
    + * <th align="left">Unit</th>
    + * <th align="left">Epoch</th>
    + * </tr>
    + *
    + * <tr>
    + * <td>UDTS_JAVA_TIME</td>
    + * <td>int64_t</td>
    + * <td>milliseconds</td>
    + * <td>Jan 1, 1970</td>
    + * </tr>
    + * <tr>
    + *
    + * <td>UDTS_UNIX_TIME</td>
    + * <td>int32_t or int64_t</td>
    + * <td>seconds</td>
    + * <td>Jan 1, 1970</td>
    + * </tr>
    + * <tr>
    + * <td>UDTS_ICU4C_TIME</td>
    + *
    + * <td>double</td>
    + * <td>milliseconds</td>
    + * <td>Jan 1, 1970</td>
    + * </tr>
    + * <tr>
    + * <td>UDTS_WINDOWS_FILE_TIME</td>
    + * <td>int64_t</td>
    + *
    + * <td>ticks (100 nanoseconds)</td>
    + * <td>Jan 1, 1601</td>
    + * </tr>
    + * <tr>
    + * <td>UDTS_DOTNET_DATE_TIME</td>
    + * <td>int64_t</td>
    + * <td>ticks (100 nanoseconds)</td>
    + *
    + * <td>Jan 1, 0001</td>
    + * </tr>
    + * <tr>
    + * <td>UDTS_MAC_OLD_TIME</td>
    + * <td>int32_t or int64_t</td>
    + * <td>seconds</td>
    + * <td>Jan 1, 1904</td>
    + *
    + * </tr>
    + * <tr>
    + * <td>UDTS_MAC_TIME</td>
    + * <td>double</td>
    + * <td>seconds</td>
    + * <td>Jan 1, 2001</td>
    + * </tr>
    + *
    + * <tr>
    + * <td>UDTS_EXCEL_TIME</td>
    + * <td>?</td>
    + * <td>days</td>
    + * <td>Dec 31, 1899</td>
    + * </tr>
    + * <tr>
    + *
    + * <td>UDTS_DB2_TIME</td>
    + * <td>?</td>
    + * <td>days</td>
    + * <td>Dec 31, 1899</td>
    + * </tr>
    + *
    + * <tr>
    + * <td>UDTS_UNIX_MICROSECONDS_TIME</td>
    + * <td>int64_t</td>
    + * <td>microseconds</td>
    + * <td>Jan 1, 1970</td>
    + * </tr>
    + * </table>
    + *
    + * <p>
    + * All of the epochs start at 00:00 am (the earliest possible time on the day in question),
    + * and are assumed to be UTC.
    + *
    + * <p>
    + * The ranges for different datatypes are given in the following table (all values in years).
    + * The range of years includes the entire range expressible with positive and negative
    + * values of the datatype. The range of years for double is the range that would be allowed
    + * without losing precision to the corresponding unit.
    + *
    + * <table border="1" cellspacing="0" cellpadding="4">
    + * <tr>
    + * <th align="left">Units</th>
    + * <th align="left">int64_t</th>
    + * <th align="left">double</th>
    + * <th align="left">int32_t</th>
    + * </tr>
    + *
    + * <tr>
    + * <td>1 sec</td>
    + * <td align="right">5.84542x10<sup>11</sup></td>
    + * <td align="right">285,420,920.94</td>
    + * <td align="right">136.10</td>
    + * </tr>
    + * <tr>
    + *
    + * <td>1 millisecond</td>
    + * <td align="right">584,542,046.09</td>
    + * <td align="right">285,420.92</td>
    + * <td align="right">0.14</td>
    + * </tr>