]>
git.saurik.com Git - apple/icu.git/blob - icuSources/io/ucln_io.c
2 ******************************************************************************
4 * Copyright (C) 2001-2009, International Business Machines *
5 * Corporation and others. All Rights Reserved. *
7 ******************************************************************************
10 * tab size: 8 (not used)
13 * created on: 2006August11
14 * created by: George Rhoten
23 #define UCLN_TYPE UCLN_IO
26 /* Leave this copyright notice here! It needs to go somewhere in this library. */
27 static const char copyright
[] = U_COPYRIGHT_STRING
;
29 static cleanupFunc
*gCleanupFunctions
[UCLN_IO_COUNT
];
31 static UBool
io_cleanup(void)
33 ECleanupIOType libType
= UCLN_IO_START
;
35 while (++libType
<UCLN_IO_COUNT
) {
36 if (gCleanupFunctions
[libType
])
38 gCleanupFunctions
[libType
]();
39 gCleanupFunctions
[libType
] = NULL
;
42 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
43 ucln_unRegisterAutomaticCleanup();
48 void ucln_io_registerCleanup(ECleanupIOType type
,
51 U_ASSERT(UCLN_IO_START
< type
&& type
< UCLN_IO_COUNT
);
52 ucln_registerCleanup(UCLN_IO
, io_cleanup
);
53 if (UCLN_IO_START
< type
&& type
< UCLN_IO_COUNT
)
55 gCleanupFunctions
[type
] = func
;
58 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
59 ucln_registerAutomaticCleanup();