php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
grapheme_util.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | This source file is subject to version 3.01 of the PHP license, |
4 | that is bundled with this package in the file LICENSE, and is |
5 | available through the world-wide-web at the following url: |
6 | https://www.php.net/license/3_01.txt |
7 | If you did not receive a copy of the PHP license and are unable to |
8 | obtain it through the world-wide-web, please send a note to |
9 | license@php.net so we can mail you a copy immediately. |
10 +----------------------------------------------------------------------+
11 | Authors: Ed Batutis <ed@batutis.com> |
12 +----------------------------------------------------------------------+
13 */
14
15#ifndef GRAPHEME_GRAPHEME_UTIL_H
16#define GRAPHEME_GRAPHEME_UTIL_H
17
18#include "php_intl.h"
19#include "intl_convert.h"
20
21/* get_break_interator: get a break iterator from the global structure */
22UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
23
24zend_long grapheme_ascii_check(const unsigned char *day, size_t len);
25void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len);
26zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset);
27
28int32_t grapheme_strrpos_utf16(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset, int f_ignore_case);
29int32_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);
30
31int32_t grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len );
32
33int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len);
34
35int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset);
36
37UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
38
39/* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */
40#define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset > (zend_long) max_len) )
41
42#endif // GRAPHEME_GRAPHEME_UTIL_H
size_t len
Definition apprentice.c:174
DNS_STATUS status
Definition dns_win32.c:49
zend_long offset
zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset)
int32_t grapheme_get_haystack_offset(UBreakIterator *bi, int32_t offset)
int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len)
void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len)
int32_t grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len)
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)
UBreakIterator * grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status)
zend_long grapheme_ascii_check(const unsigned char *day, size_t len)
int32_t grapheme_strrpos_utf16(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset, int f_ignore_case)
unsigned const char * text
Definition php_ffi.h:53
int32_t zend_long
Definition zend_long.h:42
int last