summaryrefslogtreecommitdiff
path: root/tools/icu4c_srcgen/doc_patches/patches/unicode/utext.h.patch
blob: 978a75c5b6129cc3fb0ee36c968ed15d3efae6cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
--- libicu/ndk_headers/unicode/utext.h	2021-07-29 18:38:27.265302620 +0100
+++ libicu/ndk_headers/unicode/utext.h	2021-07-29 18:38:27.533304961 +0100
@@ -627,787 +627,6 @@
 
 
 
-/************************************************************************************
- *
- *  #define inline versions of selected performance-critical text access functions
- *          Caution:  do not use auto increment++ or decrement-- expressions
- *                    as parameters to these macros.
- *
- *          For most use, where there is no extreme performance constraint, the
- *          normal, non-inline functions are a better choice.  The resulting code
- *          will be smaller, and, if the need ever arises, easier to debug.
- *
- *          These are implemented as #defines rather than real functions
- *          because there is no fully portable way to do inline functions in plain C.
- *
- ************************************************************************************/
-
-#ifndef U_HIDE_INTERNAL_API
-/**
- * inline version of utext_current32(), for performance-critical situations.
- *
- * Get the code point at the current iteration position of the UText.
- * Returns U_SENTINEL (-1) if the position is at the end of the
- * text.
- *
- * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. ICU 4.4 technology preview
- */
-#define UTEXT_CURRENT32(ut)  \
-    ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
-    ((ut)->chunkContents)[((ut)->chunkOffset)] : utext_current32(ut))
-#endif  /* U_HIDE_INTERNAL_API */
-
-/**
- * inline version of utext_next32(), for performance-critical situations.
- *
- * Get the code point at the current iteration position of the UText, and
- * advance the position to the first index following the character.
- * This is a post-increment operation.
- * Returns U_SENTINEL (-1) if the position is at the end of the
- * text.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-#define UTEXT_NEXT32(ut)  \
-    ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
-    ((ut)->chunkContents)[((ut)->chunkOffset)++] : utext_next32(ut))
-
-/**
- * inline version of utext_previous32(), for performance-critical situations.
- *
- *  Move the iterator position to the character (code point) whose
- *  index precedes the current position, and return that character.
- *  This is a pre-decrement operation.
- *  Returns U_SENTINEL (-1) if the position is at the start of the  text.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-#define UTEXT_PREVIOUS32(ut)  \
-    ((ut)->chunkOffset > 0 && \
-     (ut)->chunkContents[(ut)->chunkOffset-1] < 0xd800 ? \
-          (ut)->chunkContents[--((ut)->chunkOffset)]  :  utext_previous32(ut))
-
-/**
-  *  inline version of utext_getNativeIndex(), for performance-critical situations.
-  *
-  * Get the current iterator position, which can range from 0 to 
-  * the length of the text.
-  * The position is a native index into the input text, in whatever format it
-  * may have (possibly UTF-8 for example), and may not always be the same as
-  * the corresponding UChar (UTF-16) index.
-  * The returned position will always be aligned to a code point boundary. 
-  *
-  * \xrefitem stable "Stable" "Stable List" ICU 3.6
-  */
-#define UTEXT_GETNATIVEINDEX(ut)                       \
-    ((ut)->chunkOffset <= (ut)->nativeIndexingLimit?   \
-        (ut)->chunkNativeStart+(ut)->chunkOffset :     \
-        (ut)->pFuncs->mapOffsetToNative(ut))    
-
-/**
-  *  inline version of utext_setNativeIndex(), for performance-critical situations.
-  *
-  * Set the current iteration position to the nearest code point
-  * boundary at or preceding the specified index.
-  * The index is in the native units of the original input text.
-  * If the index is out of range, it will be pinned to be within
-  * the range of the input text.
-  *
-  * \xrefitem stable "Stable" "Stable List" ICU 3.8
-  */
-#define UTEXT_SETNATIVEINDEX(ut, ix) UPRV_BLOCK_MACRO_BEGIN { \
-    int64_t __offset = (ix) - (ut)->chunkNativeStart; \
-    if (__offset>=0 && __offset<(int64_t)(ut)->nativeIndexingLimit && (ut)->chunkContents[__offset]<0xdc00) { \
-        (ut)->chunkOffset=(int32_t)__offset; \
-    } else { \
-        utext_setNativeIndex((ut), (ix)); \
-    } \
-} UPRV_BLOCK_MACRO_END
-
-
-
-/************************************************************************************
- *
- *   Functions related to writing or modifying the text.
- *   These will work only with modifiable UTexts.  Attempting to
- *   modify a read-only UText will return an error status.
- *
- ************************************************************************************/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * UText provider properties (bit field indexes).
- *
- * @see UText
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-enum {
-    /**
-     * It is potentially time consuming for the provider to determine the length of the text.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    UTEXT_PROVIDER_LENGTH_IS_EXPENSIVE = 1,
-    /**
-     * Text chunks remain valid and usable until the text object is modified or
-     * deleted, not just until the next time the access() function is called
-     * (which is the default).
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    UTEXT_PROVIDER_STABLE_CHUNKS = 2,
-    /**
-     * The provider supports modifying the text via the replace() and copy()
-     * functions.
-     * @see Replaceable
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    UTEXT_PROVIDER_WRITABLE = 3,
-    /**
-     * There is meta data associated with the text.
-     * @see Replaceable::hasMetaData()
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */ 
-    UTEXT_PROVIDER_HAS_META_DATA = 4,
-    /**
-     * Text provider owns the text storage.
-     *  Generally occurs as the result of a deep clone of the UText.
-     *  When closing the UText, the associated text must
-     *  also be closed/deleted/freed/ whatever is appropriate.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-     UTEXT_PROVIDER_OWNS_TEXT = 5
-};
-
-/**
-  * Function type declaration for UText.clone().
-  *
-  *  clone a UText.  Much like opening a UText where the source text is itself
-  *  another UText.
-  *
-  *  A deep clone will copy both the UText data structures and the underlying text.
-  *  The original and cloned UText will operate completely independently; modifications
-  *  made to the text in one will not effect the other.  Text providers are not
-  *  required to support deep clones.  The user of clone() must check the status return
-  *  and be prepared to handle failures.
-  *
-  *  A shallow clone replicates only the UText data structures; it does not make
-  *  a copy of the underlying text.  Shallow clones can be used as an efficient way to 
-  *  have multiple iterators active in a single text string that is not being
-  *  modified.
-  *
-  *  A shallow clone operation must not fail except for truly exceptional conditions such
-  *  as memory allocation failures.
-  *
-  *  A UText and its clone may be safely concurrently accessed by separate threads.
-  *  This is true for both shallow and deep clones.
-  *  It is the responsibility of the Text Provider to ensure that this thread safety
-  *  constraint is met.
-
-  *
-  *  @param dest   A UText struct to be filled in with the result of the clone operation,
-  *                or NULL if the clone function should heap-allocate a new UText struct.
-  *  @param src    The UText to be cloned.
-  *  @param deep   true to request a deep clone, false for a shallow clone.
-  *  @param status Errors are returned here.  For deep clones, U_UNSUPPORTED_ERROR
-  *                should be returned if the text provider is unable to clone the
-  *                original text.
-  *  @return       The newly created clone, or NULL if the clone operation failed.
-  *
-  * \xrefitem stable "Stable" "Stable List" ICU 3.4
-  */
-typedef UText * U_CALLCONV
-UTextClone(UText *dest, const UText *src, UBool deep, UErrorCode *status);
-
-
-/**
- * Function type declaration for UText.nativeLength().
- *
- * @param ut the UText to get the length of.
- * @return the length, in the native units of the original text string.
- * @see UText
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef int64_t U_CALLCONV
-UTextNativeLength(UText *ut);
-
-/**
- * Function type declaration for UText.access().  Get the description of the text chunk
- *  containing the text at a requested native index.  The UText's iteration
- *  position will be left at the requested index.  If the index is out
- *  of bounds, the iteration position will be left at the start or end
- *  of the string, as appropriate.
- *
- *  Chunks must begin and end on code point boundaries.  A single code point
- *  comprised of multiple storage units must never span a chunk boundary.
- *
- *
- * @param ut          the UText being accessed.
- * @param nativeIndex Requested index of the text to be accessed.
- * @param forward     If true, then the returned chunk must contain text
- *                    starting from the index, so that start<=index<limit.
- *                    If false, then the returned chunk must contain text
- *                    before the index, so that start<index<=limit.
- * @return            True if the requested index could be accessed.  The chunk
- *                    will contain the requested text.
- *                    False value if a chunk cannot be accessed
- *                    (the requested index is out of bounds).
- *
- * @see UText
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef UBool U_CALLCONV
-UTextAccess(UText *ut, int64_t nativeIndex, UBool forward);
-
-/**
- * Function type declaration for UText.extract().
- *
- * Extract text from a UText into a UChar buffer.  The range of text to be extracted
- * is specified in the native indices of the UText provider.  These may not necessarily
- * be UTF-16 indices.
- * <p>
- * The size (number of 16 bit UChars) in the data to be extracted is returned.  The
- * full amount is returned, even when the specified buffer size is smaller.
- * <p>
- * The extracted string will (if you are a user) / must (if you are a text provider)
- * be NUL-terminated if there is sufficient space in the destination buffer.
- *
- * @param  ut            the UText from which to extract data.
- * @param  nativeStart   the native index of the first character to extract.
- * @param  nativeLimit   the native string index of the position following the last
- *                       character to extract.
- * @param  dest          the UChar (UTF-16) buffer into which the extracted text is placed
- * @param  destCapacity  The size, in UChars, of the destination buffer.  May be zero
- *                       for precomputing the required size.
- * @param  status        receives any error status.
- *                       If U_BUFFER_OVERFLOW_ERROR: Returns number of UChars for
- *                       preflighting.
- * @return Number of UChars in the data.  Does not include a trailing NUL.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef int32_t U_CALLCONV
-UTextExtract(UText *ut,
-             int64_t nativeStart, int64_t nativeLimit,
-             UChar *dest, int32_t destCapacity,
-             UErrorCode *status);
-
-/**
- * Function type declaration for UText.replace().
- *
- * Replace a range of the original text with a replacement text.
- *
- * Leaves the current iteration position at the position following the
- *  newly inserted replacement text.
- *
- * This function need only be implemented on UText types that support writing.
- *
- * When using this function, there should be only a single UText opened onto the
- * underlying native text string.  The function is responsible for updating the
- * text chunk within the UText to reflect the updated iteration position,
- * taking into account any changes to the underlying string's structure caused
- * by the replace operation.
- *
- * @param ut               the UText representing the text to be operated on.
- * @param nativeStart      the index of the start of the region to be replaced
- * @param nativeLimit      the index of the character following the region to be replaced.
- * @param replacementText  pointer to the replacement text
- * @param replacmentLength length of the replacement text in UChars, or -1 if the text is NUL terminated.
- * @param status           receives any error status.  Possible errors include
- *                         U_NO_WRITE_PERMISSION
- *
- * @return The signed number of (native) storage units by which
- *         the length of the text expanded or contracted.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef int32_t U_CALLCONV
-UTextReplace(UText *ut,
-             int64_t nativeStart, int64_t nativeLimit,
-             const UChar *replacementText, int32_t replacmentLength,
-             UErrorCode *status);
-
-/**
- * Function type declaration for UText.copy().
- *
- * Copy or move a substring from one position to another within the text,
- * while retaining any metadata associated with the text.
- * This function is used to duplicate or reorder substrings.
- * The destination index must not overlap the source range.
- *
- * The text to be copied or moved is inserted at destIndex;
- * it does not replace or overwrite any existing text.
- *
- * This function need only be implemented for UText types that support writing.
- *
- * When using this function, there should be only a single UText opened onto the
- * underlying native text string.  The function is responsible for updating the
- * text chunk within the UText to reflect the updated iteration position,
- * taking into account any changes to the underlying string's structure caused
- * by the replace operation.
- *
- * @param ut           The UText representing the text to be operated on.
- * @param nativeStart  The index of the start of the region to be copied or moved
- * @param nativeLimit  The index of the character following the region to be replaced.
- * @param nativeDest   The destination index to which the source substring is copied or moved.
- * @param move         If true, then the substring is moved, not copied/duplicated.
- * @param status       receives any error status.  Possible errors include U_NO_WRITE_PERMISSION
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef void U_CALLCONV
-UTextCopy(UText *ut,
-          int64_t nativeStart, int64_t nativeLimit,
-          int64_t nativeDest,
-          UBool move,
-          UErrorCode *status);
-
-/**
- * Function type declaration for UText.mapOffsetToNative().
- * Map from the current UChar offset within the current text chunk to
- *  the corresponding native index in the original source text.
- *
- * This is required only for text providers that do not use native UTF-16 indexes.
- *
- * @param ut     the UText.
- * @return Absolute (native) index corresponding to chunkOffset in the current chunk.
- *         The returned native index should always be to a code point boundary.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef int64_t U_CALLCONV
-UTextMapOffsetToNative(const UText *ut);
-
-/**
- * Function type declaration for UText.mapIndexToUTF16().
- * Map from a native index to a UChar offset within a text chunk.
- * Behavior is undefined if the native index does not fall within the
- *   current chunk.
- *
- * This function is required only for text providers that do not use native UTF-16 indexes.
- *
- * @param ut          The UText containing the text chunk.
- * @param nativeIndex Absolute (native) text index, chunk->start<=index<=chunk->limit.
- * @return            Chunk-relative UTF-16 offset corresponding to the specified native
- *                    index.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef int32_t U_CALLCONV
-UTextMapNativeIndexToUTF16(const UText *ut, int64_t nativeIndex);
-
-
-/**
- * Function type declaration for UText.utextClose().
- *
- * A Text Provider close function is only required for provider types that make
- *  allocations in their open function (or other functions) that must be 
- *  cleaned when the UText is closed.
- *
- * The allocation of the UText struct itself and any "extra" storage
- * associated with the UText is handled by the common UText implementation
- * and does not require provider specific cleanup in a close function.
- *
- * Most UText provider implementations do not need to implement this function.
- *
- * @param ut A UText object to be closed.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.4
- */
-typedef void U_CALLCONV
-UTextClose(UText *ut);
-
-
-/**
-  *   (public)  Function dispatch table for UText.
-  *             Conceptually very much like a C++ Virtual Function Table.
-  *             This struct defines the organization of the table.
-  *             Each text provider implementation must provide an
-  *              actual table that is initialized with the appropriate functions
-  *              for the type of text being handled.
-  *   \xrefitem stable "Stable" "Stable List" ICU 3.6
-  */
-struct UTextFuncs {
-    /**
-     *   (public)  Function table size, sizeof(UTextFuncs)
-     *             Intended for use should the table grow to accommodate added
-     *             functions in the future, to allow tests for older format
-     *             function tables that do not contain the extensions.
-     *
-     *             Fields are placed for optimal alignment on
-     *             32/64/128-bit-pointer machines, by normally grouping together
-     *             4 32-bit fields,
-     *             4 pointers,
-     *             2 64-bit fields
-     *             in sequence.
-     *   \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    int32_t       tableSize;
-
-    /**
-      *   (private)  Alignment padding.
-      *              Do not use, reserved for use by the UText framework only.
-      *   \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-      */
-    int32_t       reserved1, /** \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. */ reserved2, /** \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. */ reserved3;
-
-
-    /**
-     * (public) Function pointer for UTextClone
-     *
-     * @see UTextClone
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextClone *clone;
-
-    /**
-     * (public) function pointer for UTextLength
-     * May be expensive to compute!
-     *
-     * @see UTextLength
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextNativeLength *nativeLength;
-
-    /**
-     * (public) Function pointer for UTextAccess.
-     *
-     * @see UTextAccess
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextAccess *access;
-
-    /**
-     * (public) Function pointer for UTextExtract.
-     *
-     * @see UTextExtract
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextExtract *extract;
-
-    /**
-     * (public) Function pointer for UTextReplace.
-     *
-     * @see UTextReplace
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextReplace *replace;
-
-    /**
-     * (public) Function pointer for UTextCopy.
-     *
-     * @see UTextCopy
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextCopy *copy;
-
-    /**
-     * (public) Function pointer for UTextMapOffsetToNative.
-     *
-     * @see UTextMapOffsetToNative
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextMapOffsetToNative *mapOffsetToNative;
-
-    /**
-     * (public) Function pointer for UTextMapNativeIndexToUTF16.
-     *
-     * @see UTextMapNativeIndexToUTF16
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    UTextMapNativeIndexToUTF16 *mapNativeIndexToUTF16;
-
-    /**
-     * (public) Function pointer for UTextClose.
-      *
-      * @see UTextClose
-      * \xrefitem stable "Stable" "Stable List" ICU 3.6
-      */
-    UTextClose  *close;
-
-    /**
-      * (private)  Spare function pointer
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-      */
-    UTextClose  *spare1;
-    
-    /**
-      * (private)  Spare function pointer
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-      */
-    UTextClose  *spare2;
-
-    /**
-      * (private)  Spare function pointer
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-      */
-    UTextClose  *spare3;
-
-};
-/**
- * Function dispatch table for UText
- * @see UTextFuncs
- */
-typedef struct UTextFuncs UTextFuncs;
-
- /**
-  *   UText struct.  Provides the interface between the generic UText access code
-  *                  and the UText provider code that works on specific kinds of
-  *                  text  (UTF-8, noncontiguous UTF-16, whatever.)
-  *
-  *                  Applications that are using predefined types of text providers
-  *                  to pass text data to ICU services will have no need to view the
-  *                  internals of the UText structs that they open.
-  *
-  * \xrefitem stable "Stable" "Stable List" ICU 3.6
-  */
-struct UText {
-    /**
-     *     (private)  Magic.  Used to help detect when UText functions are handed
-     *                        invalid or uninitialized UText structs.
-     *                        utext_openXYZ() functions take an initialized,
-     *                        but not necessarily open, UText struct as an
-     *                        optional fill-in parameter.  This magic field
-     *                        is used to check for that initialization.
-     *                        Text provider close functions must NOT clear
-     *                        the magic field because that would prevent
-     *                        reuse of the UText struct.
-     * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-     */
-    uint32_t       magic;
-
-
-    /**
-     *     (private)  Flags for managing the allocation and freeing of
-     *                memory associated with this UText.
-     * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-     */
-    int32_t        flags;
-
-
-    /**
-      *  Text provider properties.  This set of flags is maintained by the
-      *                             text provider implementation.
-      *  \xrefitem stable "Stable" "Stable List" ICU 3.4
-      */
-    int32_t         providerProperties;
-
-    /**
-     * (public) sizeOfStruct=sizeof(UText)
-     * Allows possible backward compatible extension.
-     *
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    int32_t         sizeOfStruct;
-    
-    /* ------ 16 byte alignment boundary -----------  */
-    
-
-    /**
-      *  (protected) Native index of the first character position following
-      *              the current chunk.
-      *  \xrefitem stable "Stable" "Stable List" ICU 3.6
-      */
-    int64_t         chunkNativeLimit;
-
-    /**
-     *   (protected)  Size in bytes of the extra space (pExtra).
-     *  \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    int32_t        extraSize;
-
-    /**
-      *    (protected) The highest chunk offset where native indexing and
-      *    chunk (UTF-16) indexing correspond.  For UTF-16 sources, value
-      *    will be equal to chunkLength.
-      *
-      *    \xrefitem stable "Stable" "Stable List" ICU 3.6
-      */
-    int32_t         nativeIndexingLimit;
-
-    /* ---- 16 byte alignment boundary------ */
-    
-    /**
-     *  (protected) Native index of the first character in the text chunk.
-     *  \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    int64_t         chunkNativeStart;
-
-    /**
-     *  (protected) Current iteration position within the text chunk (UTF-16 buffer).
-     *  This is the index to the character that will be returned by utext_next32().
-     *  \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    int32_t         chunkOffset;
-
-    /**
-     *  (protected) Length the text chunk (UTF-16 buffer), in UChars.
-     *  \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    int32_t         chunkLength;
-
-    /* ---- 16  byte alignment boundary-- */
-    
-
-    /**
-     *  (protected)  pointer to a chunk of text in UTF-16 format.
-     *  May refer either to original storage of the source of the text, or
-     *  if conversion was required, to a buffer owned by the UText.
-     *  \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    const UChar    *chunkContents;
-
-     /**
-      * (public)     Pointer to Dispatch table for accessing functions for this UText.
-      * \xrefitem stable "Stable" "Stable List" ICU 3.6
-      */
-    const UTextFuncs     *pFuncs;
-
-    /**
-     *  (protected)  Pointer to additional space requested by the
-     *               text provider during the utext_open operation.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    void          *pExtra;
-
-    /**
-     * (protected) Pointer to string or text-containing object or similar.
-     * This is the source of the text that this UText is wrapping, in a format
-     *  that is known to the text provider functions.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.4
-     */
-    const void   *context;
-
-    /* --- 16 byte alignment boundary--- */
-
-    /**
-     * (protected) Pointer fields available for use by the text provider.
-     * Not used by UText common code.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    const void     *p; 
-    /**
-     * (protected) Pointer fields available for use by the text provider.
-     * Not used by UText common code.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-     */
-    const void     *q;
-     /**
-     * (protected) Pointer fields available for use by the text provider.
-     * Not used by UText common code.
-     * \xrefitem stable "Stable" "Stable List" ICU 3.6
-      */
-    const void     *r;
-
-    /**
-      *  Private field reserved for future use by the UText framework
-      *     itself.  This is not to be touched by the text providers.
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. ICU 3.4
-      */
-    void           *privP;
-
-
-    /* --- 16 byte alignment boundary--- */
-    
-
-    /**
-      * (protected) Integer field reserved for use by the text provider.
-      * Not used by the UText framework, or by the client (user) of the UText.
-      * \xrefitem stable "Stable" "Stable List" ICU 3.4
-      */
-    int64_t         a;
-
-    /**
-      * (protected) Integer field reserved for use by the text provider.
-      * Not used by the UText framework, or by the client (user) of the UText.
-      * \xrefitem stable "Stable" "Stable List" ICU 3.4
-      */
-    int32_t         b;
-
-    /**
-      * (protected) Integer field reserved for use by the text provider.
-      * Not used by the UText framework, or by the client (user) of the UText.
-      * \xrefitem stable "Stable" "Stable List" ICU 3.4
-      */
-    int32_t         c;
-
-    /*  ---- 16 byte alignment boundary---- */
-
-
-    /**
-      *  Private field reserved for future use by the UText framework
-      *     itself.  This is not to be touched by the text providers.
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. ICU 3.4
-      */
-    int64_t         privA;
-    /**
-      *  Private field reserved for future use by the UText framework
-      *     itself.  This is not to be touched by the text providers.
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. ICU 3.4
-      */
-    int32_t         privB;
-    /**
-      *  Private field reserved for future use by the UText framework
-      *     itself.  This is not to be touched by the text providers.
-      * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only. ICU 3.4
-      */
-    int32_t         privC;
-};
-
-
-
-
-// do not use #ifndef U_HIDE_INTERNAL_API around the following!
-/**
-  * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
-  *  Value used to help identify correctly initialized UText structs.
-  *  Note:  must be publicly visible so that UTEXT_INITIALIZER can access it.
-  */
-enum {
-    UTEXT_MAGIC = 0x345ad82c
-};
-
-/**
- * initializer to be used with local (stack) instances of a UText
- *  struct.  UText structs must be initialized before passing
- *  them to one of the utext_open functions.
- *
- * \xrefitem stable "Stable" "Stable List" ICU 3.6
- */
-#define UTEXT_INITIALIZER {                                        \
-                  UTEXT_MAGIC,          /* magic                */ \
-                  0,                    /* flags                */ \
-                  0,                    /* providerProps        */ \
-                  sizeof(UText),        /* sizeOfStruct         */ \
-                  0,                    /* chunkNativeLimit     */ \
-                  0,                    /* extraSize            */ \
-                  0,                    /* nativeIndexingLimit  */ \
-                  0,                    /* chunkNativeStart     */ \
-                  0,                    /* chunkOffset          */ \
-                  0,                    /* chunkLength          */ \
-                  NULL,                 /* chunkContents        */ \
-                  NULL,                 /* pFuncs               */ \
-                  NULL,                 /* pExtra               */ \
-                  NULL,                 /* context              */ \
-                  NULL, NULL, NULL,     /* p, q, r              */ \
-                  NULL,                 /* privP                */ \
-                  0, 0, 0,              /* a, b, c              */ \
-                  0, 0, 0               /* privA,B,C,           */ \
-                  }
 
 
 U_CDECL_END