\brief Initialize CURL library (call this once at program startup) \return true if the CURL library is initialized, false otherwise
| 298 | /// \brief Initialize CURL library (call this once at program startup) |
| 299 | /// \return true if the CURL library is initialized, false otherwise |
| 300 | bool init_curl() { |
| 301 | CURLcode res = curl_global_init(CURL_GLOBAL_DEFAULT); |
| 302 | if (res != CURLE_OK) { |
| 303 | std::cerr << "Failed to initialize CURL library: " << curl_easy_strerror(res) << std::endl; |
| 304 | return false; |
| 305 | } |
| 306 | return true; |
| 307 | } |
| 308 | |
| 309 | /// \brief Cleanup CURL library (call this once at program shutdown) |
| 310 | void cleanup_curl() { |