mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Modified to use Curl_* functions instead of curl_* ones
This commit is contained in:
parent
8ccd8b6dbc
commit
9cf4434ae2
19
lib/easy.c
19
lib/easy.c
@ -83,15 +83,11 @@ CURL *curl_easy_init(void)
|
|||||||
CURLcode res;
|
CURLcode res;
|
||||||
struct UrlData *data;
|
struct UrlData *data;
|
||||||
|
|
||||||
if(curl_init())
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* We use curl_open() with undefined URL so far */
|
/* We use curl_open() with undefined URL so far */
|
||||||
res = curl_open((CURL **)&data, NULL);
|
res = Curl_open((CURL **)&data, NULL);
|
||||||
if(res != CURLE_OK)
|
if(res != CURLE_OK)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
data->interf = CURLI_EASY; /* mark it as an easy one */
|
|
||||||
/* SAC */
|
/* SAC */
|
||||||
data->device = NULL;
|
data->device = NULL;
|
||||||
|
|
||||||
@ -119,16 +115,16 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
|
|||||||
if(tag < CURLOPTTYPE_OBJECTPOINT) {
|
if(tag < CURLOPTTYPE_OBJECTPOINT) {
|
||||||
/* This is a LONG type */
|
/* This is a LONG type */
|
||||||
param_long = va_arg(arg, long);
|
param_long = va_arg(arg, long);
|
||||||
curl_setopt(data, tag, param_long);
|
Curl_setopt(data, tag, param_long);
|
||||||
}
|
}
|
||||||
else if(tag < CURLOPTTYPE_FUNCTIONPOINT) {
|
else if(tag < CURLOPTTYPE_FUNCTIONPOINT) {
|
||||||
/* This is a object pointer type */
|
/* This is a object pointer type */
|
||||||
param_obj = va_arg(arg, void *);
|
param_obj = va_arg(arg, void *);
|
||||||
curl_setopt(data, tag, param_obj);
|
Curl_setopt(data, tag, param_obj);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
param_func = va_arg(arg, func_T );
|
param_func = va_arg(arg, func_T );
|
||||||
curl_setopt(data, tag, param_func);
|
Curl_setopt(data, tag, param_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
@ -137,13 +133,12 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
|
|||||||
|
|
||||||
CURLcode curl_easy_perform(CURL *curl)
|
CURLcode curl_easy_perform(CURL *curl)
|
||||||
{
|
{
|
||||||
return curl_transfer(curl);
|
return Curl_perform(curl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void curl_easy_cleanup(CURL *curl)
|
void curl_easy_cleanup(CURL *curl)
|
||||||
{
|
{
|
||||||
curl_close(curl);
|
Curl_close(curl);
|
||||||
curl_free();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
|
CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
|
||||||
@ -153,5 +148,5 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
|
|||||||
va_start(arg, info);
|
va_start(arg, info);
|
||||||
paramp = va_arg(arg, void *);
|
paramp = va_arg(arg, void *);
|
||||||
|
|
||||||
return curl_getinfo(curl, info, paramp);
|
return Curl_getinfo(curl, info, paramp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user