Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * |
michael@0 | 4 | * Copyright (C) 2002-2006, International Business Machines |
michael@0 | 5 | * Corporation and others. All Rights Reserved. |
michael@0 | 6 | * |
michael@0 | 7 | ******************************************************************************* |
michael@0 | 8 | * file name: uenumimp.h |
michael@0 | 9 | * encoding: US-ASCII |
michael@0 | 10 | * tab size: 8 (not used) |
michael@0 | 11 | * indentation:2 |
michael@0 | 12 | * |
michael@0 | 13 | * created on: 2002jul08 |
michael@0 | 14 | * created by: Vladimir Weinstein |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | #ifndef __UENUMIMP_H |
michael@0 | 18 | #define __UENUMIMP_H |
michael@0 | 19 | |
michael@0 | 20 | #include "unicode/uenum.h" |
michael@0 | 21 | |
michael@0 | 22 | U_CDECL_BEGIN |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * following are the type declarations for |
michael@0 | 26 | * implementations of APIs. If any of these |
michael@0 | 27 | * functions are NULL, U_UNSUPPORTED_ERROR |
michael@0 | 28 | * is returned. If close is NULL, the enumeration |
michael@0 | 29 | * object is going to be released. |
michael@0 | 30 | * Initial error checking is done in the body |
michael@0 | 31 | * of API function, so the implementations |
michael@0 | 32 | * need not to check the initial error condition. |
michael@0 | 33 | */ |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | * Function type declaration for uenum_close(). |
michael@0 | 37 | * |
michael@0 | 38 | * This function should cleanup the enumerator object |
michael@0 | 39 | * |
michael@0 | 40 | * @param en enumeration to be closed |
michael@0 | 41 | */ |
michael@0 | 42 | typedef void U_CALLCONV |
michael@0 | 43 | UEnumClose(UEnumeration *en); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Function type declaration for uenum_count(). |
michael@0 | 47 | * |
michael@0 | 48 | * This function should count the number of elements |
michael@0 | 49 | * in this enumeration |
michael@0 | 50 | * |
michael@0 | 51 | * @param en enumeration to be counted |
michael@0 | 52 | * @param status pointer to UErrorCode variable |
michael@0 | 53 | * @return number of elements in enumeration |
michael@0 | 54 | */ |
michael@0 | 55 | typedef int32_t U_CALLCONV |
michael@0 | 56 | UEnumCount(UEnumeration *en, UErrorCode *status); |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * Function type declaration for uenum_unext(). |
michael@0 | 60 | * |
michael@0 | 61 | * This function returns the next element as a UChar *, |
michael@0 | 62 | * or NULL after all elements haven been enumerated. |
michael@0 | 63 | * |
michael@0 | 64 | * @param en enumeration |
michael@0 | 65 | * @param resultLength pointer to result length |
michael@0 | 66 | * @param status pointer to UErrorCode variable |
michael@0 | 67 | * @return next element as UChar *, |
michael@0 | 68 | * or NULL after all elements haven been enumerated |
michael@0 | 69 | */ |
michael@0 | 70 | typedef const UChar* U_CALLCONV |
michael@0 | 71 | UEnumUNext(UEnumeration* en, |
michael@0 | 72 | int32_t* resultLength, |
michael@0 | 73 | UErrorCode* status); |
michael@0 | 74 | |
michael@0 | 75 | /** |
michael@0 | 76 | * Function type declaration for uenum_next(). |
michael@0 | 77 | * |
michael@0 | 78 | * This function returns the next element as a char *, |
michael@0 | 79 | * or NULL after all elements haven been enumerated. |
michael@0 | 80 | * |
michael@0 | 81 | * @param en enumeration |
michael@0 | 82 | * @param resultLength pointer to result length |
michael@0 | 83 | * @param status pointer to UErrorCode variable |
michael@0 | 84 | * @return next element as char *, |
michael@0 | 85 | * or NULL after all elements haven been enumerated |
michael@0 | 86 | */ |
michael@0 | 87 | typedef const char* U_CALLCONV |
michael@0 | 88 | UEnumNext(UEnumeration* en, |
michael@0 | 89 | int32_t* resultLength, |
michael@0 | 90 | UErrorCode* status); |
michael@0 | 91 | |
michael@0 | 92 | /** |
michael@0 | 93 | * Function type declaration for uenum_reset(). |
michael@0 | 94 | * |
michael@0 | 95 | * This function should reset the enumeration |
michael@0 | 96 | * object |
michael@0 | 97 | * |
michael@0 | 98 | * @param en enumeration |
michael@0 | 99 | * @param status pointer to UErrorCode variable |
michael@0 | 100 | */ |
michael@0 | 101 | typedef void U_CALLCONV |
michael@0 | 102 | UEnumReset(UEnumeration* en, |
michael@0 | 103 | UErrorCode* status); |
michael@0 | 104 | |
michael@0 | 105 | |
michael@0 | 106 | struct UEnumeration { |
michael@0 | 107 | /* baseContext. For the base class only. Don't touch! */ |
michael@0 | 108 | void *baseContext; |
michael@0 | 109 | |
michael@0 | 110 | /* context. Use it for what you need */ |
michael@0 | 111 | void *context; |
michael@0 | 112 | |
michael@0 | 113 | /** |
michael@0 | 114 | * these are functions that will |
michael@0 | 115 | * be used for APIs |
michael@0 | 116 | */ |
michael@0 | 117 | /* called from uenum_close */ |
michael@0 | 118 | UEnumClose *close; |
michael@0 | 119 | /* called from uenum_count */ |
michael@0 | 120 | UEnumCount *count; |
michael@0 | 121 | /* called from uenum_unext */ |
michael@0 | 122 | UEnumUNext *uNext; |
michael@0 | 123 | /* called from uenum_next */ |
michael@0 | 124 | UEnumNext *next; |
michael@0 | 125 | /* called from uenum_reset */ |
michael@0 | 126 | UEnumReset *reset; |
michael@0 | 127 | }; |
michael@0 | 128 | |
michael@0 | 129 | U_CDECL_END |
michael@0 | 130 | |
michael@0 | 131 | /* This is the default implementation for uenum_unext(). |
michael@0 | 132 | * It automatically converts the char * string to UChar *. |
michael@0 | 133 | * Don't call this directly. This is called internally by uenum_unext |
michael@0 | 134 | * when a UEnumeration is defined with 'uNext' pointing to this |
michael@0 | 135 | * function. |
michael@0 | 136 | */ |
michael@0 | 137 | U_CAPI const UChar* U_EXPORT2 |
michael@0 | 138 | uenum_unextDefault(UEnumeration* en, |
michael@0 | 139 | int32_t* resultLength, |
michael@0 | 140 | UErrorCode* status); |
michael@0 | 141 | |
michael@0 | 142 | /* This is the default implementation for uenum_next(). |
michael@0 | 143 | * It automatically converts the UChar * string to char *. |
michael@0 | 144 | * Don't call this directly. This is called internally by uenum_next |
michael@0 | 145 | * when a UEnumeration is defined with 'next' pointing to this |
michael@0 | 146 | * function. |
michael@0 | 147 | */ |
michael@0 | 148 | U_CAPI const char* U_EXPORT2 |
michael@0 | 149 | uenum_nextDefault(UEnumeration* en, |
michael@0 | 150 | int32_t* resultLength, |
michael@0 | 151 | UErrorCode* status); |
michael@0 | 152 | |
michael@0 | 153 | #endif |