aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorIlya Zhuravlev <zhuravlevilya@ya.ru>2012-12-14 15:30:17 +0400
committerIlya Zhuravlev <zhuravlevilya@ya.ru>2012-12-16 15:20:18 +0400
commit3578e1d4a711a32e2e768dcc6ff207ffc1bccbad (patch)
tree9215740fb64bbb89ce9b9ba89f8ebf0db709ee35 /src/util
parentaa46e5c5e7285a8ac5c9e096a55c3fa02b90280e (diff)
downloadminetest-3578e1d4a711a32e2e768dcc6ff207ffc1bccbad.tar.gz
minetest-3578e1d4a711a32e2e768dcc6ff207ffc1bccbad.tar.bz2
minetest-3578e1d4a711a32e2e768dcc6ff207ffc1bccbad.zip
Added ability to fetch media from remote server (using cURL library)
Diffstat (limited to 'src/util')
-rw-r--r--src/util/string.cpp6
-rw-r--r--src/util/string.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/util/string.cpp b/src/util/string.cpp
index fb39a24c3..215ac299d 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -41,3 +41,9 @@ std::string translatePassword(std::string playername, std::wstring password)
return pwd;
}
+size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata) {
+ std::ostringstream *stream = (std::ostringstream*)userdata;
+ size_t count = size * nmemb;
+ stream->write(ptr, count);
+ return count;
+}
diff --git a/src/util/string.h b/src/util/string.h
index 71b11de3d..58274c677 100644
--- a/src/util/string.h
+++ b/src/util/string.h
@@ -282,6 +282,7 @@ inline std::string wrap_rows(const std::string &from, u32 rowlen)
}
std::string translatePassword(std::string playername, std::wstring password);
+size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata);
#endif