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