DomainPlug-insDocumentation
translit.h
Go to the documentation of this file.
00001 #ifndef _MB_UTF_TRANSLITERATE_
00002 #define _MB_UTF_TRANSLITERATE_
00003 
00004 /*
00005  * bool
00006  * Boolean value, either true or false.
00007  *
00008  * for C++ compilers, we assume the compiler has a compatible
00009  * built-in definition of bool or not defined (gcc).
00010  */
00011 
00012 #include <pluginconfig.h>
00013 
00014 #ifndef __cplusplus /* not C++ */
00015 
00016 #ifndef bool
00017 typedef char bool;
00018 #endif
00019 
00020 #ifndef true
00021 #define true ((bool) 1)
00022 #endif
00023 
00024 #ifndef false
00025 #define false ((bool) 0)
00026 #endif
00027 
00028 #endif /* not C++ */
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 
00035 /* UTF8 helpers */
00036 PLUGINTOOLKIT_DECL bool verify_mbstr_len(const unsigned char *mbstr, int len);
00037 PLUGINTOOLKIT_DECL void report_invalid_encoding(const unsigned char *mbstr, int len);
00038 PLUGINTOOLKIT_DECL int utf_mblen(const unsigned char *s);
00039 PLUGINTOOLKIT_DECL bool utf8_islegal(const unsigned char *source, int length);
00040 PLUGINTOOLKIT_DECL int utf8_verifier(const unsigned char *s, int len);
00041 PLUGINTOOLKIT_DECL int fix_broken_string(const unsigned char *from, unsigned char *to, int len);
00042 
00043 /*
00044  * UTF8 single character tranliterators
00045  * Note: 3,4 characters tranliterators should be implemented
00046 */
00047 PLUGINTOOLKIT_DECL char* translit_mbchar_2(const unsigned char *mbstr);
00048 
00049 PLUGINTOOLKIT_DECL int translit_string(const unsigned char *mbstr, char *to, int len, int allocspace);
00050 
00051 /*
00052  * Highest level of transliteration
00053  * Note: returned data should be freed by caller
00054 */
00055 PLUGINTOOLKIT_DECL char * get_string_translit(const unsigned char *mbstr );
00056 
00057 #ifdef __cplusplus
00058 }
00059 #endif
00060 
00061 
00062 #endif
00063 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines