annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/curl/easy.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 #ifndef CURLINC_EASY_H
jpayne@69 2 #define CURLINC_EASY_H
jpayne@69 3 /***************************************************************************
jpayne@69 4 * _ _ ____ _
jpayne@69 5 * Project ___| | | | _ \| |
jpayne@69 6 * / __| | | | |_) | |
jpayne@69 7 * | (__| |_| | _ <| |___
jpayne@69 8 * \___|\___/|_| \_\_____|
jpayne@69 9 *
jpayne@69 10 * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
jpayne@69 11 *
jpayne@69 12 * This software is licensed as described in the file COPYING, which
jpayne@69 13 * you should have received as part of this distribution. The terms
jpayne@69 14 * are also available at https://curl.se/docs/copyright.html.
jpayne@69 15 *
jpayne@69 16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
jpayne@69 17 * copies of the Software, and permit persons to whom the Software is
jpayne@69 18 * furnished to do so, under the terms of the COPYING file.
jpayne@69 19 *
jpayne@69 20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
jpayne@69 21 * KIND, either express or implied.
jpayne@69 22 *
jpayne@69 23 * SPDX-License-Identifier: curl
jpayne@69 24 *
jpayne@69 25 ***************************************************************************/
jpayne@69 26 #ifdef __cplusplus
jpayne@69 27 extern "C" {
jpayne@69 28 #endif
jpayne@69 29
jpayne@69 30 /* Flag bits in the curl_blob struct: */
jpayne@69 31 #define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */
jpayne@69 32 #define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
jpayne@69 33
jpayne@69 34 struct curl_blob {
jpayne@69 35 void *data;
jpayne@69 36 size_t len;
jpayne@69 37 unsigned int flags; /* bit 0 is defined, the rest are reserved and should be
jpayne@69 38 left zeroes */
jpayne@69 39 };
jpayne@69 40
jpayne@69 41 CURL_EXTERN CURL *curl_easy_init(void);
jpayne@69 42 CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
jpayne@69 43 CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
jpayne@69 44 CURL_EXTERN void curl_easy_cleanup(CURL *curl);
jpayne@69 45
jpayne@69 46 /*
jpayne@69 47 * NAME curl_easy_getinfo()
jpayne@69 48 *
jpayne@69 49 * DESCRIPTION
jpayne@69 50 *
jpayne@69 51 * Request internal information from the curl session with this function. The
jpayne@69 52 * third argument MUST be a pointer to a long, a pointer to a char * or a
jpayne@69 53 * pointer to a double (as the documentation describes elsewhere). The data
jpayne@69 54 * pointed to will be filled in accordingly and can be relied upon only if the
jpayne@69 55 * function returns CURLE_OK. This function is intended to get used *AFTER* a
jpayne@69 56 * performed transfer, all results from this function are undefined until the
jpayne@69 57 * transfer is completed.
jpayne@69 58 */
jpayne@69 59 CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
jpayne@69 60
jpayne@69 61
jpayne@69 62 /*
jpayne@69 63 * NAME curl_easy_duphandle()
jpayne@69 64 *
jpayne@69 65 * DESCRIPTION
jpayne@69 66 *
jpayne@69 67 * Creates a new curl session handle with the same options set for the handle
jpayne@69 68 * passed in. Duplicating a handle could only be a matter of cloning data and
jpayne@69 69 * options, internal state info and things like persistent connections cannot
jpayne@69 70 * be transferred. It is useful in multithreaded applications when you can run
jpayne@69 71 * curl_easy_duphandle() for each new thread to avoid a series of identical
jpayne@69 72 * curl_easy_setopt() invokes in every thread.
jpayne@69 73 */
jpayne@69 74 CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
jpayne@69 75
jpayne@69 76 /*
jpayne@69 77 * NAME curl_easy_reset()
jpayne@69 78 *
jpayne@69 79 * DESCRIPTION
jpayne@69 80 *
jpayne@69 81 * Re-initializes a CURL handle to the default values. This puts back the
jpayne@69 82 * handle to the same state as it was in when it was just created.
jpayne@69 83 *
jpayne@69 84 * It does keep: live connections, the Session ID cache, the DNS cache and the
jpayne@69 85 * cookies.
jpayne@69 86 */
jpayne@69 87 CURL_EXTERN void curl_easy_reset(CURL *curl);
jpayne@69 88
jpayne@69 89 /*
jpayne@69 90 * NAME curl_easy_recv()
jpayne@69 91 *
jpayne@69 92 * DESCRIPTION
jpayne@69 93 *
jpayne@69 94 * Receives data from the connected socket. Use after successful
jpayne@69 95 * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
jpayne@69 96 */
jpayne@69 97 CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
jpayne@69 98 size_t *n);
jpayne@69 99
jpayne@69 100 /*
jpayne@69 101 * NAME curl_easy_send()
jpayne@69 102 *
jpayne@69 103 * DESCRIPTION
jpayne@69 104 *
jpayne@69 105 * Sends data over the connected socket. Use after successful
jpayne@69 106 * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
jpayne@69 107 */
jpayne@69 108 CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
jpayne@69 109 size_t buflen, size_t *n);
jpayne@69 110
jpayne@69 111
jpayne@69 112 /*
jpayne@69 113 * NAME curl_easy_upkeep()
jpayne@69 114 *
jpayne@69 115 * DESCRIPTION
jpayne@69 116 *
jpayne@69 117 * Performs connection upkeep for the given session handle.
jpayne@69 118 */
jpayne@69 119 CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
jpayne@69 120
jpayne@69 121 #ifdef __cplusplus
jpayne@69 122 } /* end of extern "C" */
jpayne@69 123 #endif
jpayne@69 124
jpayne@69 125 #endif