ReactOS 0.4.15-dev-7918-g2a2556c
chvalid.c File Reference
#include "libxml.h"
#include <libxml/chvalid.h>
Include dependency graph for chvalid.c:

Go to the source code of this file.

Macros

#define IN_LIBXML
 

Functions

int xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr)
 
int xmlIsBaseChar (unsigned int ch)
 
int xmlIsBlank (unsigned int ch)
 
int xmlIsChar (unsigned int ch)
 
int xmlIsCombining (unsigned int ch)
 
int xmlIsDigit (unsigned int ch)
 
int xmlIsExtender (unsigned int ch)
 
int xmlIsIdeographic (unsigned int ch)
 
int xmlIsPubidChar (unsigned int ch)
 

Variables

const unsigned char xmlIsPubidChar_tab [256]
 
static const xmlChSRange xmlIsBaseChar_srng []
 
const xmlChRangeGroup xmlIsBaseCharGroup
 
static const xmlChSRange xmlIsChar_srng []
 
static const xmlChLRange xmlIsChar_lrng [] = { {0x10000, 0x10ffff}}
 
const xmlChRangeGroup xmlIsCharGroup
 
static const xmlChSRange xmlIsCombining_srng []
 
const xmlChRangeGroup xmlIsCombiningGroup
 
static const xmlChSRange xmlIsDigit_srng []
 
const xmlChRangeGroup xmlIsDigitGroup
 
static const xmlChSRange xmlIsExtender_srng []
 
const xmlChRangeGroup xmlIsExtenderGroup
 
static const xmlChSRange xmlIsIdeographic_srng []
 
const xmlChRangeGroup xmlIsIdeographicGroup
 

Macro Definition Documentation

◆ IN_LIBXML

#define IN_LIBXML

Definition at line 13 of file chvalid.c.

Function Documentation

◆ xmlCharInRange()

int xmlCharInRange ( unsigned int  val,
const xmlChRangeGroup rptr 
)

xmlCharInRange: @val: character to be validated @rptr: pointer to range to be used to validate

Does a binary search of the range table to determine if char is valid

Returns: true if character valid, false otherwise

Definition at line 168 of file chvalid.c.

168 {
169 int low, high, mid;
170 const xmlChSRange *sptr;
171 const xmlChLRange *lptr;
172
173 if (rptr == NULL) return(0);
174 if (val < 0x10000) { /* is val in 'short' or 'long' array? */
175 if (rptr->nbShortRange == 0)
176 return 0;
177 low = 0;
178 high = rptr->nbShortRange - 1;
179 sptr = rptr->shortRange;
180 while (low <= high) {
181 mid = (low + high) / 2;
182 if ((unsigned short) val < sptr[mid].low) {
183 high = mid - 1;
184 } else {
185 if ((unsigned short) val > sptr[mid].high) {
186 low = mid + 1;
187 } else {
188 return 1;
189 }
190 }
191 }
192 } else {
193 if (rptr->nbLongRange == 0) {
194 return 0;
195 }
196 low = 0;
197 high = rptr->nbLongRange - 1;
198 lptr = rptr->longRange;
199 while (low <= high) {
200 mid = (low + high) / 2;
201 if (val < lptr[mid].low) {
202 high = mid - 1;
203 } else {
204 if (val > lptr[mid].high) {
205 low = mid + 1;
206 } else {
207 return 1;
208 }
209 }
210 }
211 }
212 return 0;
213}
#define NULL
Definition: types.h:112
GLuint GLfloat * val
Definition: glext.h:7180
const xmlChLRange * longRange
Definition: chvalid.h:48
int nbShortRange
Definition: chvalid.h:45
const xmlChSRange * shortRange
Definition: chvalid.h:47
unsigned short high
Definition: chvalid.h:32
unsigned short low
Definition: chvalid.h:31

◆ xmlIsBaseChar()

int xmlIsBaseChar ( unsigned int  ch)

xmlIsBaseChar: @ch: character to validate

This function is DEPRECATED. Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead

Returns true if argument valid, false otherwise

Definition at line 226 of file chvalid.c.

226 {
227 return(xmlIsBaseCharQ(ch));
228}
#define xmlIsBaseCharQ(c)
Definition: chvalid.h:76

◆ xmlIsBlank()

int xmlIsBlank ( unsigned int  ch)

xmlIsBlank: @ch: character to validate

This function is DEPRECATED. Use xmlIsBlank_ch or xmlIsBlankQ instead

Returns true if argument valid, false otherwise

Definition at line 241 of file chvalid.c.

241 {
242 return(xmlIsBlankQ(ch));
243}
#define xmlIsBlankQ(c)
Definition: chvalid.h:98

◆ xmlIsChar()

int xmlIsChar ( unsigned int  ch)

xmlIsChar: @ch: character to validate

This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead

Returns true if argument valid, false otherwise

Definition at line 256 of file chvalid.c.

256 {
257 return(xmlIsCharQ(ch));
258}
#define xmlIsCharQ(c)
Definition: chvalid.h:118

◆ xmlIsCombining()

int xmlIsCombining ( unsigned int  ch)

xmlIsCombining: @ch: character to validate

This function is DEPRECATED. Use xmlIsCombiningQ instead

Returns true if argument valid, false otherwise

Definition at line 271 of file chvalid.c.

271 {
272 return(xmlIsCombiningQ(ch));
273}
#define xmlIsCombiningQ(c)
Definition: chvalid.h:132

◆ xmlIsDigit()

int xmlIsDigit ( unsigned int  ch)

xmlIsDigit: @ch: character to validate

This function is DEPRECATED. Use xmlIsDigit_ch or xmlIsDigitQ instead

Returns true if argument valid, false otherwise

Definition at line 286 of file chvalid.c.

286 {
287 return(xmlIsDigitQ(ch));
288}
#define xmlIsDigitQ(c)
Definition: chvalid.h:152

◆ xmlIsExtender()

int xmlIsExtender ( unsigned int  ch)

xmlIsExtender: @ch: character to validate

This function is DEPRECATED. Use xmlIsExtender_ch or xmlIsExtenderQ instead

Returns true if argument valid, false otherwise

Definition at line 301 of file chvalid.c.

301 {
302 return(xmlIsExtenderQ(ch));
303}
#define xmlIsExtenderQ(c)
Definition: chvalid.h:172

◆ xmlIsIdeographic()

int xmlIsIdeographic ( unsigned int  ch)

xmlIsIdeographic: @ch: character to validate

This function is DEPRECATED. Use xmlIsIdeographicQ instead

Returns true if argument valid, false otherwise

Definition at line 316 of file chvalid.c.

316 {
317 return(xmlIsIdeographicQ(ch));
318}
#define xmlIsIdeographicQ(c)
Definition: chvalid.h:184

◆ xmlIsPubidChar()

int xmlIsPubidChar ( unsigned int  ch)

xmlIsPubidChar: @ch: character to validate

This function is DEPRECATED. Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead

Returns true if argument valid, false otherwise

Definition at line 331 of file chvalid.c.

331 {
332 return(xmlIsPubidCharQ(ch));
333}
#define xmlIsPubidCharQ(c)
Definition: chvalid.h:207

Variable Documentation

◆ xmlIsBaseChar_srng

const xmlChSRange xmlIsBaseChar_srng[]
static

Definition at line 49 of file chvalid.c.

◆ xmlIsBaseCharGroup

const xmlChRangeGroup xmlIsBaseCharGroup
Initial value:
=
static const xmlChSRange xmlIsBaseChar_srng[]
Definition: chvalid.c:49
xmlChLRange * xmlChLRangePtr
Definition: chvalid.h:36

Definition at line 99 of file chvalid.c.

◆ xmlIsChar_lrng

const xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}}
static

Definition at line 104 of file chvalid.c.

◆ xmlIsChar_srng

const xmlChSRange xmlIsChar_srng[]
static
Initial value:
= { {0x100, 0xd7ff},
{0xe000, 0xfffd}}

Definition at line 102 of file chvalid.c.

◆ xmlIsCharGroup

const xmlChRangeGroup xmlIsCharGroup
Initial value:
=
static const xmlChLRange xmlIsChar_lrng[]
Definition: chvalid.c:104
static const xmlChSRange xmlIsChar_srng[]
Definition: chvalid.c:102

Definition at line 105 of file chvalid.c.

◆ xmlIsCombining_srng

const xmlChSRange xmlIsCombining_srng[]
static
Initial value:
= { {0x300, 0x345},
{0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9},
{0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4},
{0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df},
{0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903},
{0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954},
{0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be},
{0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd},
{0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c},
{0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48},
{0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc},
{0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03},
{0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d},
{0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8},
{0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44},
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83},
{0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6},
{0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d},
{0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e},
{0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd},
{0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39},
{0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b},
{0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7},
{0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f},
{0x3099, 0x3099}, {0x309a, 0x309a}}

Definition at line 108 of file chvalid.c.

◆ xmlIsCombiningGroup

const xmlChRangeGroup xmlIsCombiningGroup
Initial value:
=
static const xmlChSRange xmlIsCombining_srng[]
Definition: chvalid.c:108

Definition at line 133 of file chvalid.c.

◆ xmlIsDigit_srng

const xmlChSRange xmlIsDigit_srng[]
static
Initial value:
= { {0x660, 0x669},
{0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f},
{0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f},
{0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9},
{0xf20, 0xf29}}

Definition at line 136 of file chvalid.c.

◆ xmlIsDigitGroup

const xmlChRangeGroup xmlIsDigitGroup
Initial value:
=
static const xmlChSRange xmlIsDigit_srng[]
Definition: chvalid.c:136

Definition at line 141 of file chvalid.c.

◆ xmlIsExtender_srng

const xmlChSRange xmlIsExtender_srng[]
static
Initial value:
= { {0x2d0, 0x2d0},
{0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46},
{0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e},
{0x30fc, 0x30fe}}

Definition at line 144 of file chvalid.c.

◆ xmlIsExtenderGroup

const xmlChRangeGroup xmlIsExtenderGroup
Initial value:
=
static const xmlChSRange xmlIsExtender_srng[]
Definition: chvalid.c:144

Definition at line 148 of file chvalid.c.

◆ xmlIsIdeographic_srng

const xmlChSRange xmlIsIdeographic_srng[]
static
Initial value:
= { {0x3007, 0x3007},
{0x3021, 0x3029}, {0x4e00, 0x9fa5}}

Definition at line 151 of file chvalid.c.

◆ xmlIsIdeographicGroup

const xmlChRangeGroup xmlIsIdeographicGroup
Initial value:
=
static const xmlChSRange xmlIsIdeographic_srng[]
Definition: chvalid.c:151

Definition at line 153 of file chvalid.c.

◆ xmlIsPubidChar_tab

const unsigned char xmlIsPubidChar_tab[256]
Initial value:
= {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 }

Definition at line 25 of file chvalid.c.