Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:11

0001 #ifndef CURLINC_EASY_H
0002 #define CURLINC_EASY_H
0003 /***************************************************************************
0004  *                                  _   _ ____  _
0005  *  Project                     ___| | | |  _ \| |
0006  *                             / __| | | | |_) | |
0007  *                            | (__| |_| |  _ <| |___
0008  *                             \___|\___/|_| \_\_____|
0009  *
0010  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
0011  *
0012  * This software is licensed as described in the file COPYING, which
0013  * you should have received as part of this distribution. The terms
0014  * are also available at https://curl.se/docs/copyright.html.
0015  *
0016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
0017  * copies of the Software, and permit persons to whom the Software is
0018  * furnished to do so, under the terms of the COPYING file.
0019  *
0020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
0021  * KIND, either express or implied.
0022  *
0023  * SPDX-License-Identifier: curl
0024  *
0025  ***************************************************************************/
0026 #ifdef  __cplusplus
0027 extern "C" {
0028 #endif
0029 
0030 /* Flag bits in the curl_blob struct: */
0031 #define CURL_BLOB_COPY   1 /* tell libcurl to copy the data */
0032 #define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
0033 
0034 struct curl_blob {
0035   void *data;
0036   size_t len;
0037   unsigned int flags; /* bit 0 is defined, the rest are reserved and should be
0038                          left zeroes */
0039 };
0040 
0041 CURL_EXTERN CURL *curl_easy_init(void);
0042 CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
0043 CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
0044 CURL_EXTERN void curl_easy_cleanup(CURL *curl);
0045 
0046 /*
0047  * NAME curl_easy_getinfo()
0048  *
0049  * DESCRIPTION
0050  *
0051  * Request internal information from the curl session with this function.
0052  * The third argument MUST be pointing to the specific type of the used option
0053  * which is documented in each manpage of the option. The data pointed to
0054  * will be filled in accordingly and can be relied upon only if the function
0055  * returns CURLE_OK. This function is intended to get used *AFTER* a performed
0056  * transfer, all results from this function are undefined until the transfer
0057  * is completed.
0058  */
0059 CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
0060 
0061 
0062 /*
0063  * NAME curl_easy_duphandle()
0064  *
0065  * DESCRIPTION
0066  *
0067  * Creates a new curl session handle with the same options set for the handle
0068  * passed in. Duplicating a handle could only be a matter of cloning data and
0069  * options, internal state info and things like persistent connections cannot
0070  * be transferred. It is useful in multithreaded applications when you can run
0071  * curl_easy_duphandle() for each new thread to avoid a series of identical
0072  * curl_easy_setopt() invokes in every thread.
0073  */
0074 CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
0075 
0076 /*
0077  * NAME curl_easy_reset()
0078  *
0079  * DESCRIPTION
0080  *
0081  * Re-initializes a CURL handle to the default values. This puts back the
0082  * handle to the same state as it was in when it was just created.
0083  *
0084  * It does keep: live connections, the Session ID cache, the DNS cache and the
0085  * cookies.
0086  */
0087 CURL_EXTERN void curl_easy_reset(CURL *curl);
0088 
0089 /*
0090  * NAME curl_easy_recv()
0091  *
0092  * DESCRIPTION
0093  *
0094  * Receives data from the connected socket. Use after successful
0095  * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
0096  */
0097 CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
0098                                     size_t *n);
0099 
0100 /*
0101  * NAME curl_easy_send()
0102  *
0103  * DESCRIPTION
0104  *
0105  * Sends data over the connected socket. Use after successful
0106  * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
0107  */
0108 CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
0109                                     size_t buflen, size_t *n);
0110 
0111 
0112 /*
0113  * NAME curl_easy_upkeep()
0114  *
0115  * DESCRIPTION
0116  *
0117  * Performs connection upkeep for the given session handle.
0118  */
0119 CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
0120 
0121 #ifdef  __cplusplus
0122 } /* end of extern "C" */
0123 #endif
0124 
0125 #endif