#ifndef CURLINC_EASY_H1#define CURLINC_EASY_H2/***************************************************************************3* _ _ ____ _4* Project ___| | | | _ \| |5* / __| | | | |_) | |6* | (__| |_| | _ <| |___7* \___|\___/|_| \_\_____|8*9* Copyright (C) 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.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* SPDX-License-Identifier: curl23*24***************************************************************************/25#ifdef __cplusplus26extern "C" {27#endif2829/* Flag bits in the curl_blob struct: */30#define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */31#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */3233struct curl_blob {34void *data;35size_t len;36unsigned int flags; /* bit 0 is defined, the rest are reserved and should be37left zeroes */38};3940CURL_EXTERN CURL *curl_easy_init(void);41CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);42CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);43CURL_EXTERN void curl_easy_cleanup(CURL *curl);4445/*46* NAME curl_easy_getinfo()47*48* DESCRIPTION49*50* Request internal information from the curl session with this function.51* The third argument MUST be pointing to the specific type of the used option52* which is documented in each man page of the option. The data pointed to53* will be filled in accordingly and can be relied upon only if the function54* returns CURLE_OK. This function is intended to get used *AFTER* a performed55* transfer, all results from this function are undefined until the transfer56* is completed.57*/58CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);5960/*61* NAME curl_easy_duphandle()62*63* DESCRIPTION64*65* Creates a new curl session handle with the same options set for the handle66* passed in. Duplicating a handle could only be a matter of cloning data and67* options, internal state info and things like persistent connections cannot68* be transferred. It is useful in multi-threaded applications when you can run69* curl_easy_duphandle() for each new thread to avoid a series of identical70* curl_easy_setopt() invokes in every thread.71*/72CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);7374/*75* NAME curl_easy_reset()76*77* DESCRIPTION78*79* Re-initializes a curl handle to the default values. This puts back the80* handle to the same state as it was in when it was just created.81*82* It does keep: live connections, the Session ID cache, the DNS cache and the83* cookies.84*/85CURL_EXTERN void curl_easy_reset(CURL *curl);8687/*88* NAME curl_easy_recv()89*90* DESCRIPTION91*92* Receives data from the connected socket. Use after successful93* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.94*/95CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,96size_t *n);9798/*99* NAME curl_easy_send()100*101* DESCRIPTION102*103* Sends data over the connected socket. Use after successful104* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.105*/106CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,107size_t buflen, size_t *n);108109/*110* NAME curl_easy_upkeep()111*112* DESCRIPTION113*114* Performs connection upkeep for the given session handle.115*/116CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);117118#ifdef __cplusplus119} /* end of extern "C" */120#endif121122#endif123124125