summaryrefslogtreecommitdiff
path: root/utils/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils.c')
-rw-r--r--utils/utils.c105
1 files changed, 1 insertions, 104 deletions
diff --git a/utils/utils.c b/utils/utils.c
index 889985178..f2c7188ea 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf.sourceforge.net/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
- * Copyright 2003 James Bursa <bursa@users.sourceforge.net>
+ * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
* Copyright 2003 John M Bell <jmb202@ecs.soton.ac.uk>
*/
@@ -12,17 +12,11 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
-#include <uri.h>
#include <sys/types.h>
#include <regex.h>
#include <time.h>
#include "libxml/encoding.h"
-#include "libxml/uri.h"
#include "netsurf/utils/config.h"
-#ifdef riscos
-#include "netsurf/riscos/about.h"
-#include "netsurf/riscos/constdata.h"
-#endif
#define NDEBUG
#include "netsurf/utils/log.h"
#include "netsurf/utils/messages.h"
@@ -190,103 +184,6 @@ char *squash_tolat1(xmlChar *s)
/**
- * Calculate an URL from a relative and base URL.
- *
- * base may be 0 for a new URL, in which case the URL is canonicalized and
- * returned. Returns 0 in case of error.
- */
-
-char *url_join(char *rel_url, char *base_url)
-{
- char *res;
- uri_t *base = 0, *rel = 0, *abs;
-
- LOG(("rel_url = %s, base_url = %s", rel_url, base_url));
-
-#ifdef riscos
- /* hacky, hacky, hacky...
- * It is, however, best to do this here as it avoids
- * duplicating code for clicking links and url bar handling.
- * It simplifies the code it the other places too (they just
- * call this as usual, then we handle it here).
- */
-#ifdef WITH_ABOUT
- if (strcasecmp(rel_url, "about:") == 0) {
- about_create();
- return xstrdup(ABOUT_URL);
- }
-#ifdef WITH_COOKIES
- if (strcasecmp(rel_url, "about:cookies") == 0) {
- cookie_create();
- return xstrdup(COOKIE_URL);
- }
-#endif
-#endif
-#endif
-
- if (!base_url) {
- res = uri_cannonicalize_string(rel_url,
- (int)(strlen(rel_url)),
- URI_STRING_URI_STYLE);
- LOG(("res = %s", res));
- if (res)
- return xstrdup(res);
- return 0;
- }
-
- base = uri_alloc(base_url, (int)(strlen(base_url)));
- rel = uri_alloc(rel_url, (int)(strlen(rel_url)));
- if (!base || !rel)
- goto fail;
- if (!base->scheme)
- goto fail;
-
- abs = uri_abs_1(base, rel);
-
- res = xstrdup(uri_uri(abs));
-
- uri_free(base);
- uri_free(rel);
-
- LOG(("res = %s", res));
- return res;
-
-fail:
- if (base)
- uri_free(base);
- if (rel)
- uri_free(rel);
-
- LOG(("error"));
-
- return 0;
-}
-
-
-/**
- * Extract the host name from a url.
- *
- * \param url an absolute URL
- * \return a new string, or 0 in case of error
- */
-
-char *get_host_from_url(char *url)
-{
- char *host = 0;
- uri_t *uri;
-
- uri = uri_alloc(url, (int)(strlen(url)));
- if (!uri)
- return 0;
- if (uri->host)
- host = xstrdup(uri->host);
- uri_free(uri);
-
- return host;
-}
-
-
-/**
* Check if a directory exists.
*/