From 047569339406f2be1637ae4cee5dd0c9a9c2328f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 22 Jan 2014 23:19:57 +0000 Subject: create table for fetcher operations and move all operations into it --- atari/filetype.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 atari/filetype.h (limited to 'atari/filetype.h') diff --git a/atari/filetype.h b/atari/filetype.h new file mode 100644 index 000000000..54d915bf5 --- /dev/null +++ b/atari/filetype.h @@ -0,0 +1,2 @@ +char *fetch_mimetype(const char *ro_path); +const char *fetch_filetype(const char *unix_path); -- cgit v1.2.3 From 283cd05d0112b08753cb0b0c505a370ebccc52d1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 3 May 2014 17:29:59 +0100 Subject: Improve documentation on mimetype fetcher table --- atari/filetype.c | 6 ------ atari/filetype.h | 24 +++++++++++++++++++++++- atari/gui.c | 1 - desktop/gui.h | 3 ++- framebuffer/fetch.c | 7 ------- windows/filetype.c | 6 ------ windows/filetype.h | 1 - windows/gui.c | 2 -- 8 files changed, 25 insertions(+), 25 deletions(-) (limited to 'atari/filetype.h') diff --git a/atari/filetype.c b/atari/filetype.c index 9b73a0508..5e700a0c6 100755 --- a/atari/filetype.c +++ b/atari/filetype.c @@ -91,9 +91,3 @@ error: LOG(("mime type: %s", res )); return( res ); } - - -char *fetch_mimetype(const char *ro_path) -{ - return strdup("text/plain"); -} diff --git a/atari/filetype.h b/atari/filetype.h index 54d915bf5..97ba75b80 100644 --- a/atari/filetype.h +++ b/atari/filetype.h @@ -1,2 +1,24 @@ -char *fetch_mimetype(const char *ro_path); +/* + * Copyright 2010 Ole Loots + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NS_ATARI_FILETYPE_H_ +#define NS_ATARI_FILETYPE_H_ + const char *fetch_filetype(const char *unix_path); + +#endif diff --git a/atari/gui.c b/atari/gui.c index 4e077bdab..c275bfdc4 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -1078,7 +1078,6 @@ static struct gui_fetch_table atari_fetch_table = { .url_to_path = url_to_path, .get_resource_url = gui_get_resource_url, - .mimetype = fetch_mimetype, }; static struct gui_browser_table atari_browser_table = { diff --git a/desktop/gui.h b/desktop/gui.h index 317a73337..5f4ba1cdb 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -387,7 +387,8 @@ struct gui_fetch_table { /** * Find a MIME type for a local file * - * @note used in file fetcher + * @note only used in curl fetcher on RISC OS otherwise its a + * strdup of filetype. * * \param ro_path RISC OS style path to file on disk * \return MIME type string (on heap, caller should free), or NULL diff --git a/framebuffer/fetch.c b/framebuffer/fetch.c index 2942c2d48..c39ab5819 100644 --- a/framebuffer/fetch.c +++ b/framebuffer/fetch.c @@ -181,12 +181,6 @@ static const char *fetch_filetype(const char *unix_path) return "text/html"; } - -static char *fetch_mimetype(const char *ro_path) -{ - return strdup("text/plain"); -} - /* table for fetch operations */ static struct gui_fetch_table fetch_table = { .filename_from_path = filename_from_path, @@ -196,7 +190,6 @@ static struct gui_fetch_table fetch_table = { .url_to_path = url_to_path, .get_resource_url = get_resource_url, - .mimetype = fetch_mimetype, }; struct gui_fetch_table *framebuffer_fetch_table = &fetch_table; diff --git a/windows/filetype.c b/windows/filetype.c index 5c6485659..996e0755e 100644 --- a/windows/filetype.c +++ b/windows/filetype.c @@ -51,9 +51,3 @@ const char *fetch_filetype(const char *unix_path) return "image/x-ms-bmp"; return "text/html"; } - - -char *fetch_mimetype(const char *ro_path) -{ - return strdup("text/plain"); -} diff --git a/windows/filetype.h b/windows/filetype.h index e5017eaf4..084e97493 100644 --- a/windows/filetype.h +++ b/windows/filetype.h @@ -20,6 +20,5 @@ #define _NETSURF_WINDOWS_FILETYPE_H_ const char *fetch_filetype(const char *unix_path); -char *fetch_mimetype(const char *ro_path); #endif diff --git a/windows/gui.c b/windows/gui.c index 8270c13ff..0af54ee62 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -1881,8 +1881,6 @@ static struct gui_fetch_table fetch_table = { .filetype = fetch_filetype, .path_to_url = path_to_url, .url_to_path = url_to_path, - - .mimetype = fetch_mimetype, }; struct gui_fetch_table *win32_fetch_table = &fetch_table; -- cgit v1.2.3