Open Chinese Convert  0.4.3
A project for conversion between Traditional and Simplified Chinese
 All Data Structures Files Functions Variables Groups Pages
Macros | Functions
opencc.h File Reference

OpenCC API. More...

#include "opencc_types.h"

Go to the source code of this file.

Macros

#define OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD   "zhs2zht.ini"
 Filename of default Simplified to Traditional configuration.
 
#define OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP   "zht2zhs.ini"
 Filename of default Traditional to Simplified configuration.
 

Functions

opencc_t opencc_open (const char *config_file)
 Makes an instance of opencc. More...
 
int opencc_close (opencc_t od)
 Destroys an instance of opencc. More...
 
size_t opencc_convert (opencc_t od, ucs4_t **inbuf, size_t *inbufleft, ucs4_t **outbuf, size_t *outbufleft)
 Converts a UCS-4 string from *inbuf to *outbuf. More...
 
char * opencc_convert_utf8 (opencc_t od, const char *inbuf, size_t length)
 Converts UTF-8 string from inbuf. More...
 
void opencc_convert_utf8_free (char *buf)
 Releases allocated buffer by opencc_convert_utf8. More...
 
int opencc_dict_load (opencc_t od, const char *dict_filename, opencc_dictionary_type dict_type)
 Loads a dictionary to default dictionary chain. More...
 
void opencc_set_conversion_mode (opencc_t od, opencc_conversion_mode conversion_mode)
 Changes the mode of conversion. More...
 
opencc_error opencc_errno (void)
 Returns an opencc_convert_errno_t which describes the last error. More...
 
void opencc_perror (const char *spec)
 Prints the error message to stderr. More...
 

Detailed Description

OpenCC API.

Open Chinese Convert

Copyright 2010-2013 BYVoid byvoi.nosp@m.d@by.nosp@m.void..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file opencc.h.

Function Documentation

int opencc_close ( opencc_t  od)

Destroys an instance of opencc.

Parameters
odThe description pointer.
Returns
0 on success or non-zero number on failure.

Definition at line 168 of file opencc.c.

opencc_error opencc_errno ( void  )

Returns an opencc_convert_errno_t which describes the last error.

Returns
The error type.

Definition at line 213 of file opencc.c.