libunibreak 6.1
Loading...
Searching...
No Matches
unibreakdef.h File Reference

Header file for private definitions in the libunibreak library. More...

#include <stdbool.h>
#include <stddef.h>
#include "unibreakbase.h"
Include dependency graph for unibreakdef.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARRAY_LEN(x)
 
#define EOS   0xFFFFFFFF
 Constant value to mark the end of string.
 

Typedefs

typedef utf32_t(* get_next_char_t) (const void *, size_t, size_t *)
 Abstract function interface for ub_get_next_char_utf8, ub_get_next_char_utf16, and ub_get_next_char_utf32.
 

Functions

utf32_t ub_get_next_char_utf8 (const utf8_t *s, size_t len, size_t *ip)
 Gets the next Unicode character in a UTF-8 sequence.
 
utf32_t ub_get_next_char_utf16 (const utf16_t *s, size_t len, size_t *ip)
 Gets the next Unicode character in a UTF-16 sequence.
 
utf32_t ub_get_next_char_utf32 (const utf32_t *s, size_t len, size_t *ip)
 Gets the next Unicode character in a UTF-32 sequence.
 
__inline const void * ub_bsearch (utf32_t ch, const void *ptr, size_t count, size_t size)
 

Detailed Description

Header file for private definitions in the libunibreak library.

Author
Wu Yongwei

Macro Definition Documentation

◆ ARRAY_LEN

#define ARRAY_LEN ( x)
Value:
(sizeof(x) / sizeof(x[0]))

◆ EOS

#define EOS   0xFFFFFFFF

Constant value to mark the end of string.

It is not a valid Unicode character.

Typedef Documentation

◆ get_next_char_t

typedef utf32_t(* get_next_char_t) (const void *, size_t, size_t *)

Function Documentation

◆ ub_bsearch()

__inline const void * ub_bsearch ( utf32_t ch,
const void * ptr,
size_t count,
size_t size )

◆ ub_get_next_char_utf16()

utf32_t ub_get_next_char_utf16 ( const utf16_t * s,
size_t len,
size_t * ip )

Gets the next Unicode character in a UTF-16 sequence.

The index will be advanced to the next complete character, unless the end of string is reached in the middle of a UTF-16 surrogate pair.

Parameters
[in]sinput UTF-16 string
[in]lenlength of the string in words
[in,out]ippointer to the index
Returns
the Unicode character beginning at the index; or EOS if end of input is encountered

◆ ub_get_next_char_utf32()

utf32_t ub_get_next_char_utf32 ( const utf32_t * s,
size_t len,
size_t * ip )

Gets the next Unicode character in a UTF-32 sequence.

The index will be advanced to the next character.

Parameters
[in]sinput UTF-32 string
[in]lenlength of the string in dwords
[in,out]ippointer to the index
Returns
the Unicode character beginning at the index; or EOS if end of input is encountered

◆ ub_get_next_char_utf8()

utf32_t ub_get_next_char_utf8 ( const utf8_t * s,
size_t len,
size_t * ip )

Gets the next Unicode character in a UTF-8 sequence.

The index will be advanced to the next complete character, unless the end of string is reached in the middle of a UTF-8 sequence.

Parameters
[in]sinput UTF-8 string
[in]lenlength of the string in bytes
[in,out]ippointer to the index
Returns
the Unicode character beginning at the index; or EOS if end of input is encountered