summaryrefslogtreecommitdiff
path: root/desktop/gui.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-05-07 16:14:18 +0100
committerVincent Sanders <vince@kyllikki.org>2014-05-07 16:24:51 +0100
commitc56642819eed87431dff3446fe111f7f3eefaa7d (patch)
tree397126ca4baac425f9c1c44f3d5c56c681e2c4fe /desktop/gui.h
parentc1e2da80dfa62793ea107cf12408c814e268a54b (diff)
downloadnetsurf-c56642819eed87431dff3446fe111f7f3eefaa7d.tar.gz
netsurf-c56642819eed87431dff3446fe111f7f3eefaa7d.tar.bz2
add file operations table and make all frontends use it.
This rationalises the path construction and basename file operations. The default implementation is POSIX which works for all frontends except windows, riscos and amiga which have differeing path separators and rules. These implementations are significantly more robust than the previous nine implementations and also do not use unsafe strncpy or buffers with arbitrary length limits. These implementations also carry full documentation comments.
Diffstat (limited to 'desktop/gui.h')
-rw-r--r--desktop/gui.h33
1 files changed, 11 insertions, 22 deletions
diff --git a/desktop/gui.h b/desktop/gui.h
index 5f4ba1cdb..0d4135a93 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -68,6 +68,7 @@ struct ssl_cert_info;
struct hlcache_handle;
struct download_context;
struct nsurl;
+struct gui_file_table;
typedef struct nsnsclipboard_styles {
size_t start; /**< Start of run */
@@ -318,28 +319,6 @@ struct gui_fetch_table {
/* Mandantory entries */
/**
- * Return the filename part of a full path
- *
- * @note used in curl fetcher
- *
- * \param path full path and filename
- * \return filename (will be freed with free())
- */
- char *(*filename_from_path)(char *path);
-
- /**
- * Add a path component/filename to an existing path
- *
- * @note used in save complete and file fetcher
- *
- * \param path buffer containing path + free space
- * \param length length of buffer "path"
- * \param newpart string containing path component to add to path
- * \return true on success
- */
- bool (*path_add_part)(char *path, int length, const char *newpart);
-
- /**
* Determine the MIME type of a local file.
*
* @note used in file fetcher
@@ -398,6 +377,7 @@ struct gui_fetch_table {
};
+
/**
* User interface utf8 characterset conversion routines.
*/
@@ -568,6 +548,15 @@ struct gui_table {
struct gui_fetch_table *fetch;
/**
+ * File table
+ *
+ * Provides file and filename operations to the core. The
+ * table is optional and may be NULL in which case the default
+ * posix compliant operations will be used.
+ */
+ struct gui_file_table *file;
+
+ /**
* UTF8 table.
*
* Provides for conversion between the gui local character