Planeshift
|
00001 #ifndef __CURL_EASY_H 00002 #define __CURL_EASY_H 00003 /*************************************************************************** 00004 * _ _ ____ _ 00005 * Project ___| | | | _ \| | 00006 * / __| | | | |_) | | 00007 * | (__| |_| | _ <| |___ 00008 * \___|\___/|_| \_\_____| 00009 * 00010 * Copyright (C) 1998 - 2008, Daniel Stenberg, <[email protected]>, et al. 00011 * 00012 * This software is licensed as described in the file COPYING, which 00013 * you should have received as part of this distribution. The terms 00014 * are also available at http://curl.haxx.se/docs/copyright.html. 00015 * 00016 * You may opt to use, copy, modify, merge, publish, distribute and/or sell 00017 * copies of the Software, and permit persons to whom the Software is 00018 * furnished to do so, under the terms of the COPYING file. 00019 * 00020 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 00021 * KIND, either express or implied. 00022 * 00023 * $Id: easy.h 8795 2013-09-14 06:15:05Z joelyon $ 00024 ***************************************************************************/ 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 CURL_EXTERN CURL *curl_easy_init(void); 00030 CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); 00031 CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); 00032 CURL_EXTERN void curl_easy_cleanup(CURL *curl); 00033 00034 /* 00035 * NAME curl_easy_getinfo() 00036 * 00037 * DESCRIPTION 00038 * 00039 * Request internal information from the curl session with this function. The 00040 * third argument MUST be a pointer to a long, a pointer to a char * or a 00041 * pointer to a double (as the documentation describes elsewhere). The data 00042 * pointed to will be filled in accordingly and can be relied upon only if the 00043 * function returns CURLE_OK. This function is intended to get used *AFTER* a 00044 * performed transfer, all results from this function are undefined until the 00045 * transfer is completed. 00046 */ 00047 CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); 00048 00049 00050 /* 00051 * NAME curl_easy_duphandle() 00052 * 00053 * DESCRIPTION 00054 * 00055 * Creates a new curl session handle with the same options set for the handle 00056 * passed in. Duplicating a handle could only be a matter of cloning data and 00057 * options, internal state info and things like persistant connections cannot 00058 * be transfered. It is useful in multithreaded applications when you can run 00059 * curl_easy_duphandle() for each new thread to avoid a series of identical 00060 * curl_easy_setopt() invokes in every thread. 00061 */ 00062 CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); 00063 00064 /* 00065 * NAME curl_easy_reset() 00066 * 00067 * DESCRIPTION 00068 * 00069 * Re-initializes a CURL handle to the default values. This puts back the 00070 * handle to the same state as it was in when it was just created. 00071 * 00072 * It does keep: live connections, the Session ID cache, the DNS cache and the 00073 * cookies. 00074 */ 00075 CURL_EXTERN void curl_easy_reset(CURL *curl); 00076 00077 /* 00078 * NAME curl_easy_recv() 00079 * 00080 * DESCRIPTION 00081 * 00082 * Receives data from the connected socket. Use after successful 00083 * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 00084 */ 00085 CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, 00086 size_t *n); 00087 00088 /* 00089 * NAME curl_easy_send() 00090 * 00091 * DESCRIPTION 00092 * 00093 * Sends data over the connected socket. Use after successful 00094 * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 00095 */ 00096 CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, 00097 size_t buflen, size_t *n); 00098 00099 #ifdef __cplusplus 00100 } 00101 #endif 00102 00103 #endif