michael@0: #ifndef __CURL_EASY_H michael@0: #define __CURL_EASY_H michael@0: /*************************************************************************** michael@0: * _ _ ____ _ michael@0: * Project ___| | | | _ \| | michael@0: * / __| | | | |_) | | michael@0: * | (__| |_| | _ <| |___ michael@0: * \___|\___/|_| \_\_____| michael@0: * michael@0: * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. michael@0: * michael@0: * This software is licensed as described in the file COPYING, which michael@0: * you should have received as part of this distribution. The terms michael@0: * are also available at http://curl.haxx.se/docs/copyright.html. michael@0: * michael@0: * You may opt to use, copy, modify, merge, publish, distribute and/or sell michael@0: * copies of the Software, and permit persons to whom the Software is michael@0: * furnished to do so, under the terms of the COPYING file. michael@0: * michael@0: * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY michael@0: * KIND, either express or implied. michael@0: * michael@0: * $Id: easy.h,v 1.14 2008-05-12 21:43:28 bagder Exp $ michael@0: ***************************************************************************/ michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: CURL_EXTERN CURL *curl_easy_init(void); michael@0: CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); michael@0: CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); michael@0: CURL_EXTERN void curl_easy_cleanup(CURL *curl); michael@0: michael@0: /* michael@0: * NAME curl_easy_getinfo() michael@0: * michael@0: * DESCRIPTION michael@0: * michael@0: * Request internal information from the curl session with this function. The michael@0: * third argument MUST be a pointer to a long, a pointer to a char * or a michael@0: * pointer to a double (as the documentation describes elsewhere). The data michael@0: * pointed to will be filled in accordingly and can be relied upon only if the michael@0: * function returns CURLE_OK. This function is intended to get used *AFTER* a michael@0: * performed transfer, all results from this function are undefined until the michael@0: * transfer is completed. michael@0: */ michael@0: CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); michael@0: michael@0: michael@0: /* michael@0: * NAME curl_easy_duphandle() michael@0: * michael@0: * DESCRIPTION michael@0: * michael@0: * Creates a new curl session handle with the same options set for the handle michael@0: * passed in. Duplicating a handle could only be a matter of cloning data and michael@0: * options, internal state info and things like persistant connections cannot michael@0: * be transfered. It is useful in multithreaded applications when you can run michael@0: * curl_easy_duphandle() for each new thread to avoid a series of identical michael@0: * curl_easy_setopt() invokes in every thread. michael@0: */ michael@0: CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); michael@0: michael@0: /* michael@0: * NAME curl_easy_reset() michael@0: * michael@0: * DESCRIPTION michael@0: * michael@0: * Re-initializes a CURL handle to the default values. This puts back the michael@0: * handle to the same state as it was in when it was just created. michael@0: * michael@0: * It does keep: live connections, the Session ID cache, the DNS cache and the michael@0: * cookies. michael@0: */ michael@0: CURL_EXTERN void curl_easy_reset(CURL *curl); michael@0: michael@0: /* michael@0: * NAME curl_easy_recv() michael@0: * michael@0: * DESCRIPTION michael@0: * michael@0: * Receives data from the connected socket. Use after successful michael@0: * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. michael@0: */ michael@0: CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, michael@0: size_t *n); michael@0: michael@0: /* michael@0: * NAME curl_easy_send() michael@0: * michael@0: * DESCRIPTION michael@0: * michael@0: * Sends data over the connected socket. Use after successful michael@0: * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. michael@0: */ michael@0: CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, michael@0: size_t buflen, size_t *n); michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif