Path: blob/master/cpp/linux/curl/easy.h
644 views
#ifndef __CURL_EASY_H1#define __CURL_EASY_H2/***************************************************************************3* _ _ ____ _4* Project ___| | | | _ \| |5* / __| | | | |_) | |6* | (__| |_| | _ <| |___7* \___|\___/|_| \_\_____|8*9* Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, et al.10*11* This software is licensed as described in the file COPYING, which12* you should have received as part of this distribution. The terms13* are also available at https://curl.haxx.se/docs/copyright.html.14*15* You may opt to use, copy, modify, merge, publish, distribute and/or sell16* copies of the Software, and permit persons to whom the Software is17* furnished to do so, under the terms of the COPYING file.18*19* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY20* KIND, either express or implied.21*22***************************************************************************/23#ifdef __cplusplus24extern "C" {25#endif2627CURL_EXTERN CURL *curl_easy_init(void);28CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);29CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);30CURL_EXTERN void curl_easy_cleanup(CURL *curl);3132/*33* NAME curl_easy_getinfo()34*35* DESCRIPTION36*37* Request internal information from the curl session with this function. The38* third argument MUST be a pointer to a long, a pointer to a char * or a39* pointer to a double (as the documentation describes elsewhere). The data40* pointed to will be filled in accordingly and can be relied upon only if the41* function returns CURLE_OK. This function is intended to get used *AFTER* a42* performed transfer, all results from this function are undefined until the43* transfer is completed.44*/45CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);464748/*49* NAME curl_easy_duphandle()50*51* DESCRIPTION52*53* Creates a new curl session handle with the same options set for the handle54* passed in. Duplicating a handle could only be a matter of cloning data and55* options, internal state info and things like persistent connections cannot56* be transferred. It is useful in multithreaded applications when you can run57* curl_easy_duphandle() for each new thread to avoid a series of identical58* curl_easy_setopt() invokes in every thread.59*/60CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);6162/*63* NAME curl_easy_reset()64*65* DESCRIPTION66*67* Re-initializes a CURL handle to the default values. This puts back the68* handle to the same state as it was in when it was just created.69*70* It does keep: live connections, the Session ID cache, the DNS cache and the71* cookies.72*/73CURL_EXTERN void curl_easy_reset(CURL *curl);7475/*76* NAME curl_easy_recv()77*78* DESCRIPTION79*80* Receives data from the connected socket. Use after successful81* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.82*/83CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,84size_t *n);8586/*87* NAME curl_easy_send()88*89* DESCRIPTION90*91* Sends data over the connected socket. Use after successful92* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.93*/94CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,95size_t buflen, size_t *n);969798/*99* NAME curl_easy_upkeep()100*101* DESCRIPTION102*103* Performs connection upkeep for the given session handle.104*/105CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);106107#ifdef __cplusplus108}109#endif110111#endif112113114