1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef GRAPHEME_GRAPHEME_UTIL_H
18 #define GRAPHEME_GRAPHEME_UTIL_H
19
20 #include "php_intl.h"
21 #include "intl_convert.h"
22
23
24 UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
25
26 zend_long grapheme_ascii_check(const unsigned char *day, size_t len);
27 void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len);
28 zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset);
29
30 int32_t grapheme_strrpos_utf16(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset, int f_ignore_case);
31 int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last);
32
33 int32_t grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len );
34
35 int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len);
36
37 inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n);
38
39 int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset);
40
41 UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
42
43
44 #define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset >= (zend_long) max_len) )
45
46 #endif