Open Chinese Convert  0.4.3
A project for conversion between Traditional and Simplified Chinese
 All Data Structures Files Functions Variables Groups Pages
opencc_types.h
1 /*
2  * Open Chinese Convert
3  *
4  * Copyright 2010-2013 BYVoid <byvoid@byvoid.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef __OPENCC_TYPES_H_
20 #define __OPENCC_TYPES_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif // ifdef __cplusplus
25 
26 #include <stddef.h>
27 #include <stdint.h>
28 
29 typedef void* opencc_t;
30 
31 typedef uint32_t ucs4_t;
32 
33 enum _opencc_error {
34  OPENCC_ERROR_VOID,
35  OPENCC_ERROR_DICTLOAD,
36  OPENCC_ERROR_CONFIG,
37  OPENCC_ERROR_ENCODING,
38  OPENCC_ERROR_ENCODIND = OPENCC_ERROR_ENCODING,
39  OPENCC_ERROR_CONVERTER
40 };
41 typedef enum _opencc_error opencc_error;
42 
43 enum _opencc_dictionary_type {
44  OPENCC_DICTIONARY_TYPE_TEXT,
45  OPENCC_DICTIONARY_TYPE_DATRIE
46 };
47 typedef enum _opencc_dictionary_type opencc_dictionary_type;
48 
49 enum _opencc_conversion_mode {
50  OPENCC_CONVERSION_FAST = 0,
51  OPENCC_CONVERSION_SEGMENT_ONLY = 1,
52  OPENCC_CONVERSION_LIST_CANDIDATES = 2
53 };
54 typedef enum _opencc_conversion_mode opencc_conversion_mode;
55 
56 #ifdef __cplusplus
57 }
58 #endif // ifdef __cplusplus
59 
60 #endif /* __OPENCC_TYPES_H_ */