00001 /* vim: set tabstop=4 shiftwidth=4: */ 00002 00003 /* 00004 * Word breaking in a Unicode sequence. Designed to be used in a 00005 * generic text renderer. 00006 * 00007 * Copyright (C) 2012 Tom Hacohen <tom@stosb.com> 00008 * 00009 * This software is provided 'as-is', without any express or implied 00010 * warranty. In no event will the author be held liable for any damages 00011 * arising from the use of this software. 00012 * 00013 * Permission is granted to anyone to use this software for any purpose, 00014 * including commercial applications, and to alter it and redistribute 00015 * it freely, subject to the following restrictions: 00016 * 00017 * 1. The origin of this software must not be misrepresented; you must 00018 * not claim that you wrote the original software. If you use this 00019 * software in a product, an acknowledgement in the product 00020 * documentation would be appreciated but is not required. 00021 * 2. Altered source versions must be plainly marked as such, and must 00022 * not be misrepresented as being the original software. 00023 * 3. This notice may not be removed or altered from any source 00024 * distribution. 00025 * 00026 * The main reference is Unicode Standard Annex 29 (UAX #29): 00027 * <URL:http://unicode.org/reports/tr29> 00028 * 00029 * When this library was designed, this annex was at Revision 17, for 00030 * Unicode 6.0.0: 00031 * <URL:http://www.unicode.org/reports/tr29/tr29-17.html> 00032 * 00033 * The Unicode Terms of Use are available at 00034 * <URL:http://www.unicode.org/copyright.html> 00035 */ 00036 00046 #ifndef WORDBREAK_H 00047 #define WORDBREAK_H 00048 00049 #include <stddef.h> 00050 #include "linebreak.h" 00051 00052 #ifdef __cplusplus 00053 extern "C" { 00054 #endif 00055 00056 #define WORDBREAK_BREAK 0 00057 #define WORDBREAK_NOBREAK 1 00058 #define WORDBREAK_INSIDEACHAR 2 00060 void init_wordbreak(void); 00061 void set_wordbreaks_utf8( 00062 const utf8_t *s, size_t len, const char* lang, char *brks); 00063 void set_wordbreaks_utf16( 00064 const utf16_t *s, size_t len, const char* lang, char *brks); 00065 void set_wordbreaks_utf32( 00066 const utf32_t *s, size_t len, const char* lang, char *brks); 00067 00068 #ifdef __cplusplus 00069 } 00070 #endif 00071 00072 #endif