diff --git a/legacy/ecore/AUTHORS b/legacy/ecore/AUTHORS index 7070a97090..1ce2b42f36 100644 --- a/legacy/ecore/AUTHORS +++ b/legacy/ecore/AUTHORS @@ -14,3 +14,4 @@ Kim Woelders Sebastian Dransfeld Simon Poole Jorge Luis Zapata Muga +dan sinclair diff --git a/legacy/ecore/src/lib/ecore_file/Ecore_File.h b/legacy/ecore/src/lib/ecore_file/Ecore_File.h index 925b3b6257..541d51a2b6 100644 --- a/legacy/ecore/src/lib/ecore_file/Ecore_File.h +++ b/legacy/ecore/src/lib/ecore_file/Ecore_File.h @@ -83,6 +83,7 @@ extern "C" { const char *file, int status), void *data); + EAPI int ecore_file_download_protocol_available(const char *protocol); #ifdef __cplusplus } diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_download.c b/legacy/ecore/src/lib/ecore_file/ecore_file_download.c index 74f72decee..500a05121f 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_download.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_download.c @@ -97,7 +97,7 @@ ecore_file_download(const char *url, const char *dst, } #ifdef HAVE_CURL else if ((!strncmp(url, "http://", 7)) || - (!strncmp(url, "ftp://", 7))) + (!strncmp(url, "ftp://", 6))) { /* download */ Ecore_File_Download_Job *job; @@ -115,6 +115,18 @@ ecore_file_download(const char *url, const char *dst, } } +int +ecore_file_download_protocol_available(const char *protocol) +{ + if (!strncmp(protocol, "file://", 7)) return 1; +#ifdef HAVE_CURL + else if (!strncmp(protocol, "http://", 7)) return 1; + else if (!strncmp(protocol, "ftp://", 6)) return 1; +#endif + + return 0; +} + #ifdef HAVE_CURL /* * FIXME: Use