summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-22 23:19:57 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-23 00:00:18 +0000
commit047569339406f2be1637ae4cee5dd0c9a9c2328f (patch)
tree3d3909b4bc3d27cd7a9e146d32539ce752b33310 /windows
parent4684e9665d2ddff50f4a8e9a16d73224d2617180 (diff)
downloadnetsurf-047569339406f2be1637ae4cee5dd0c9a9c2328f.tar.gz
netsurf-047569339406f2be1637ae4cee5dd0c9a9c2328f.tar.bz2
create table for fetcher operations and move all operations into it
Diffstat (limited to 'windows')
-rw-r--r--windows/filetype.c2
-rw-r--r--windows/filetype.h25
-rw-r--r--windows/gui.c15
-rw-r--r--windows/gui.h1
-rw-r--r--windows/main.c1
5 files changed, 42 insertions, 2 deletions
diff --git a/windows/filetype.c b/windows/filetype.c
index 7ad862b8b..5c6485659 100644
--- a/windows/filetype.c
+++ b/windows/filetype.c
@@ -22,6 +22,8 @@
#include "utils/log.h"
#include "utils/utils.h"
+#include "windows/filetype.h"
+
/**
* filetype -- determine the MIME type of a local file
*/
diff --git a/windows/filetype.h b/windows/filetype.h
new file mode 100644
index 000000000..e5017eaf4
--- /dev/null
+++ b/windows/filetype.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 Vincent Sanders <vince@netsurf-browser.org>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _NETSURF_WINDOWS_FILETYPE_H_
+#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 f476c5ae9..a6b2facaf 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -56,6 +56,7 @@
#include "windows/schedule.h"
#include "windows/findfile.h"
#include "windows/windbg.h"
+#include "windows/filetype.h"
HINSTANCE hInstance; /** win32 application instance handle. */
@@ -1868,6 +1869,7 @@ static struct gui_window_table window_table = {
struct gui_window_table *win32_window_table = &window_table;
+
static struct gui_clipboard_table clipboard_table = {
.get = gui_get_clipboard,
.set = gui_set_clipboard,
@@ -1875,10 +1877,19 @@ static struct gui_clipboard_table clipboard_table = {
struct gui_clipboard_table *win32_clipboard_table = &clipboard_table;
-static struct gui_browser_table browser_table = {
- .poll = gui_poll,
+
+static struct gui_fetch_table fetch_table = {
.filename_from_path = filename_from_path,
.path_add_part = path_add_part,
+ .filetype = fetch_filetype,
+
+ .mimetype = fetch_mimetype,
+};
+struct gui_fetch_table *win32_fetch_table = &fetch_table;
+
+
+static struct gui_browser_table browser_table = {
+ .poll = gui_poll,
};
struct gui_browser_table *win32_browser_table = &browser_table;
diff --git a/windows/gui.h b/windows/gui.h
index 3372dcc21..1ff849d73 100644
--- a/windows/gui.h
+++ b/windows/gui.h
@@ -26,6 +26,7 @@
extern struct gui_window_table *win32_window_table;
extern struct gui_clipboard_table *win32_clipboard_table;
+extern struct gui_fetch_table *win32_fetch_table;
extern struct gui_browser_table *win32_browser_table;
extern HINSTANCE hInstance;
diff --git a/windows/main.c b/windows/main.c
index 8dc9d45cb..ac5231e07 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -110,6 +110,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
.window = win32_window_table,
.clipboard = win32_clipboard_table,
.download = win32_download_table,
+ .fetch = win32_fetch_table,
};
win32_browser_table->get_resource_url = gui_get_resource_url;