Numworks Epsilon  1.4.1
Graphing Calculator Operating System
unicode.c File Reference
#include <stdint.h>
#include "py/unicode.h"

Go to the source code of this file.

Macros

#define FL_PRINT   (0x01)
 
#define FL_SPACE   (0x02)
 
#define FL_DIGIT   (0x04)
 
#define FL_ALPHA   (0x08)
 
#define FL_UPPER   (0x10)
 
#define FL_LOWER   (0x20)
 
#define FL_XDIGIT   (0x40)
 
#define AT_PR   (FL_PRINT)
 
#define AT_SP   (FL_SPACE | FL_PRINT)
 
#define AT_DI   (FL_DIGIT | FL_PRINT | FL_XDIGIT)
 
#define AT_AL   (FL_ALPHA | FL_PRINT)
 
#define AT_UP   (FL_UPPER | FL_ALPHA | FL_PRINT)
 
#define AT_LO   (FL_LOWER | FL_ALPHA | FL_PRINT)
 
#define AT_UX   (FL_UPPER | FL_ALPHA | FL_PRINT | FL_XDIGIT)
 
#define AT_LX   (FL_LOWER | FL_ALPHA | FL_PRINT | FL_XDIGIT)
 

Functions

unichar utf8_get_char (const byte *s)
 
const byteutf8_next_char (const byte *s)
 
mp_uint_t utf8_ptr_to_index (const byte *s, const byte *ptr)
 
mp_uint_t unichar_charlen (const char *str, mp_uint_t len)
 
bool unichar_isspace (unichar c)
 
bool unichar_isalpha (unichar c)
 
bool unichar_isdigit (unichar c)
 
bool unichar_isxdigit (unichar c)
 
bool unichar_isident (unichar c)
 
bool unichar_isupper (unichar c)
 
bool unichar_islower (unichar c)
 
unichar unichar_tolower (unichar c)
 
unichar unichar_toupper (unichar c)
 
mp_uint_t unichar_xdigit_value (unichar c)
 
bool utf8_check (const byte *p, size_t len)
 

Variables

STATIC const uint8_t attr []
 

Macro Definition Documentation

◆ AT_AL

#define AT_AL   (FL_ALPHA | FL_PRINT)

Definition at line 44 of file unicode.c.

◆ AT_DI

#define AT_DI   (FL_DIGIT | FL_PRINT | FL_XDIGIT)

Definition at line 43 of file unicode.c.

◆ AT_LO

#define AT_LO   (FL_LOWER | FL_ALPHA | FL_PRINT)

Definition at line 46 of file unicode.c.

◆ AT_LX

#define AT_LX   (FL_LOWER | FL_ALPHA | FL_PRINT | FL_XDIGIT)

Definition at line 48 of file unicode.c.

◆ AT_PR

#define AT_PR   (FL_PRINT)

Definition at line 41 of file unicode.c.

◆ AT_SP

#define AT_SP   (FL_SPACE | FL_PRINT)

Definition at line 42 of file unicode.c.

◆ AT_UP

#define AT_UP   (FL_UPPER | FL_ALPHA | FL_PRINT)

Definition at line 45 of file unicode.c.

◆ AT_UX

#define AT_UX   (FL_UPPER | FL_ALPHA | FL_PRINT | FL_XDIGIT)

Definition at line 47 of file unicode.c.

◆ FL_ALPHA

#define FL_ALPHA   (0x08)

Definition at line 35 of file unicode.c.

◆ FL_DIGIT

#define FL_DIGIT   (0x04)

Definition at line 34 of file unicode.c.

◆ FL_LOWER

#define FL_LOWER   (0x20)

Definition at line 37 of file unicode.c.

◆ FL_PRINT

#define FL_PRINT   (0x01)

Definition at line 32 of file unicode.c.

◆ FL_SPACE

#define FL_SPACE   (0x02)

Definition at line 33 of file unicode.c.

◆ FL_UPPER

#define FL_UPPER   (0x10)

Definition at line 36 of file unicode.c.

◆ FL_XDIGIT

#define FL_XDIGIT   (0x40)

Definition at line 38 of file unicode.c.

Function Documentation

◆ unichar_charlen()

mp_uint_t unichar_charlen ( const char *  str,
mp_uint_t  len 
)

Definition at line 113 of file unicode.c.

◆ unichar_isalpha()

bool unichar_isalpha ( unichar  c)

Definition at line 132 of file unicode.c.

◆ unichar_isdigit()

bool unichar_isdigit ( unichar  c)

Definition at line 142 of file unicode.c.

◆ unichar_isident()

bool unichar_isident ( unichar  c)

Definition at line 150 of file unicode.c.

◆ unichar_islower()

bool unichar_islower ( unichar  c)

Definition at line 158 of file unicode.c.

◆ unichar_isspace()

bool unichar_isspace ( unichar  c)

Definition at line 128 of file unicode.c.

◆ unichar_isupper()

bool unichar_isupper ( unichar  c)

Definition at line 154 of file unicode.c.

◆ unichar_isxdigit()

bool unichar_isxdigit ( unichar  c)

Definition at line 146 of file unicode.c.

◆ unichar_tolower()

unichar unichar_tolower ( unichar  c)

Definition at line 162 of file unicode.c.

◆ unichar_toupper()

unichar unichar_toupper ( unichar  c)

Definition at line 169 of file unicode.c.

◆ unichar_xdigit_value()

mp_uint_t unichar_xdigit_value ( unichar  c)

Definition at line 176 of file unicode.c.

◆ utf8_check()

bool utf8_check ( const byte p,
size_t  len 
)

Definition at line 186 of file unicode.c.

◆ utf8_get_char()

unichar utf8_get_char ( const byte s)

Definition at line 71 of file unicode.c.

◆ utf8_next_char()

const byte* utf8_next_char ( const byte s)

Definition at line 89 of file unicode.c.

◆ utf8_ptr_to_index()

mp_uint_t utf8_ptr_to_index ( const byte s,
const byte ptr 
)

Definition at line 101 of file unicode.c.

Variable Documentation

◆ attr

STATIC const uint8_t attr[]
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0,
0, AT_SP, AT_SP, AT_SP, AT_SP, AT_SP, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}
#define AT_DI
Definition: unicode.c:43
#define AT_SP
Definition: unicode.c:42
#define AT_UX
Definition: unicode.c:47
#define AT_LX
Definition: unicode.c:48
#define AT_UP
Definition: unicode.c:45
#define AT_LO
Definition: unicode.c:46
#define AT_PR
Definition: unicode.c:41

Definition at line 51 of file unicode.c.