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