00001 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 00002 00003 /* 00004 * Break processing in a Unicode sequence. Designed to be used in a 00005 * generic text renderer. 00006 * 00007 * Copyright (C) 2015 Wu Yongwei <wuyongwei at gmail dot 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 00036 #ifndef UNIBREAKDEF_H 00037 #define UNIBREAKDEF_H 00038 00039 #include <stddef.h> 00040 #include "unibreakbase.h" 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00050 #define EOS 0xFFFFFFFF 00051 00056 typedef utf32_t (*get_next_char_t)(const void *, size_t, size_t *); 00057 00058 /* Function Prototype */ 00059 utf32_t ub_get_next_char_utf8(const utf8_t *s, size_t len, size_t *ip); 00060 utf32_t ub_get_next_char_utf16(const utf16_t *s, size_t len, size_t *ip); 00061 utf32_t ub_get_next_char_utf32(const utf32_t *s, size_t len, size_t *ip); 00062 00063 #ifdef __cplusplus 00064 } 00065 #endif 00066 00067 #endif /* UNIBREAKDEF_H */