2 *******************************************************************************
4 * Copyright (C) 2003-2005, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: ucnv_set.c
10 * tab size: 8 (not used)
13 * created on: 2004sep07
14 * created by: Markus W. Scherer
16 * Conversion API functions using USet (ucnv_getUnicodeSet())
17 * moved here from ucnv.c for removing the dependency of other ucnv_
18 * implementation functions on the USet implementation.
21 #include "unicode/utypes.h"
22 #include "unicode/uset.h"
23 #include "unicode/ucnv.h"
27 #if !UCONFIG_NO_CONVERSION
30 ucnv_getUnicodeSet(const UConverter
*cnv
,
32 UConverterUnicodeSet whichSet
,
33 UErrorCode
*pErrorCode
) {
34 /* argument checking */
35 if(pErrorCode
==NULL
|| U_FAILURE(*pErrorCode
)) {
38 if(cnv
==NULL
|| setFillIn
==NULL
|| whichSet
<UCNV_ROUNDTRIP_SET
|| UCNV_SET_COUNT
<=whichSet
) {
39 *pErrorCode
=U_ILLEGAL_ARGUMENT_ERROR
;
43 /* does this converter support this function? */
44 if(cnv
->sharedData
->impl
->getUnicodeSet
==NULL
) {
45 *pErrorCode
=U_UNSUPPORTED_ERROR
;
60 uset_clear(setFillIn
);
62 /* call the converter to add the code points it supports */
63 cnv
->sharedData
->impl
->getUnicodeSet(cnv
, &sa
, whichSet
, pErrorCode
);