libunibreak 6.1

Loading...
Searching...
No Matches
Functions
unibreakdef.c File Reference

Definition of utility functions used by the libunibreak library. More...

`#include <assert.h>`
`#include <stddef.h>`
`#include "unibreakdef.h"`
Include dependency graph for unibreakdef.c:

## 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

Definition of utility functions used by the libunibreak library.

Author
  Wu Yongwei

## Function Documentation

## ◆ ub_bsearch()

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

## ◆ 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] | s | input UTF-16 string
  [in] | len | length of the string in words
  [in,out] | ip | pointer 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] | s | input UTF-32 string
  [in] | len | length of the string in dwords
  [in,out] | ip | pointer 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] | s | input UTF-8 string
  [in] | len | length of the string in bytes
  [in,out] | ip | pointer to the index

Returns
  the Unicode character beginning at the index; or EOS if end of input is encountered