35#define MAX_URI_LENGTH 1024 * 1024
38#define PORT_EMPTY_SERVER -1
48 "Memory allocation failed : %s\n",
extra);
54 "Memory allocation failed\n");
63#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
72#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
79#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
87#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
93#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
99#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') || \
100 ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') || \
101 ((x) == '(') || ((x) == ')'))
107#define IS_UNWISE(p) \
108 (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) || \
109 ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) || \
110 ((*(p) == ']')) || ((*(p) == '`')))
116#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
117 ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
118 ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
125#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
131#define NEXT(p) ((*p == '%')? p += 3 : p++)
143#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
151#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
152#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) || \
153 ((*(p) >= 'A') && (*(p) <= 'Z')))
154#define ISA_HEXDIG(p) \
155 (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) || \
156 ((*(p) >= 'A') && (*(p) <= 'F')))
162#define ISA_SUB_DELIM(p) \
163 (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) || \
164 ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) || \
165 ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) || \
166 ((*(p) == '=')) || ((*(p) == '\'')))
171#define ISA_GEN_DELIM(p) \
172 (((*(p) == ':')) || ((*(p) == '/')) || ((*(p) == '?')) || \
173 ((*(p) == '#')) || ((*(p) == '[')) || ((*(p) == ']')) || \
179#define ISA_RESERVED(p) (ISA_GEN_DELIM(p) || (ISA_SUB_DELIM(p)))
184#define ISA_UNRESERVED(p) \
185 ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) || \
186 ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
191#define ISA_PCT_ENCODED(p) \
192 ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
197#define ISA_PCHAR(p) \
198 (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) || \
199 ((*(p) == ':')) || ((*(p) == '@')))
259 (*
cur ==
'[') || (*
cur ==
']') ||
265 if (
uri->cleanup & 2)
301 if (
uri->cleanup & 2)
337 int digit = *
cur -
'0';
380 if (
uri->cleanup & 2)
417 else if ((*
cur ==
'2') && (*(
cur + 1) >=
'0') &&
420 else if ((*
cur ==
'2') && (*(
cur + 1) ==
'5') &&
421 (*(
cur + 2) >=
'0') && (*(
cur + 1) <=
'5'))
455 while ((*
cur !=
']') && (*
cur != 0))
496 if (
uri->cleanup & 2)
530 if ((
ret != 0) || (*
cur !=
'@'))
535 if (
ret != 0)
return(
ret);
539 if (
ret != 0)
return(
ret);
598 while (*
cur ==
'/') {
601 if (
ret != 0)
return(
ret);
606 if (
uri->cleanup & 2)
643 while (*
cur ==
'/') {
646 if (
ret != 0)
return(
ret);
652 if (
uri->cleanup & 2)
685 if (
ret != 0)
return(
ret);
686 while (*
cur ==
'/') {
689 if (
ret != 0)
return(
ret);
694 if (
uri->cleanup & 2)
727 if (
ret != 0)
return(
ret);
728 while (*
cur ==
'/') {
731 if (
ret != 0)
return(
ret);
736 if (
uri->cleanup & 2)
771 if ((*
cur ==
'/') && (*(
cur + 1) ==
'/')) {
774 if (
ret != 0)
return(
ret);
781 if (
ret != 0)
return(
ret);
784 }
else if (*
cur ==
'/') {
786 if (
ret != 0)
return(
ret);
789 if (
ret != 0)
return(
ret);
821 if ((*
str ==
'/') && (*(
str + 1) ==
'/')) {
824 if (
ret != 0)
return(
ret);
826 if (
ret != 0)
return(
ret);
827 }
else if (*
str ==
'/') {
829 if (
ret != 0)
return(
ret);
832 if (
ret != 0)
return(
ret);
844 if (
ret != 0)
return(
ret);
849 if (
ret != 0)
return(
ret);
876 if (
ret != 0)
return(
ret);
882 if (
ret != 0)
return(
ret);
886 if (
ret != 0)
return(
ret);
891 if (
ret != 0)
return(
ret);
1120 int val = *(
unsigned char *)
p++;
1121 int hi =
val / 0x10, lo =
val % 0x10;
1123 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1124 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1145 ((*(
p) ==
';')) || ((*(
p) ==
':')) ||
1146 ((*(
p) ==
'&')) || ((*(
p) ==
'=')) ||
1147 ((*(
p) ==
'+')) || ((*(
p) ==
'$')) ||
1151 int val = *(
unsigned char *)
p++;
1152 int hi =
val / 0x10, lo =
val % 0x10;
1154 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1155 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1177 if (
uri->port > 0) {
1185 }
else if (
uri->authority !=
NULL) {
1201 ((*(
p) ==
'$')) || ((*(
p) ==
',')) || ((*(
p) ==
';')) ||
1202 ((*(
p) ==
':')) || ((*(
p) ==
'@')) || ((*(
p) ==
'&')) ||
1203 ((*(
p) ==
'=')) || ((*(
p) ==
'+')))
1206 int val = *(
unsigned char *)
p++;
1207 int hi =
val / 0x10, lo =
val % 0x10;
1209 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1210 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1213 }
else if (
uri->scheme !=
NULL) {
1228 (((
p[1] >=
'a') && (
p[1] <=
'z')) ||
1229 ((
p[1] >=
'A') && (
p[1] <=
'Z'))) &&
1248 ((*(
p) ==
';')) || ((*(
p) ==
'@')) || ((*(
p) ==
'&')) ||
1249 ((*(
p) ==
'=')) || ((*(
p) ==
'+')) || ((*(
p) ==
'$')) ||
1253 int val = *(
unsigned char *)
p++;
1254 int hi =
val / 0x10, lo =
val % 0x10;
1256 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1257 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1277 }
else if (
uri->query !=
NULL) {
1294 int val = *(
unsigned char *)
p++;
1295 int hi =
val / 0x10, lo =
val % 0x10;
1297 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1298 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1320 int val = *(
unsigned char *)
p++;
1321 int hi =
val / 0x10, lo =
val % 0x10;
1323 ret[
len++] = hi + (hi > 9?
'A'-10 :
'0');
1324 ret[
len++] = lo + (lo > 9?
'A'-10 :
'0');
1439 while (
cur[0] ==
'/')
1450 while (
cur[0] !=
'\0') {
1455 if ((
cur[0] ==
'.') && (
cur[1] ==
'/')) {
1458 while (
cur[0] ==
'/')
1467 if ((
cur[0] ==
'.') && (
cur[1] ==
'\0'))
1471 while (
cur[0] !=
'/') {
1477 while ((
cur[0] ==
'/') && (
cur[1] ==
'/'))
1487 while (
cur[0] ==
'/')
1519 while ((segp[0] !=
'/') && (segp[0] !=
'\0'))
1525 if (segp[0] ==
'\0')
1532 if (((
cur[0] ==
'.') && (
cur[1] ==
'.') && (segp ==
cur+3))
1533 || ((segp[0] !=
'.') || (segp[1] !=
'.')
1534 || ((segp[2] !=
'/') && (segp[2] !=
'\0')))) {
1547 if (segp[2] ==
'\0') {
1555 while ((*tmp++ = *segp++) != 0)
1560 while ((segp >
path) && ((--segp)[0] ==
'/'))
1589 if (
path[0] ==
'/') {
1591 while ((
cur[0] ==
'/') && (
cur[1] ==
'.') && (
cur[2] ==
'.')
1592 && ((
cur[3] ==
'/') || (
cur[3] ==
'\0')))
1597 while (
cur[0] !=
'\0')
1607 if (((
c >=
'0') && (
c <=
'9')) ||
1608 ((
c >=
'a') && (
c <=
'f')) ||
1609 ((
c >=
'A') && (
c <=
'F')))
1652 if ((*
in >=
'0') && (*
in <=
'9'))
1654 else if ((*
in >=
'a') && (*
in <=
'f'))
1655 c = (*
in -
'a') + 10;
1656 else if ((*
in >=
'A') && (*
in <=
'F'))
1657 c = (*
in -
'A') + 10;
1659 if ((*
in >=
'0') && (*
in <=
'9'))
1660 c =
c * 16 + (*
in -
'0');
1661 else if ((*
in >=
'a') && (*
in <=
'f'))
1662 c =
c * 16 + (*
in -
'a') + 10;
1663 else if ((*
in >=
'A') && (*
in <=
'F'))
1664 c =
c * 16 + (*
in -
'A') + 10;
1789#define NULLCHK(p) if(!p) { \
1790 xmlURIErrMemory("escaping URI value\n"); \
1803 if (
uri->authority) {
1830 if (
uri->port > 0) {
1846 if (
uri->query_raw) {
1850 else if (
uri->query) {
1866 if (
uri->fragment) {
2063 if ((
ref->path !=
NULL) && (
ref->path[0] ==
'/')) {
2116 if (
ref->path !=
NULL &&
ref->path[0] != 0) {
2123 while (
ref->path[indx] != 0) {
2196 int remove_path = 0;
2198 if ((URI ==
NULL) || (*URI == 0))
2208 if (URI[0] !=
'.') {
2225 if (
base[0] !=
'.') {
2253 ref->path = (
char *)
"/";
2271 if ((*rptr ==
'.') && (rptr[1] ==
'/'))
2273 if ((*bptr ==
'.') && (bptr[1] ==
'/'))
2275 else if ((*bptr ==
'/') && (*rptr !=
'/'))
2277 while ((bptr[
pos] == rptr[
pos]) && (bptr[
pos] != 0))
2280 if (bptr[
pos] == rptr[
pos]) {
2290 for (; ix > 0; ix--) {
2291 if (rptr[ix - 1] ==
'/')
2299 for (; bptr[ix] != 0; ix++) {
2300 if (bptr[ix] ==
'/')
2307 if (nbslash == 0 && !uptr[0]) {
2336 for (; nbslash>0; nbslash--) {
2345 if ((vptr >
val) && (
len > 0) &&
2346 (uptr[0] ==
'/') && (vptr[-1] ==
'/')) {
2367 if (remove_path != 0)
2388#define IS_WINDOWS_PATH(p) \
2390 (((p[0] >= 'a') && (p[0] <= 'z')) || \
2391 ((p[0] >= 'A') && (p[0] <= 'Z'))) && \
2392 (p[1] == ':') && ((p[2] == '/') || (p[2] == '\\')))
2419 if ((
path[0] ==
'\\') && (
path[1] ==
'\\') && (
path[2] ==
'?') &&
2425 if ((
path[0] ==
'/') && (
path[1] ==
'/') && (
path[2] !=
'/'))
2435 if (absuri !=
NULL) {
2447 if ((
l <= 0) || (
l > 20))
2448 goto path_processing;
2450 for (
j = 0;
j <
l;
j++) {
2452 if (!(((
c >=
'a') && (
c <=
'z')) || ((
c >=
'A') && (
c <=
'Z'))))
2453 goto path_processing;
2458 if (escURI !=
NULL) {
2504 while (*
p !=
'\0') {
2563 while (*
ret !=
'\0') {
2570 temp.path = (
char *) cal;
static const WCHAR empty[]
int WINAPIV fprintf(FILE *file, const char *format,...)
_ACRTIMP size_t __cdecl strlen(const char *)
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
#define memcpy(s1, s2, n)
xmlReallocFunc xmlRealloc
xmlMallocFunc xmlMallocAtomic
xmlStrdupFunc xmlMemStrdup
XML_HIDDEN void __xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, void *data, void *ctx, void *nod, int domain, int code, xmlErrorLevel level, const char *file, int line, const char *str1, const char *str2, const char *str3, int int1, int col, const char *msg,...) LIBXML_ATTR_FORMAT(16
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)
#define PORT_EMPTY_SERVER
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)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
XMLPUBFUN int xmlStrlen(const xmlChar *str)
XMLPUBFUN int xmlStrcmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN const xmlChar * xmlStrstr(const xmlChar *str, const xmlChar *val)
XMLPUBFUN xmlChar * xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN const xmlChar * xmlStrchr(const xmlChar *str, xmlChar val)
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)