sandboxed-api/oss-internship-2020/curl/curl_wrapper/curl_wrapper.h

83 lines
3.5 KiB
C
Raw Normal View History

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-09-16 23:51:34 +08:00
extern "C" {
2020-08-13 00:33:45 +08:00
// The wrapper method is needed to make the variadic argument explicit
2020-09-16 23:51:34 +08:00
CURLcode curl_easy_setopt_ptr(CURL* handle, CURLoption option, 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-09-16 23:51:34 +08:00
CURLcode curl_easy_setopt_long(CURL* handle, CURLoption option, 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-09-16 23:51:34 +08:00
CURLcode curl_easy_setopt_curl_off_t(CURL* handle, CURLoption option,
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-09-16 23:51:34 +08:00
CURLcode curl_easy_getinfo_ptr(CURL* handle, CURLINFO option, 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
2020-09-16 23:51:34 +08:00
typedef time_t time_t_sapi;
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
2020-09-16 23:51:34 +08:00
typedef fd_set fd_set_sapi;
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-09-16 23:51:34 +08:00
CURLMcode curl_multi_setopt_ptr(CURLM* handle, CURLMoption option,
void* parameter);
2020-08-13 00:33:45 +08:00
// The wrapper method is needed to make the variadic argument explicit
2020-09-16 23:51:34 +08:00
CURLMcode curl_multi_setopt_long(CURLM* handle, CURLMoption option,
long parameter);
2020-08-13 00:33:45 +08:00
// The wrapper method is needed to make the variadic argument explicit
2020-09-16 23:51:34 +08:00
CURLMcode curl_multi_setopt_curl_off_t(CURLM* handle, CURLMoption option,
curl_off_t parameter);
2020-08-13 00:33:45 +08:00
// The wrapper method is needed because incomplete array type is not supported
2020-09-16 23:51:34 +08:00
CURLMcode curl_multi_poll_sapi(CURLM* multi_handle,
struct curl_waitfd* extra_fds,
unsigned int extra_nfds, 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-09-16 23:51:34 +08:00
CURLMcode curl_multi_wait_sapi(CURLM* multi_handle,
struct curl_waitfd* extra_fds,
unsigned int extra_nfds, 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-09-16 23:51:34 +08:00
CURLSHcode curl_share_setopt_ptr(CURLSH* handle, CURLSHoption option,
void* parameter);
2020-08-13 00:33:45 +08:00
// The wrapper method is needed to make the variadic argument explicit
2020-09-16 23:51:34 +08:00
CURLSHcode curl_share_setopt_long(CURLSH* handle, CURLSHoption option,
long parameter);
}
2020-08-13 00:33:45 +08:00
2020-08-18 18:44:53 +08:00
#endif // CURL_WRAPPER_H