ReactOS 0.4.16-dev-2232-gc2aaa52
chvalid.c File Reference
#include "libxml.h"
#include <libxml/chvalid.h>
#include <stddef.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 170 of file chvalid.c.

170 {
171 int low, high, mid;
172 const xmlChSRange *sptr;
173 const xmlChLRange *lptr;
174
175 if (rptr == NULL) return(0);
176 if (val < 0x10000) { /* is val in 'short' or 'long' array? */
177 if (rptr->nbShortRange == 0)
178 return 0;
179 low = 0;
180 high = rptr->nbShortRange - 1;
181 sptr = rptr->shortRange;
182 while (low <= high) {
183 mid = (low + high) / 2;
184 if ((unsigned short) val < sptr[mid].low) {
185 high = mid - 1;
186 } else {
187 if ((unsigned short) val > sptr[mid].high) {
188 low = mid + 1;
189 } else {
190 return 1;
191 }
192 }
193 }
194 } else {
195 if (rptr->nbLongRange == 0) {
196 return 0;
197 }
198 low = 0;
199 high = rptr->nbLongRange - 1;
200 lptr = rptr->longRange;
201 while (low <= high) {
202 mid = (low + high) / 2;
203 if (val < lptr[mid].low) {
204 high = mid - 1;
205 } else {
206 if (val > lptr[mid].high) {
207 low = mid + 1;
208 } else {
209 return 1;
210 }
211 }
212 }
213 }
214 return 0;
215}
#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 228 of file chvalid.c.

228 {
229 return(xmlIsBaseCharQ(ch));
230}
#define xmlIsBaseCharQ(c)
Definition: chvalid.h:76
unsigned char ch[4][2]
Definition: console.c:118

◆ 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 243 of file chvalid.c.

243 {
244 return(xmlIsBlankQ(ch));
245}
#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 258 of file chvalid.c.

258 {
259 return(xmlIsCharQ(ch));
260}
#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 273 of file chvalid.c.

273 {
274 return(xmlIsCombiningQ(ch));
275}
#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 288 of file chvalid.c.

288 {
289 return(xmlIsDigitQ(ch));
290}
#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 303 of file chvalid.c.

303 {
304 return(xmlIsExtenderQ(ch));
305}
#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 318 of file chvalid.c.

318 {
319 return(xmlIsIdeographicQ(ch));
320}
#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 333 of file chvalid.c.

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

Variable Documentation

◆ xmlIsBaseChar_srng

const xmlChSRange xmlIsBaseChar_srng[]
static

Definition at line 51 of file chvalid.c.

◆ xmlIsBaseCharGroup

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

Definition at line 101 of file chvalid.c.

◆ xmlIsChar_lrng

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

Definition at line 106 of file chvalid.c.

◆ xmlIsChar_srng

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

Definition at line 104 of file chvalid.c.

◆ xmlIsCharGroup

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

Definition at line 107 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 110 of file chvalid.c.

◆ xmlIsCombiningGroup

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

Definition at line 135 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 138 of file chvalid.c.

◆ xmlIsDigitGroup

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

Definition at line 143 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 146 of file chvalid.c.

◆ xmlIsExtenderGroup

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

Definition at line 150 of file chvalid.c.

◆ xmlIsIdeographic_srng

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

Definition at line 153 of file chvalid.c.

◆ xmlIsIdeographicGroup

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

Definition at line 155 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 27 of file chvalid.c.