summaryrefslogtreecommitdiff
path: root/framebuffer
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 /framebuffer
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 'framebuffer')
-rw-r--r--framebuffer/fetch.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/framebuffer/fetch.c b/framebuffer/fetch.c
index 2e304c222..0c9b90f7c 100644
--- a/framebuffer/fetch.c
+++ b/framebuffer/fetch.c
@@ -68,7 +68,13 @@ static bool path_add_part(char *path, int length, const char *newpart)
return true;
}
-char *path_to_url(const char *path)
+/**
+ * Convert a pathname to a file: URL.
+ *
+ * \param path pathname
+ * \return URL, allocated on heap, or NULL on failure
+ */
+static char *path_to_url(const char *path)
{
int urllen;
char *url;
@@ -88,8 +94,13 @@ char *path_to_url(const char *path)
return url;
}
-
-char *url_to_path(const char *url)
+/**
+ * Convert a file: URL to a pathname.
+ *
+ * \param url a file: URL
+ * \return pathname, allocated on heap, or NULL on failure
+ */
+static char *url_to_path(const char *url)
{
char *path;
char *respath;
@@ -178,6 +189,8 @@ static struct gui_fetch_table fetch_table = {
.filename_from_path = filename_from_path,
.path_add_part = path_add_part,
.filetype = fetch_filetype,
+ .path_to_url = path_to_url,
+ .url_to_path = url_to_path,
.get_resource_url = get_resource_url,
.mimetype = fetch_mimetype,