ICU 54.1  54.1
uclean.h
Go to the documentation of this file.
1 /*
2 ******************************************************************************
3 * Copyright (C) 2001-2014, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ******************************************************************************
6 * file name: uclean.h
7 * encoding: US-ASCII
8 * tab size: 8 (not used)
9 * indentation:4
10 *
11 * created on: 2001July05
12 * created by: George Rhoten
13 */
14 
15 #ifndef __UCLEAN_H__
16 #define __UCLEAN_H__
17 
18 #include "unicode/utypes.h"
50 U_STABLE void U_EXPORT2
51 u_init(UErrorCode *status);
52 
53 #ifndef U_HIDE_SYSTEM_API
54 
99 U_STABLE void U_EXPORT2
100 u_cleanup(void);
101 
102 
111 typedef void *U_CALLCONV UMemAllocFn(const void *context, size_t size);
120 typedef void *U_CALLCONV UMemReallocFn(const void *context, void *mem, size_t size);
131 typedef void U_CALLCONV UMemFreeFn (const void *context, void *mem);
132 
149 U_STABLE void U_EXPORT2
150 u_setMemoryFunctions(const void *context, UMemAllocFn *a, UMemReallocFn *r, UMemFreeFn *f,
151  UErrorCode *status);
152 
153 
154 #ifndef U_HIDE_DEPRECATED_API
155 /*********************************************************************************
156  *
157  * Deprecated Functions
158  *
159  * The following functions for user supplied mutexes are no longer supported.
160  * Any attempt to use them will return a U_UNSUPPORTED_ERROR.
161  *
162  **********************************************************************************/
163 
171 typedef void *UMTX;
172 
189 typedef void U_CALLCONV UMtxInitFn (const void *context, UMTX *mutex, UErrorCode* status);
190 
191 
201 typedef void U_CALLCONV UMtxFn (const void *context, UMTX *mutex);
202 
203 
221 U_DEPRECATED void U_EXPORT2
222 u_setMutexFunctions(const void *context, UMtxInitFn *init, UMtxFn *destroy, UMtxFn *lock, UMtxFn *unlock,
223  UErrorCode *status);
224 
225 
234 typedef int32_t U_CALLCONV UMtxAtomicFn(const void *context, int32_t *p);
235 
251 U_DEPRECATED void U_EXPORT2
252 u_setAtomicIncDecFunctions(const void *context, UMtxAtomicFn *inc, UMtxAtomicFn *dec,
253  UErrorCode *status);
254 
255 #endif /* U_HIDE_DEPRECATED_API */
256 #endif /* U_HIDE_SYSTEM_API */
257 
258 #endif
void * UMemReallocFn(const void *context, void *mem, size_t size)
Pointer type for a user supplied memory re-allocation function.
Definition: uclean.h:120
void * UMemAllocFn(const void *context, size_t size)
Pointer type for a user supplied memory allocation function.
Definition: uclean.h:111
#define U_CALLCONV
Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary in callback function typedefs to ma...
Definition: platform.h:746
void u_setAtomicIncDecFunctions(const void *context, UMtxAtomicFn *inc, UMtxAtomicFn *dec, UErrorCode *status)
Set the functions that ICU will use for atomic increment and decrement of int32_t values...
#define U_DEPRECATED
This is used to declare a function as a deprecated public ICU C API.
Definition: umachine.h:113
void u_setMutexFunctions(const void *context, UMtxInitFn *init, UMtxFn *destroy, UMtxFn *lock, UMtxFn *unlock, UErrorCode *status)
Set the functions that ICU will use for mutex operations Use of this function is optional; by default...
void u_cleanup(void)
Clean up the system resources, such as allocated memory or open files, used in all ICU libraries...
void UMtxFn(const void *context, UMTX *mutex)
Function Pointer type for a user supplied mutex functions.
Definition: uclean.h:201
int32_t UMtxAtomicFn(const void *context, int32_t *p)
Pointer type for a user supplied atomic increment or decrement function.
Definition: uclean.h:234
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
void UMemFreeFn(const void *context, void *mem)
Pointer type for a user supplied memory free function.
Definition: uclean.h:131
Basic definitions for ICU, for both C and C++ APIs.
void u_setMemoryFunctions(const void *context, UMemAllocFn *a, UMemReallocFn *r, UMemFreeFn *f, UErrorCode *status)
Set the functions that ICU will use for memory allocation.
void u_init(UErrorCode *status)
Initialize ICU.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
void * UMTX
An opaque pointer type that represents an ICU mutex.
Definition: uclean.h:171
void UMtxInitFn(const void *context, UMTX *mutex, UErrorCode *status)
Function Pointer type for a user supplied mutex initialization function.
Definition: uclean.h:189