34#define MAX_URI_LENGTH 1024 * 1024
44 "Memory allocation failed : %s\n",
extra);
50 "Memory allocation failed\n");
59#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
68#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
75#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
83#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
89#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
95#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') || \
96 ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') || \
97 ((x) == '(') || ((x) == ')'))
103#define IS_UNWISE(p) \
104 (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) || \
105 ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) || \
106 ((*(p) == ']')) || ((*(p) == '`')))
112#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
113 ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
114 ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
121#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
127#define NEXT(p) ((*p == '%')? p += 3 : p++)
139#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
147#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
148#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) || \
149 ((*(p) >= 'A') && (*(p) <= 'Z')))
150#define ISA_HEXDIG(p) \
151 (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) || \
152 ((*(p) >= 'A') && (*(p) <= 'F')))
158#define ISA_SUB_DELIM(p) \
159 (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) || \
160 ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) || \
161 ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) || \
162 ((*(p) == '=')) || ((*(p) == '\'')))
167#define ISA_GEN_DELIM(p) \
168 (((*(p) == ':')) || ((*(p) == '/')) || ((*(p) == '?')) || \
169 ((*(p) == '#')) || ((*(p) == '[')) || ((*(p) == ']')) || \
175#define ISA_RESERVED(p) (ISA_GEN_DELIM(p) || (ISA_SUB_DELIM(p)))
180#define ISA_UNRESERVED(p) \
181 ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) || \
182 ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
187#define ISA_PCT_ENCODED(p) \
188 ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
193#define ISA_PCHAR(p) \
194 (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) || \
195 ((*(p) == ':')) || ((*(p) == '@')))
255 (*
cur ==
'[') || (*
cur ==
']') ||
261 if (
uri->cleanup & 2)
297 if (
uri->cleanup & 2)
333 int digit = *
cur -
'0';
376 if (
uri->cleanup & 2)
413 else if ((*
cur ==
'2') && (*(
cur + 1) >=
'0') &&
416 else if ((*
cur ==
'2') && (*(
cur + 1) ==
'5') &&
417 (*(
cur + 2) >=
'0') && (*(
cur + 1) <=
'5'))
451 while ((*
cur !=
']') && (*
cur != 0))
492 if (
uri->cleanup & 2)
526 if ((
ret != 0) || (*
cur !=
'@'))
531 if (
ret != 0)
return(
ret);
535 if (
ret != 0)
return(
ret);
594 while (*
cur ==
'/') {
597 if (
ret != 0)
return(
ret);
602 if (
uri->cleanup & 2)
639 while (*
cur ==
'/') {
642 if (
ret != 0)
return(
ret);
648 if (
uri->cleanup & 2)
681 if (
ret != 0)
return(
ret);
682 while (*
cur ==
'/') {
685 if (
ret != 0)
return(
ret);
690 if (
uri->cleanup & 2)
723 if (
ret != 0)
return(
ret);
724 while (*
cur ==
'/') {
727 if (
ret != 0)
return(
ret);
732 if (
uri->cleanup & 2)
767 if ((*
cur ==
'/') && (*(
cur + 1) ==
'/')) {
770 if (
ret != 0)
return(
ret);
774 if (
ret != 0)
return(
ret);
777 }
else if (*
cur ==
'/') {
779 if (
ret != 0)
return(
ret);
782 if (
ret != 0)
return(
ret);
814 if ((*
str ==
'/') && (*(
str + 1) ==
'/')) {
817 if (
ret != 0)
return(
ret);
819 if (
ret != 0)
return(
ret);
820 }
else if (*
str ==
'/') {
822 if (
ret != 0)
return(
ret);
825 if (
ret != 0)
return(
ret);
837 if (
ret != 0)
return(
ret);
842 if (
ret != 0)
return(
ret);
869 if (
ret != 0)
return(
ret);
875 if (
ret != 0)
return(
ret);
879 if (
ret != 0)
return(
ret);
884 if (
ret != 0)
return(
ret);
1112 int val = *(
unsigned char *)
p++;
1113 int hi =
val / 0x10, lo =
val % 0x10;
1115 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1116 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1120 if ((
uri->server !=
NULL) || (
uri->port == -1)) {
1137 ((*(
p) ==
';')) || ((*(
p) ==
':')) ||
1138 ((*(
p) ==
'&')) || ((*(
p) ==
'=')) ||
1139 ((*(
p) ==
'+')) || ((*(
p) ==
'$')) ||
1143 int val = *(
unsigned char *)
p++;
1144 int hi =
val / 0x10, lo =
val % 0x10;
1146 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1147 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1167 if (
uri->port > 0) {
1176 }
else if (
uri->authority !=
NULL) {
1192 ((*(
p) ==
'$')) || ((*(
p) ==
',')) || ((*(
p) ==
';')) ||
1193 ((*(
p) ==
':')) || ((*(
p) ==
'@')) || ((*(
p) ==
'&')) ||
1194 ((*(
p) ==
'=')) || ((*(
p) ==
'+')))
1197 int val = *(
unsigned char *)
p++;
1198 int hi =
val / 0x10, lo =
val % 0x10;
1200 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1201 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1204 }
else if (
uri->scheme !=
NULL) {
1219 (((
p[1] >=
'a') && (
p[1] <=
'z')) ||
1220 ((
p[1] >=
'A') && (
p[1] <=
'Z'))) &&
1239 ((*(
p) ==
';')) || ((*(
p) ==
'@')) || ((*(
p) ==
'&')) ||
1240 ((*(
p) ==
'=')) || ((*(
p) ==
'+')) || ((*(
p) ==
'$')) ||
1244 int val = *(
unsigned char *)
p++;
1245 int hi =
val / 0x10, lo =
val % 0x10;
1247 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1248 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1268 }
else if (
uri->query !=
NULL) {
1285 int val = *(
unsigned char *)
p++;
1286 int hi =
val / 0x10, lo =
val % 0x10;
1288 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1289 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1311 int val = *(
unsigned char *)
p++;
1312 int hi =
val / 0x10, lo =
val % 0x10;
1314 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1315 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1430 while (
cur[0] ==
'/')
1441 while (
cur[0] !=
'\0') {
1446 if ((
cur[0] ==
'.') && (
cur[1] ==
'/')) {
1449 while (
cur[0] ==
'/')
1458 if ((
cur[0] ==
'.') && (
cur[1] ==
'\0'))
1462 while (
cur[0] !=
'/') {
1468 while ((
cur[0] ==
'/') && (
cur[1] ==
'/'))
1478 while (
cur[0] ==
'/')
1510 while ((segp[0] !=
'/') && (segp[0] !=
'\0'))
1516 if (segp[0] ==
'\0')
1523 if (((
cur[0] ==
'.') && (
cur[1] ==
'.') && (segp ==
cur+3))
1524 || ((segp[0] !=
'.') || (segp[1] !=
'.')
1525 || ((segp[2] !=
'/') && (segp[2] !=
'\0')))) {
1538 if (segp[2] ==
'\0') {
1546 while ((*tmp++ = *segp++) != 0)
1551 while ((segp >
path) && ((--segp)[0] ==
'/'))
1580 if (
path[0] ==
'/') {
1582 while ((
cur[0] ==
'/') && (
cur[1] ==
'.') && (
cur[2] ==
'.')
1583 && ((
cur[3] ==
'/') || (
cur[3] ==
'\0')))
1588 while (
cur[0] !=
'\0')
1598 if (((
c >=
'0') && (
c <=
'9')) ||
1599 ((
c >=
'a') && (
c <=
'f')) ||
1600 ((
c >=
'A') && (
c <=
'F')))
1643 if ((*
in >=
'0') && (*
in <=
'9'))
1645 else if ((*
in >=
'a') && (*
in <=
'f'))
1646 c = (*
in -
'a') + 10;
1647 else if ((*
in >=
'A') && (*
in <=
'F'))
1648 c = (*
in -
'A') + 10;
1650 if ((*
in >=
'0') && (*
in <=
'9'))
1651 c =
c * 16 + (*
in -
'0');
1652 else if ((*
in >=
'a') && (*
in <=
'f'))
1653 c =
c * 16 + (*
in -
'a') + 10;
1654 else if ((*
in >=
'A') && (*
in <=
'F'))
1655 c =
c * 16 + (*
in -
'A') + 10;
1779#define NULLCHK(p) if(!p) { \
1780 xmlURIErrMemory("escaping URI value\n"); \
1793 if (
uri->authority) {
1836 if (
uri->query_raw) {
1840 else if (
uri->query) {
1856 if (
uri->fragment) {
2050 if ((
ref->path !=
NULL) && (
ref->path[0] ==
'/')) {
2103 if (
ref->path !=
NULL &&
ref->path[0] != 0) {
2110 while (
ref->path[indx] != 0) {
2183 int remove_path = 0;
2185 if ((URI ==
NULL) || (*URI == 0))
2195 if (URI[0] !=
'.') {
2212 if (
base[0] !=
'.') {
2239 ref->path = (
char *)
"/";
2257 if ((*rptr ==
'.') && (rptr[1] ==
'/'))
2259 if ((*bptr ==
'.') && (bptr[1] ==
'/'))
2261 else if ((*bptr ==
'/') && (*rptr !=
'/'))
2263 while ((bptr[
pos] == rptr[
pos]) && (bptr[
pos] != 0))
2266 if (bptr[
pos] == rptr[
pos]) {
2276 for (; ix > 0; ix--) {
2277 if (rptr[ix - 1] ==
'/')
2285 for (; bptr[ix] != 0; ix++) {
2286 if (bptr[ix] ==
'/')
2293 if (nbslash == 0 && !uptr[0]) {
2322 for (; nbslash>0; nbslash--) {
2331 if ((vptr >
val) && (
len > 0) &&
2332 (uptr[0] ==
'/') && (vptr[-1] ==
'/')) {
2353 if (remove_path != 0)
2374#define IS_WINDOWS_PATH(p) \
2376 (((p[0] >= 'a') && (p[0] <= 'z')) || \
2377 ((p[0] >= 'A') && (p[0] <= 'Z'))) && \
2378 (p[1] == ':') && ((p[2] == '/') || (p[2] == '\\')))
2405 if ((
path[0] ==
'\\') && (
path[1] ==
'\\') && (
path[2] ==
'?') &&
2411 if ((
path[0] ==
'/') && (
path[1] ==
'/') && (
path[2] !=
'/'))
2421 if (absuri !=
NULL) {
2433 if ((
l <= 0) || (
l > 20))
2434 goto path_processing;
2436 for (
j = 0;
j <
l;
j++) {
2438 if (!(((
c >=
'a') && (
c <=
'z')) || ((
c >=
'A') && (
c <=
'Z'))))
2439 goto path_processing;
2444 if (escURI !=
NULL) {
2490 while (*
p !=
'\0') {
2549 while (*
ret !=
'\0') {
2556 temp.path = (
char *) cal;
ACPI_SIZE strlen(const char *String)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
static const WCHAR empty[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define memcpy(s1, s2, n)
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
XMLPUBVAR xmlStrdupFunc xmlMemStrdup
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBVAR xmlReallocFunc xmlRealloc
xmlChar * xmlCanonicPath(const xmlChar *path)
static int xmlParse3986HierPart(xmlURIPtr uri, const char **str)
static int xmlParse3986URIReference(xmlURIPtr uri, const char *str)
static int xmlParse3986Query(xmlURIPtr uri, const char **str)
static int xmlParse3986Segment(const char **str, char forbid, int empty)
char * xmlURIUnescapeString(const char *str, int len, char *target)
xmlChar * xmlURIEscapeStr(const xmlChar *str, const xmlChar *list)
static int xmlParse3986PathAbsolute(xmlURIPtr uri, const char **str)
static void xmlURIErrMemory(const char *extra)
static int xmlParse3986Authority(xmlURIPtr uri, const char **str)
static int xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str)
void xmlFreeURI(xmlURIPtr uri)
xmlChar * xmlPathToURI(const xmlChar *path)
xmlChar * xmlBuildRelativeURI(const xmlChar *URI, const xmlChar *base)
static int xmlParse3986URI(xmlURIPtr uri, const char *str)
xmlChar * xmlSaveUri(xmlURIPtr uri)
static xmlChar * xmlSaveUriRealloc(xmlChar *ret, int *max)
xmlChar * xmlBuildURI(const xmlChar *URI, const xmlChar *base)
static int xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str)
#define ISA_PCT_ENCODED(p)
#define ISA_UNRESERVED(p)
#define IS_WINDOWS_PATH(p)
static int xmlParse3986Host(xmlURIPtr uri, const char **str)
xmlURIPtr xmlParseURIRaw(const char *str, int raw)
xmlChar * xmlURIEscape(const xmlChar *str)
static int xmlParse3986PathRootless(xmlURIPtr uri, const char **str)
xmlURIPtr xmlParseURI(const char *str)
int xmlParseURIReference(xmlURIPtr uri, const char *str)
int xmlNormalizeURIPath(char *path)
static int xmlParse3986Userinfo(xmlURIPtr uri, const char **str)
xmlURIPtr xmlCreateURI(void)
static int xmlParse3986RelativeRef(xmlURIPtr uri, const char *str)
static void xmlCleanURI(xmlURIPtr uri)
void xmlPrintURI(FILE *stream, xmlURIPtr uri)
static int xmlParse3986Fragment(xmlURIPtr uri, const char **str)
static int xmlParse3986Port(xmlURIPtr uri, const char **str)
static int xmlParse3986Scheme(xmlURIPtr uri, const char **str)
static int xmlParse3986DecOctet(const char **str)
XMLPUBFUN const xmlChar *XMLCALL xmlStrchr(const xmlChar *str, xmlChar val)
XMLPUBFUN xmlChar *XMLCALL xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN const xmlChar *XMLCALL xmlStrstr(const xmlChar *str, const xmlChar *val)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL xmlStrcmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)