naev 0.11.5
utf8.h File Reference
#include "nstring.h"

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:264

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 291 of file utf8.c.

◆ octal_digit()

int octal_digit ( char c)

Definition at line 286 of file utf8.c.

◆ read_escape_control_char()

char read_escape_control_char ( char c)

Definition at line 298 of file utf8.c.

◆ u8_charlen()

size_t u8_charlen ( uint32_t ch)

Definition at line 54 of file utf8.c.

◆ u8_charnum()

size_t u8_charnum ( const char * s,
size_t offset )

Definition at line 213 of file utf8.c.

◆ u8_codingsize()

size_t u8_codingsize ( uint32_t * wcstr,
size_t n )

Definition at line 67 of file utf8.c.

◆ u8_dec()

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

Definition at line 281 of file utf8.c.

◆ u8_inc()

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

Definition at line 276 of file utf8.c.

◆ u8_isvalid()

int u8_isvalid ( const char * str,
size_t length )

Definition at line 458 of file utf8.c.

◆ u8_memchr()

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

Definition at line 404 of file utf8.c.

◆ u8_memrchr()

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

Definition at line 429 of file utf8.c.

◆ u8_nextchar()

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

Definition at line 245 of file utf8.c.

◆ u8_nextmemchar()

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

Definition at line 261 of file utf8.c.

◆ u8_offset()

size_t u8_offset ( const char * str,
size_t charnum )

Definition at line 199 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 321 of file utf8.c.

◆ u8_reverse()

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

Definition at line 521 of file utf8.c.

◆ u8_seqlen()

size_t u8_seqlen ( const char * s)

Definition at line 47 of file utf8.c.

◆ u8_strchr()

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

Definition at line 386 of file utf8.c.

◆ u8_strlen()

size_t u8_strlen ( const char * s)

Definition at line 227 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 84 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 131 of file utf8.c.

◆ u8_unescape()

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

Definition at line 359 of file utf8.c.

◆ u8_wc_toutf8()

size_t u8_wc_toutf8 ( char * dest,
uint32_t ch )

Definition at line 171 of file utf8.c.