libdom
Loading...
Searching...
No Matches
character_valid.h File Reference
#include <stdbool.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  xml_char_range
 
struct  xml_char_group
 

Macros

#define is_base_char(ch)
 
#define is_char(ch)
 
#define is_combining_char(ch)
 
#define is_digit(ch)
 
#define is_extender(ch)
 
#define is_ideographic(ch)
 
#define is_letter(ch)
 

Functions

bool _dom_is_character_in_group (unsigned int ch, const struct xml_char_group *group)
 

Variables

const struct xml_char_group base_char_group
 
const struct xml_char_group char_group
 
const struct xml_char_group combining_char_group
 
const struct xml_char_group digit_char_group
 
const struct xml_char_group extender_group
 
const struct xml_char_group ideographic_group
 

Macro Definition Documentation

◆ is_base_char

#define is_base_char ( ch)
Value:
bool _dom_is_character_in_group(unsigned int ch, const struct xml_char_group *group)
Definition character_valid.c:174
const struct xml_char_group base_char_group
Definition character_valid.c:66

◆ is_char

#define is_char ( ch)
Value:
const struct xml_char_group char_group
Definition character_valid.c:74

◆ is_combining_char

#define is_combining_char ( ch)
Value:
const struct xml_char_group combining_char_group
Definition character_valid.c:104

◆ is_digit

#define is_digit ( ch)
Value:
const struct xml_char_group digit_char_group
Definition character_valid.c:115

◆ is_extender

#define is_extender ( ch)
Value:
const struct xml_char_group extender_group
Definition character_valid.c:125

◆ is_ideographic

#define is_ideographic ( ch)
Value:
const struct xml_char_group ideographic_group
Definition character_valid.c:133

◆ is_letter

#define is_letter ( ch)
Value:
#define is_ideographic(ch)
Definition character_valid.h:49
#define is_base_char(ch)
Definition character_valid.h:43

Function Documentation

◆ _dom_is_character_in_group()

bool _dom_is_character_in_group ( unsigned int ch,
const struct xml_char_group * group )

Test whether certain character beint32_ts to some XML character group

Parameters
chThe character being tested
groupThe character group
Returns
true if the character beint32_ts to the group, false otherwise.

Generally, we use an algorithm like binary search to find the desired character in the group. The time complexity is about lg(n) and here n is at most 180, so, I think the algorithm is fast enough for name validation.

Variable Documentation

◆ base_char_group

const struct xml_char_group base_char_group
extern

◆ char_group

const struct xml_char_group char_group
extern

◆ combining_char_group

const struct xml_char_group combining_char_group
extern

◆ digit_char_group

const struct xml_char_group digit_char_group
extern

◆ extender_group

const struct xml_char_group extender_group
extern

◆ ideographic_group

const struct xml_char_group ideographic_group
extern