w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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