2020-08-05 18:54:31 +08:00
|
|
|
// Copyright 2020 Google LLC
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2020-08-13 00:33:45 +08:00
|
|
|
// Wrapper for curl library
|
2020-08-05 18:54:31 +08:00
|
|
|
|
2020-08-18 18:44:53 +08:00
|
|
|
#ifndef CURL_WRAPPER_H
|
|
|
|
#define CURL_WRAPPER_H
|
2020-08-05 18:54:31 +08:00
|
|
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
2020-08-13 00:33:45 +08:00
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLcode curl_easy_setopt_ptr(CURL* handle, CURLoption option,
|
2020-08-07 18:14:48 +08:00
|
|
|
void* parameter);
|
2020-08-05 18:54:31 +08:00
|
|
|
|
2020-08-13 00:33:45 +08:00
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLcode curl_easy_setopt_long(CURL* handle, CURLoption option,
|
2020-08-07 18:14:48 +08:00
|
|
|
long parameter);
|
2020-08-05 18:54:31 +08:00
|
|
|
|
2020-08-13 00:33:45 +08:00
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-07 22:21:00 +08:00
|
|
|
extern "C" CURLcode curl_easy_setopt_curl_off_t(CURL* handle, CURLoption option,
|
2020-08-07 18:14:48 +08:00
|
|
|
curl_off_t parameter);
|
2020-08-05 18:54:31 +08:00
|
|
|
|
2020-08-13 00:33:45 +08:00
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLcode curl_easy_getinfo_ptr(CURL* handle, CURLINFO option,
|
2020-08-07 18:14:48 +08:00
|
|
|
void* parameter);
|
2020-08-05 18:54:31 +08:00
|
|
|
|
2020-08-13 00:33:45 +08:00
|
|
|
// The typedef and wrapper method are needed because the original method has
|
|
|
|
// some conflicts in curl_sapi.sapi.h
|
|
|
|
extern "C" typedef time_t time_t_sapi;
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" time_t_sapi curl_getdate_sapi(char* datestring, time_t_sapi* now);
|
2020-08-13 00:33:45 +08:00
|
|
|
|
|
|
|
// The typedef and wrapper method are needed because the original method has
|
|
|
|
// some conflicts in curl_sapi.sapi.h
|
|
|
|
extern "C" typedef fd_set fd_set_sapi;
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLMcode curl_multi_fdset_sapi(CURLM* multi_handle,
|
|
|
|
fd_set_sapi* read_fd_set,
|
|
|
|
fd_set_sapi* write_fd_set,
|
|
|
|
fd_set_sapi* exc_fd_set,
|
|
|
|
int* max_fd);
|
2020-08-13 00:33:45 +08:00
|
|
|
|
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLMcode curl_multi_setopt_ptr(CURLM* handle, CURLMoption option,
|
2020-08-13 00:33:45 +08:00
|
|
|
void* parameter);
|
|
|
|
|
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLMcode curl_multi_setopt_long(CURLM* handle, CURLMoption option,
|
2020-08-13 00:33:45 +08:00
|
|
|
long parameter);
|
|
|
|
|
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLMcode curl_multi_setopt_curl_off_t(CURLM* handle,
|
2020-08-13 00:33:45 +08:00
|
|
|
CURLMoption option,
|
|
|
|
curl_off_t parameter);
|
|
|
|
|
|
|
|
// The wrapper method is needed because incomplete array type is not supported
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLMcode curl_multi_poll_sapi(CURLM* multi_handle,
|
2020-08-13 00:33:45 +08:00
|
|
|
struct curl_waitfd* extra_fds,
|
|
|
|
unsigned int extra_nfds,
|
2020-08-18 18:44:53 +08:00
|
|
|
int timeout_ms, int* numfds);
|
2020-08-13 00:33:45 +08:00
|
|
|
|
|
|
|
// The wrapper method is needed because incomplete array type is not supported
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLMcode curl_multi_wait_sapi(CURLM* multi_handle,
|
2020-08-13 00:33:45 +08:00
|
|
|
struct curl_waitfd* extra_fds,
|
|
|
|
unsigned int extra_nfds,
|
2020-08-18 18:44:53 +08:00
|
|
|
int timeout_ms, int* numfds);
|
2020-08-13 00:33:45 +08:00
|
|
|
|
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLSHcode curl_share_setopt_ptr(CURLSH* handle, CURLSHoption option,
|
2020-08-13 00:33:45 +08:00
|
|
|
void* parameter);
|
|
|
|
|
|
|
|
// The wrapper method is needed to make the variadic argument explicit
|
2020-08-18 18:44:53 +08:00
|
|
|
extern "C" CURLSHcode curl_share_setopt_long(CURLSH* handle,
|
|
|
|
CURLSHoption option,
|
2020-08-13 00:33:45 +08:00
|
|
|
long parameter);
|
|
|
|
|
2020-08-18 18:44:53 +08:00
|
|
|
#endif // CURL_WRAPPER_H
|