diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-01-16 00:01:25 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-01-16 00:01:25 +0000 |
commit | 38cb39339a8f1f9a0afb69340a404fd767db5a79 (patch) | |
tree | 0b5ed63f639e8d8e66011a425ee595545b74300d /atari | |
parent | bd065d4a434755e67642a071e255cba596de8d1e (diff) | |
download | netsurf-38cb39339a8f1f9a0afb69340a404fd767db5a79.tar.gz netsurf-38cb39339a8f1f9a0afb69340a404fd767db5a79.tar.bz2 |
move filename_from_path and path_add_part into gui operation tables
Diffstat (limited to 'atari')
-rw-r--r-- | atari/gui.c | 23 | ||||
-rwxr-xr-x | atari/misc.c | 22 | ||||
-rwxr-xr-x | atari/misc.h | 2 |
3 files changed, 25 insertions, 22 deletions
diff --git a/atari/gui.c b/atari/gui.c index 49e3046e2..55a23a84a 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -115,6 +115,27 @@ short aes_msg_out[8]; bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy); +/** + * Return the filename part of a full path + * + * \param path full path and filename + * \return filename (will be freed with free()) + */ +static char *filename_from_path(char *path) +{ + char *leafname; + + leafname = strrchr(path, '\\'); + if( !leafname ) + leafname = strrchr(path, '/'); + if (!leafname) + leafname = path; + else + leafname += 1; + + return strdup(leafname); +} + static void gui_poll(bool active) { @@ -1055,6 +1076,8 @@ static struct gui_browser_table atari_browser_table = { .quit = gui_quit, .get_resource_url = gui_get_resource_url, .cert_verify = gui_cert_verify, + .filename_from_path = filename_from_path, + .path_add_part = path_add_part, }; /* #define WITH_DBG_LOGFILE 1 */ diff --git a/atari/misc.c b/atari/misc.c index d330859b9..ca9e993d9 100755 --- a/atari/misc.c +++ b/atari/misc.c @@ -71,28 +71,6 @@ void die(const char *error) }
/**
- * Return the filename part of a full path
- *
- * \param path full path and filename
- * \return filename (will be freed with free())
- */
-
-char *filename_from_path(char *path)
-{
- char *leafname;
-
- leafname = strrchr(path, '\\');
- if( !leafname )
- leafname = strrchr(path, '/');
- if (!leafname)
- leafname = path;
- else
- leafname += 1;
-
- return strdup(leafname);
-}
-
-/**
* Add a path component/filename to an existing path
*
* \param path buffer containing path + free space
diff --git a/atari/misc.h b/atari/misc.h index 8d1719ce8..1bb5e8131 100755 --- a/atari/misc.h +++ b/atari/misc.h @@ -66,4 +66,6 @@ const char * file_select(const char * title, const char * name); */ long nkc_to_input_key(short nkc, long * ucs4_out); +bool path_add_part(char *path, int length, const char *newpart); + #endif |