Loading docs/libcurl/libcurl-tutorial.3 +5 −9 Original line number Diff line number Diff line Loading @@ -571,14 +571,13 @@ CURLOPT_PROGRESSDATA. libcurl won't touch it. There's basically only one thing to keep in mind when using C++ instead of C when interfacing libcurl: "The Callbacks Must Be Plain C" The callbacks CANNOT be non-static class member functions So if you want a write callback set in libcurl, you should put it within \&'extern'. Similar to this: Example C++ code: .nf extern "C" { size_t write_data(void *ptr, size_t size, size_t nmemb, class AClass { static size_t write_data(void *ptr, size_t size, size_t nmemb, void *ourpointer) { /* do what you want with the data */ Loading @@ -586,9 +585,6 @@ So if you want a write callback set in libcurl, you should put it within } .fi This will of course effectively turn the callback code into C. There won't be any "this" pointer available etc. .SH "Proxies" What "proxy" means according to Merriam-Webster: "a person authorized to act Loading Loading
docs/libcurl/libcurl-tutorial.3 +5 −9 Original line number Diff line number Diff line Loading @@ -571,14 +571,13 @@ CURLOPT_PROGRESSDATA. libcurl won't touch it. There's basically only one thing to keep in mind when using C++ instead of C when interfacing libcurl: "The Callbacks Must Be Plain C" The callbacks CANNOT be non-static class member functions So if you want a write callback set in libcurl, you should put it within \&'extern'. Similar to this: Example C++ code: .nf extern "C" { size_t write_data(void *ptr, size_t size, size_t nmemb, class AClass { static size_t write_data(void *ptr, size_t size, size_t nmemb, void *ourpointer) { /* do what you want with the data */ Loading @@ -586,9 +585,6 @@ So if you want a write callback set in libcurl, you should put it within } .fi This will of course effectively turn the callback code into C. There won't be any "this" pointer available etc. .SH "Proxies" What "proxy" means according to Merriam-Webster: "a person authorized to act Loading