• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/libxml2-2.7.2/

Lines Matching refs:uri

2  * uri.c: set of generic URI related routines 
17 #include <libxml/uri.h>
21 static void xmlCleanURI(xmlURIPtr uri);
167 * @uri: pointer to an URI structure
177 xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
189 if (uri != NULL) {
190 if (uri->scheme != NULL) xmlFree(uri->scheme);
191 uri->scheme = STRNDUP(*str, cur - *str);
199 * @uri: pointer to an URI structure
213 xmlParse3986Fragment(xmlURIPtr uri, const char **str)
224 ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
226 if (uri != NULL) {
227 if (uri->fragment != NULL)
228 xmlFree(uri->fragment);
229 if (uri->cleanup & 2)
230 uri->fragment = STRNDUP(*str, cur - *str);
232 uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
240 * @uri: pointer to an URI structure
250 xmlParse3986Query(xmlURIPtr uri, const char **str)
260 ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
262 if (uri != NULL) {
263 if (uri->query != NULL)
264 xmlFree(uri->query);
265 if (uri->cleanup & 2)
266 uri->query = STRNDUP(*str, cur - *str);
268 uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
273 if (uri->query_raw != NULL)
274 xmlFree (uri->query_raw);
275 uri->query_raw = STRNDUP (*str, cur - *str);
283 * @uri: pointer to an URI structure
287 * of the @uri structure
294 xmlParse3986Port(xmlURIPtr uri, const char **str)
299 if (uri != NULL)
300 uri->port = 0;
302 if (uri != NULL)
303 uri->port = uri->port * 10 + (*cur - '0');
314 * @uri: pointer to an URI structure
318 * of the @uri structure
325 xmlParse3986Userinfo(xmlURIPtr uri, const char **str)
334 if (uri != NULL) {
335 if (uri->user != NULL) xmlFree(uri->user);
336 if (uri->cleanup & 2)
337 uri->user = STRNDUP(*str, cur - *str);
339 uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
386 * @uri: pointer to an URI structure
390 * of the @uri structure
400 xmlParse3986Host(xmlURIPtr uri, const char **str)
447 if (uri != NULL) {
448 if (uri->authority != NULL) xmlFree(uri->authority);
449 uri->authority = NULL;
450 if (uri->server != NULL) xmlFree(uri->server);
452 if (uri->cleanup & 2)
453 uri->server = STRNDUP(host, cur - host);
455 uri->server = xmlURIUnescapeString(host, cur - host, NULL);
457 uri->server = NULL;
465 * @uri: pointer to an URI structure
469 * of the @uri structure
476 xmlParse3986Authority(xmlURIPtr uri, const char **str)
485 ret = xmlParse3986Userinfo(uri, &cur);
490 ret = xmlParse3986Host(uri, &cur);
494 ret = xmlParse3986Port(uri, &cur);
508 * of the @uri structure
536 * @uri: pointer to an URI structure
540 * of the @uri structure
547 xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str)
559 if (uri != NULL) {
560 if (uri->path != NULL) xmlFree(uri->path);
561 if (uri->cleanup & 2)
562 uri->path = STRNDUP(*str, cur - *str);
564 uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
572 * @uri: pointer to an URI structure
576 * of the @uri structure
583 xmlParse3986PathAbsolute(xmlURIPtr uri, const char **str)
601 if (uri != NULL) {
602 if (uri->path != NULL) xmlFree(uri->path);
603 if (uri->cleanup & 2)
604 uri->path = STRNDUP(*str, cur - *str);
606 uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
614 * @uri: pointer to an URI structure
618 * of the @uri structure
625 xmlParse3986PathRootless(xmlURIPtr uri, const char **str)
639 if (uri != NULL) {
640 if (uri->path != NULL) xmlFree(uri->path);
641 if (uri->cleanup & 2)
642 uri->path = STRNDUP(*str, cur - *str);
644 uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
652 * @uri: pointer to an URI structure
656 * of the @uri structure
663 xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str)
677 if (uri != NULL) {
678 if (uri->path != NULL) xmlFree(uri->path);
679 if (uri->cleanup & 2)
680 uri->path = STRNDUP(*str, cur - *str);
682 uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
690 * @uri: pointer to an URI structure
694 * of the @uri structure
704 xmlParse3986HierPart(xmlURIPtr uri, const char **str)
713 ret = xmlParse3986Authority(uri, &cur);
715 ret = xmlParse3986PathAbEmpty(uri, &cur);
720 ret = xmlParse3986PathAbsolute(uri, &cur);
723 ret = xmlParse3986PathRootless(uri, &cur);
727 if (uri != NULL) {
728 if (uri->path != NULL) xmlFree(uri->path);
729 uri->path = NULL;
738 * @uri: pointer to an URI structure
742 * of the @uri structure
753 xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
758 ret = xmlParse3986Authority(uri, &str);
760 ret = xmlParse3986PathAbEmpty(uri, &str);
763 ret = xmlParse3986PathAbsolute(uri, &str);
766 ret = xmlParse3986PathNoScheme(uri, &str);
770 if (uri != NULL) {
771 if (uri->path != NULL) xmlFree(uri->path);
772 uri->path = NULL;
778 ret = xmlParse3986Query(uri, &str);
783 ret = xmlParse3986Fragment(uri, &str);
787 xmlCleanURI(uri);
796 * @uri: pointer to an URI structure
800 * of the @uri structure
807 xmlParse3986URI(xmlURIPtr uri, const char *str) {
810 ret = xmlParse3986Scheme(uri, &str);
816 ret = xmlParse3986HierPart(uri, &str);
820 ret = xmlParse3986Query(uri, &str);
825 ret = xmlParse3986Fragment(uri, &str);
829 xmlCleanURI(uri);
837 * @uri: pointer to an URI structure
841 * of the @uri structure
848 xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
853 xmlCleanURI(uri);
859 ret = xmlParse3986URI(uri, str);
861 xmlCleanURI(uri);
862 ret = xmlParse3986RelativeRef(uri, str);
864 xmlCleanURI(uri);
883 xmlURIPtr uri;
888 uri = xmlCreateURI();
889 if (uri != NULL) {
890 ret = xmlParse3986URIReference(uri, str);
892 xmlFreeURI(uri);
896 return(uri);
901 * @uri: pointer to an URI structure
905 * appropriate fields of the @uri structure
912 xmlParseURIReference(xmlURIPtr uri, const char *str) {
913 return(xmlParse3986URIReference(uri, str));
929 xmlURIPtr uri;
934 uri = xmlCreateURI();
935 if (uri != NULL) {
937 uri->cleanup |= 2;
939 ret = xmlParseURIReference(uri, str);
941 xmlFreeURI(uri);
945 return(uri);
977 * @uri: pointer to an xmlURI
984 xmlSaveUri(xmlURIPtr uri) {
991 if (uri == NULL) return(NULL);
1003 if (uri->scheme != NULL) {
1004 p = uri->scheme;
1032 if (uri->opaque != NULL) {
1033 p = uri->opaque;
1057 if (uri->server != NULL) {
1071 if (uri->user != NULL) {
1072 p = uri->user;
1114 p = uri->server;
1130 if (uri->port > 0) {
1143 len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
1145 } else if (uri->authority != NULL) {
1160 p = uri->authority;
1187 } else if (uri->scheme != NULL) {
1203 if (uri->path != NULL) {
1204 p = uri->path;
1209 if ((uri->scheme != NULL) &&
1214 (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
1256 if (uri->query_raw != NULL) {
1270 p = uri->query_raw;
1286 } else if (uri->query != NULL) {
1300 p = uri->query;
1326 if (uri->fragment != NULL) {
1340 p = uri->fragment;
1383 * @uri: pointer to an xmlURI
1388 xmlPrintURI(FILE *stream, xmlURIPtr uri) {
1391 out = xmlSaveUri(uri);
1400 * @uri: pointer to an xmlURI
1405 xmlCleanURI(xmlURIPtr uri) {
1406 if (uri == NULL) return;
1408 if (uri->scheme != NULL) xmlFree(uri->scheme);
1409 uri->scheme = NULL;
1410 if (uri->server != NULL) xmlFree(uri->server);
1411 uri->server = NULL;
1412 if (uri->user != NULL) xmlFree(uri->user);
1413 uri->user = NULL;
1414 if (uri->path != NULL) xmlFree(uri->path);
1415 uri->path = NULL;
1416 if (uri->fragment != NULL) xmlFree(uri->fragment);
1417 uri->fragment = NULL;
1418 if (uri->opaque != NULL) xmlFree(uri->opaque);
1419 uri->opaque = NULL;
1420 if (uri->authority != NULL) xmlFree(uri->authority);
1421 uri->authority = NULL;
1422 if (uri->query != NULL) xmlFree(uri->query);
1423 uri->query = NULL;
1424 if (uri->query_raw != NULL) xmlFree(uri->query_raw);
1425 uri->query_raw = NULL;
1430 * @uri: pointer to an xmlURI
1435 xmlFreeURI(xmlURIPtr uri) {
1436 if (uri == NULL) return;
1438 if (uri->scheme != NULL) xmlFree(uri->scheme);
1439 if (uri->server != NULL) xmlFree(uri->server);
1440 if (uri->user != NULL) xmlFree(uri->user);
1441 if (uri->path != NULL) xmlFree(uri->path);
1442 if (uri->fragment != NULL) xmlFree(uri->fragment);
1443 if (uri->opaque != NULL) xmlFree(uri->opaque);
1444 if (uri->authority != NULL) xmlFree(uri->authority);
1445 if (uri->query != NULL) xmlFree(uri->query);
1446 if (uri->query_raw != NULL) xmlFree(uri->query_raw);
1447 xmlFree(uri);
1806 xmlURIPtr uri;
1812 xmlFreeURI(uri); \
1818 uri = xmlCreateURI();
1819 if (uri != NULL) {
1823 uri->cleanup = 1;
1824 ret2 = xmlParseURIReference(uri, (const char *)str);
1826 xmlFreeURI(uri);
1831 if (!uri)
1836 if (uri->scheme) {
1837 segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
1844 if (uri->authority) {
1846 xmlURIEscapeStr(BAD_CAST uri->authority, BAD_CAST "/?;:@");
1853 if (uri->user) {
1854 segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
1862 if (uri->server) {
1863 segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
1865 if (uri->user == NULL)
1871 if (uri->port) {
1874 snprintf((char *) port, 10, "%d", uri->port);
1879 if (uri->path) {
1881 xmlURIEscapeStr(BAD_CAST uri->path, BAD_CAST ":@&=+$,/?;");
1887 if (uri->query_raw) {
1889 ret = xmlStrcat(ret, BAD_CAST uri->query_raw);
1891 else if (uri->query) {
1893 xmlURIEscapeStr(BAD_CAST uri->query, BAD_CAST ";/?:@&=+,$");
1900 if (uri->opaque) {
1901 segment = xmlURIEscapeStr(BAD_CAST uri->opaque, BAD_CAST "");
1907 if (uri->fragment) {
1908 segment = xmlURIEscapeStr(BAD_CAST uri->fragment, BAD_CAST "#");
1915 xmlFreeURI(uri);
2459 xmlURIPtr uri;
2470 if ((uri = xmlParseURI((const char *) path)) != NULL) {
2471 xmlFreeURI(uri);
2475 /* Check if this is an "absolute uri" */
2502 uri = xmlParseURI((const char *) escURI);
2504 if (uri != NULL) {
2505 xmlFreeURI(uri);
2517 uri = xmlCreateURI();
2518 if (uri == NULL) { /* Guard against 'out of memory' */
2525 uri->scheme = xmlStrdup(BAD_CAST "file");
2527 uri->path = xmlMallocAtomic(len + 2);
2528 if (uri->path == NULL) {
2529 xmlFreeURI(uri); /* Guard agains 'out of memory' */
2533 uri->path[0] = '/';
2534 p = uri->path + 1;
2537 uri->path = xmlStrdup(path);
2538 if (uri->path == NULL) {
2539 xmlFreeURI(uri);
2542 p = uri->path;
2551 if (uri->scheme == NULL) {
2552 ret = xmlStrdup((const xmlChar *) uri->path);
2554 ret = xmlSaveUri(uri);
2557 xmlFreeURI(uri);
2578 xmlURIPtr uri;
2585 if ((uri = xmlParseURI((const char *) path)) != NULL) {
2586 xmlFreeURI(uri);
2596 if ((uri = xmlParseURI((const char *) cal)) != NULL) {
2597 xmlFreeURI(uri);