summaryrefslogtreecommitdiff
path: root/beos
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-25 23:00:22 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-25 23:01:32 +0000
commit8ce0a10670e655d9e3a4f31fedd34baf1a3189b9 (patch)
treec1aa73bf937d097a6d2cb7efe3777cb6c720e7f7 /beos
parent46b8fbaeac4dd1e35945ae1338056156e5b3b86b (diff)
downloadnetsurf-8ce0a10670e655d9e3a4f31fedd34baf1a3189b9.tar.gz
netsurf-8ce0a10670e655d9e3a4f31fedd34baf1a3189b9.tar.bz2
move path_to_url and url_to_path to fetch operation table
Diffstat (limited to 'beos')
-rw-r--r--beos/gui.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp
index ca176c83f..05e06373c 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -786,6 +786,17 @@ static void gui_quit(void)
fetch_rsrc_unregister();
}
+static char *url_to_path(const char *url)
+{
+ char *url_path = curl_unescape(url, 0);
+ char *path;
+
+ /* return the absolute path including leading / */
+ path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1));
+ curl_free(url_path);
+
+ return path;
+}
/**
* Send the source of a content to a text editor.
@@ -983,7 +994,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
return UTF8_CONVERT_OK;
}
-char *path_to_url(const char *path)
+static char *path_to_url(const char *path)
{
int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1;
char *url = (char *)malloc(urllen);
@@ -1001,17 +1012,6 @@ char *path_to_url(const char *path)
return url;
}
-char *url_to_path(const char *url)
-{
- char *url_path = curl_unescape(url, 0);
- char *path;
-
- /* return the absolute path including leading / */
- path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1));
- curl_free(url_path);
-
- return path;
-}
static void *myrealloc(void *ptr, size_t len, void *pw)
{
@@ -1071,6 +1071,8 @@ static struct gui_fetch_table beos_fetch_table = {
filename_from_path,
path_add_part,
fetch_filetype,
+ path_to_url,
+ url_to_path,
gui_get_resource_url,
NULL //fetch_mimetype
};