diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-05-08 00:16:50 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-05-08 00:16:50 +0100 |
commit | 096bd47ab0018e7b9c3affd58b6134463e2aaa65 (patch) | |
tree | b3975e107568ee9d005e19a5f998c29c55ef1e2f /riscos | |
parent | 781d42e33c6cc7d1660eb535c45f70a88b71579e (diff) | |
download | netsurf-096bd47ab0018e7b9c3affd58b6134463e2aaa65.tar.gz netsurf-096bd47ab0018e7b9c3affd58b6134463e2aaa65.tar.bz2 |
refactor url utility functions to use standard nserror codes and have appropriate documentation.
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/download.c | 10 | ||||
-rw-r--r-- | riscos/gui.c | 10 | ||||
-rw-r--r-- | riscos/save.c | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/riscos/download.c b/riscos/download.c index 6cba17ef0..05a2e9ec9 100644 --- a/riscos/download.c +++ b/riscos/download.c @@ -230,7 +230,7 @@ static struct gui_download_window *gui_download_window_create(download_context * struct gui_download_window *dw; bool space_warning = false; os_error *error; - url_func_result res; + nserror res; char *local_path; nserror err; size_t i, last_dot; @@ -260,22 +260,22 @@ static struct gui_download_window *gui_download_window_create(download_context * /* Get scheme from URL */ res = url_scheme(url, &scheme); - if (res == URL_FUNC_NOMEM) { + if (res == NSERROR_NOMEM) { warn_user("NoMemory", 0); free(dw); return 0; - } else if (res == URL_FUNC_OK) { + } else if (res == NSERROR_OK) { /* If we have a scheme and it's "file", then * attempt to use the local filetype directly */ if (strcasecmp(scheme, "file") == 0) { char *path = NULL; res = url_path(url, &path); - if (res == URL_FUNC_NOMEM) { + if (res == NSERROR_NOMEM) { warn_user("NoMemory", 0); free(scheme); free(dw); return 0; - } else if (res == URL_FUNC_OK) { + } else if (res == NSERROR_OK) { char *raw_path = curl_unescape(path, strlen(path)); if (raw_path == NULL) { diff --git a/riscos/gui.c b/riscos/gui.c index 6447e4d90..7a505cb5a 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -736,7 +736,7 @@ static char *path_to_url(const char *path) char *unix_path; /* unix path */ char *escurl; os_error *error; - url_func_result url_err; + nserror url_err; int urllen; char *url; /* resulting url */ @@ -795,7 +795,7 @@ static char *path_to_url(const char *path) /* We don't want '/' to be escaped. */ url_err = url_escape(url, FILE_SCHEME_PREFIX_LEN, false, "/", &escurl); free(url); url = NULL; - if (url_err != URL_FUNC_OK) { + if (url_err != NSERROR_OK) { LOG(("url_escape failed: %s", url)); return NULL; } @@ -816,18 +816,18 @@ char *url_to_path(const char *url) char *path; char *filename; char *respath; - url_func_result res; /* result from url routines */ + nserror res; /* result from url routines */ char *r; res = url_path(url, &path); - if (res != URL_FUNC_OK) { + if (res != NSERROR_OK) { warn_user("NoMemory", 0); return NULL; } res = url_unescape(path, &respath); free(path); - if (res != URL_FUNC_OK) { + if (res != NSERROR_OK) { return NULL; } diff --git a/riscos/save.c b/riscos/save.c index fa638d37d..749cc5991 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -1251,7 +1251,7 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type, /* leafname */ if (url && url_nice(url, &nice, nsoption_bool(strip_extensions)) == - URL_FUNC_OK) { + NSERROR_OK) { for (i = 0; nice[i]; i++) { if (nice[i] == '.') nice[i] = '/'; |