xref: /aoo41x/main/sal/textenc/convertgb18030.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_RTL_TEXTENC_CONVERTGB18030_H
29 #define INCLUDED_RTL_TEXTENC_CONVERTGB18030_H
30 
31 #include "tenchelp.h"
32 #include "sal/types.h"
33 
34 #if defined __cplusplus
35 extern "C" {
36 #endif /* __cpluscplus */
37 
38 typedef struct
39 {
40     sal_Int32 m_nNonRangeDataIndex;
41     sal_uInt32 m_nFirstLinear;
42     sal_uInt32 m_nPastLinear;
43     sal_Unicode m_nFirstUnicode;
44 } ImplGb180302000ToUnicodeRange;
45 
46 typedef struct
47 {
48     sal_Int32 m_nNonRangeDataIndex;
49     sal_Unicode m_nFirstUnicode;
50     sal_Unicode m_nLastUnicode;
51     sal_uInt32 m_nFirstLinear;
52 } ImplUnicodeToGb180302000Range;
53 
54 typedef struct
55 {
56     sal_Unicode const * m_pGb18030ToUnicodeData;
57     ImplGb180302000ToUnicodeRange const * m_pGb18030ToUnicodeRanges;
58     sal_uInt32 const * m_pUnicodeToGb18030Data;
59     ImplUnicodeToGb180302000Range const * m_pUnicodeToGb18030Ranges;
60 } ImplGb18030ConverterData;
61 
62 void * ImplCreateGb18030ToUnicodeContext(void) SAL_THROW_EXTERN_C();
63 
64 void ImplResetGb18030ToUnicodeContext(void * pContext) SAL_THROW_EXTERN_C();
65 
66 sal_Size ImplConvertGb18030ToUnicode(ImplTextConverterData const * pData,
67                                      void * pContext,
68                                      sal_Char const * pSrcBuf,
69                                      sal_Size nSrcBytes,
70                                      sal_Unicode * pDestBuf,
71                                      sal_Size nDestChars,
72                                      sal_uInt32 nFlags,
73                                      sal_uInt32 * pInfo,
74                                      sal_Size * pSrcCvtBytes)
75     SAL_THROW_EXTERN_C();
76 
77 sal_Size ImplConvertUnicodeToGb18030(ImplTextConverterData const * pData,
78                                      void * pContext,
79                                      sal_Unicode const * pSrcBuf,
80                                      sal_Size nSrcChars,
81                                      sal_Char * pDestBuf,
82                                      sal_Size nDestBytes,
83                                      sal_uInt32 nFlags,
84                                      sal_uInt32 * pInfo,
85                                      sal_Size * pSrcCvtChars)
86     SAL_THROW_EXTERN_C();
87 
88 #if defined __cplusplus
89 }
90 #endif /* __cpluscplus */
91 
92 #endif /* INCLUDED_RTL_TEXTENC_CONVERTGB18030_H */
93