source: trunk/libtransmission/web.h @ 11599

Last change on this file since 11599 was 11599, checked in by charles, 11 years ago

(trunk) Join the 21st century and use only 1 space at the end sentences. This commit is nearly as important as the semi-annual ones that remove trailing spaces from the ends of lines of code... :)

  • Property svn:keywords set to Date Rev Author Id
File size: 1.9 KB
Line 
1/*
2 * This file Copyright (C) 2008-2010 Mnemosyne LLC
3 *
4 * This file is licensed by the GPL version 2. Works owned by the
5 * Transmission project are granted a special exemption to clause 2(b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: web.h 11599 2010-12-27 19:18:17Z charles $
11 */
12
13#ifndef TR_HTTP_H
14#define TR_HTTP_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct tr_address;
21
22void tr_webInit( tr_session * session );
23
24typedef enum
25{
26    TR_WEB_CLOSE_WHEN_IDLE,
27    TR_WEB_CLOSE_NOW
28}
29tr_web_close_mode;
30
31/**
32 * This is a mechanism for adjusting your CURL* object to match
33 * the host OS's platform-dependent settings.
34 *
35 * A use case for this function is to call curl_easy_setopt() on curl_pointer.
36 *
37 * Examples of curl_easy_setopt() can be found at
38 * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html()
39 */
40void tr_sessionSetWebConfigFunc( tr_session * session, void (*config)(tr_session * session, void * curl_pointer, const char * url ) );
41
42
43void tr_webClose( tr_session * session, tr_web_close_mode close_mode );
44
45typedef void ( tr_web_done_func )( tr_session       * session,
46                                   long               response_code,
47                                   const void       * response,
48                                   size_t             response_byte_count,
49                                   void             * user_data );
50
51const char * tr_webGetResponseStr( long response_code );
52
53void         tr_webRun( tr_session        * session,
54                        const char        * url,
55                        const char        * range,
56                        tr_web_done_func    done_func,
57                        void              * done_func_user_data );
58
59struct evbuffer;
60
61void tr_http_escape( struct evbuffer *out, const char *str, int len, tr_bool escape_slashes );
62
63char* tr_http_unescape( const char * str, int len );
64
65#ifdef __cplusplus
66}
67#endif
68
69#endif
Note: See TracBrowser for help on using the repository browser.