naev 0.12.5
utf8.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define isutf(c)
#define UEOF   ( ( uint32_t ) - 1 )

Functions

size_t u8_toucs (uint32_t *dest, size_t sz, const char *src, size_t srcsz)
size_t u8_toutf8 (char *dest, size_t sz, const uint32_t *src, size_t srcsz)
size_t u8_wc_toutf8 (char *dest, uint32_t ch)
size_t u8_offset (const char *str, size_t charnum)
size_t u8_charnum (const char *s, size_t offset)
uint32_t u8_nextchar (const char *s, size_t *i)
uint32_t u8_nextmemchar (const char *s, size_t *i)
void u8_inc (const char *s, size_t *i)
void u8_dec (const char *s, size_t *i)
size_t u8_seqlen (const char *s)
size_t u8_charlen (uint32_t ch)
size_t u8_codingsize (uint32_t *wcstr, size_t n)
char read_escape_control_char (char c)
size_t u8_read_escape_sequence (const char *src, size_t ssz, uint32_t *dest)
size_t u8_unescape (char *buf, size_t sz, const char *src)
int octal_digit (char c)
int hex_digit (char c)
char * u8_strchr (const char *s, uint32_t ch, size_t *charn)
char * u8_memchr (const char *s, uint32_t ch, size_t sz, size_t *charn)
char * u8_memrchr (const char *s, uint32_t ch, size_t sz)
size_t u8_strlen (const char *s)
int u8_isvalid (const char *str, size_t length)
int u8_reverse (char *dest, char *src, size_t len)

Detailed Description

Utilities from cutef8: https://github.com/JeffBezanson/cutef8

Note
Its current README says, "I now use and recommend utf8proc instead of this library."
Some unused functions (and supporting polyfills, macro tweaks) have been removed. In the unlikely event more cutef8 features are required, check earlier revisions in git.

Definition in file utf8.h.

Macro Definition Documentation

◆ isutf

#define isutf ( c)
Value:
( ( ( c ) & 0xC0 ) != 0x80 )
static const double c[]
Definition rng.c:256

Definition at line 18 of file utf8.h.

◆ UEOF

#define UEOF   ( ( uint32_t ) - 1 )

Definition at line 20 of file utf8.h.

Function Documentation

◆ hex_digit()

int hex_digit ( char c)

Definition at line 292 of file utf8.c.

◆ octal_digit()

int octal_digit ( char c)

Definition at line 287 of file utf8.c.

◆ read_escape_control_char()

char read_escape_control_char ( char c)

Definition at line 299 of file utf8.c.

◆ u8_charlen()

size_t u8_charlen ( uint32_t ch)

Definition at line 55 of file utf8.c.

◆ u8_charnum()

size_t u8_charnum ( const char * s,
size_t offset )

Definition at line 214 of file utf8.c.

◆ u8_codingsize()

size_t u8_codingsize ( uint32_t * wcstr,
size_t n )

Definition at line 68 of file utf8.c.

◆ u8_dec()

void u8_dec ( const char * s,
size_t * i )

Definition at line 282 of file utf8.c.

◆ u8_inc()

void u8_inc ( const char * s,
size_t * i )

Definition at line 277 of file utf8.c.

◆ u8_isvalid()

int u8_isvalid ( const char * str,
size_t length )

Definition at line 459 of file utf8.c.

◆ u8_memchr()

char * u8_memchr ( const char * s,
uint32_t ch,
size_t sz,
size_t * charn )

Definition at line 405 of file utf8.c.

◆ u8_memrchr()

char * u8_memrchr ( const char * s,
uint32_t ch,
size_t sz )

Definition at line 430 of file utf8.c.

◆ u8_nextchar()

uint32_t u8_nextchar ( const char * s,
size_t * i )

Definition at line 246 of file utf8.c.

◆ u8_nextmemchar()

uint32_t u8_nextmemchar ( const char * s,
size_t * i )

Definition at line 262 of file utf8.c.

◆ u8_offset()

size_t u8_offset ( const char * str,
size_t charnum )

Definition at line 200 of file utf8.c.

◆ u8_read_escape_sequence()

size_t u8_read_escape_sequence ( const char * src,
size_t ssz,
uint32_t * dest )

Definition at line 322 of file utf8.c.

◆ u8_reverse()

int u8_reverse ( char * dest,
char * src,
size_t len )

Definition at line 522 of file utf8.c.

◆ u8_seqlen()

size_t u8_seqlen ( const char * s)

Definition at line 48 of file utf8.c.

◆ u8_strchr()

char * u8_strchr ( const char * s,
uint32_t ch,
size_t * charn )

Definition at line 387 of file utf8.c.

◆ u8_strlen()

size_t u8_strlen ( const char * s)

Definition at line 228 of file utf8.c.

◆ u8_toucs()

size_t u8_toucs ( uint32_t * dest,
size_t sz,
const char * src,
size_t srcsz )

Definition at line 85 of file utf8.c.

◆ u8_toutf8()

size_t u8_toutf8 ( char * dest,
size_t sz,
const uint32_t * src,
size_t srcsz )

Definition at line 132 of file utf8.c.

◆ u8_unescape()

size_t u8_unescape ( char * buf,
size_t sz,
const char * src )

Definition at line 360 of file utf8.c.

◆ u8_wc_toutf8()

size_t u8_wc_toutf8 ( char * dest,
uint32_t ch )

Definition at line 172 of file utf8.c.