#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 manpage 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, ...);596061/*62* NAME curl_easy_duphandle()63*64* DESCRIPTION65*66* Creates a new curl session handle with the same options set for the handle67* passed in. Duplicating a handle could only be a matter of cloning data and68* options, internal state info and things like persistent connections cannot69* be transferred. It is useful in multithreaded applications when you can run70* curl_easy_duphandle() for each new thread to avoid a series of identical71* curl_easy_setopt() invokes in every thread.72*/73CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);7475/*76* NAME curl_easy_reset()77*78* DESCRIPTION79*80* Re-initializes a curl handle to the default values. This puts back the81* handle to the same state as it was in when it was just created.82*83* It does keep: live connections, the Session ID cache, the DNS cache and the84* cookies.85*/86CURL_EXTERN void curl_easy_reset(CURL *curl);8788/*89* NAME curl_easy_recv()90*91* DESCRIPTION92*93* Receives data from the connected socket. Use after successful94* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.95*/96CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,97size_t *n);9899/*100* NAME curl_easy_send()101*102* DESCRIPTION103*104* Sends data over the connected socket. Use after successful105* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.106*/107CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,108size_t buflen, size_t *n);109110111/*112* NAME curl_easy_upkeep()113*114* DESCRIPTION115*116* Performs connection upkeep for the given session handle.117*/118CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);119120#ifdef __cplusplus121} /* end of extern "C" */122#endif123124#endif125126127