xref: /aoo4110/main/sal/textenc/convertgb18030.h (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_RTL_TEXTENC_CONVERTGB18030_H
25 #define INCLUDED_RTL_TEXTENC_CONVERTGB18030_H
26 
27 #include "tenchelp.h"
28 #include "sal/types.h"
29 
30 #if defined __cplusplus
31 extern "C" {
32 #endif /* __cpluscplus */
33 
34 typedef struct
35 {
36     sal_Int32 m_nNonRangeDataIndex;
37     sal_uInt32 m_nFirstLinear;
38     sal_uInt32 m_nPastLinear;
39     sal_Unicode m_nFirstUnicode;
40 } ImplGb180302000ToUnicodeRange;
41 
42 typedef struct
43 {
44     sal_Int32 m_nNonRangeDataIndex;
45     sal_Unicode m_nFirstUnicode;
46     sal_Unicode m_nLastUnicode;
47     sal_uInt32 m_nFirstLinear;
48 } ImplUnicodeToGb180302000Range;
49 
50 typedef struct
51 {
52     sal_Unicode const * m_pGb18030ToUnicodeData;
53     ImplGb180302000ToUnicodeRange const * m_pGb18030ToUnicodeRanges;
54     sal_uInt32 const * m_pUnicodeToGb18030Data;
55     ImplUnicodeToGb180302000Range const * m_pUnicodeToGb18030Ranges;
56 } ImplGb18030ConverterData;
57 
58 void * ImplCreateGb18030ToUnicodeContext(void) SAL_THROW_EXTERN_C();
59 
60 void ImplResetGb18030ToUnicodeContext(void * pContext) SAL_THROW_EXTERN_C();
61 
62 sal_Size ImplConvertGb18030ToUnicode(ImplTextConverterData const * pData,
63                                      void * pContext,
64                                      sal_Char const * pSrcBuf,
65                                      sal_Size nSrcBytes,
66                                      sal_Unicode * pDestBuf,
67                                      sal_Size nDestChars,
68                                      sal_uInt32 nFlags,
69                                      sal_uInt32 * pInfo,
70                                      sal_Size * pSrcCvtBytes)
71     SAL_THROW_EXTERN_C();
72 
73 sal_Size ImplConvertUnicodeToGb18030(ImplTextConverterData const * pData,
74                                      void * pContext,
75                                      sal_Unicode const * pSrcBuf,
76                                      sal_Size nSrcChars,
77                                      sal_Char * pDestBuf,
78                                      sal_Size nDestBytes,
79                                      sal_uInt32 nFlags,
80                                      sal_uInt32 * pInfo,
81                                      sal_Size * pSrcCvtChars)
82     SAL_THROW_EXTERN_C();
83 
84 #if defined __cplusplus
85 }
86 #endif /* __cpluscplus */
87 
88 #endif /* INCLUDED_RTL_TEXTENC_CONVERTGB18030_H */
89