source: trunk/libtransmission/trevent.h @ 3105

Last change on this file since 3105 was 3105, checked in by livings124, 14 years ago

merge encryption branch to trunk (xcode project is still out of date)

  • Property svn:keywords set to Date Rev Author Id
File size: 2.3 KB
Line 
1/*
2 * This file Copyright (C) 2007 Charles Kerr <charles@rebelbase.com>
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: trevent.h 3105 2007-09-20 16:32:01Z livings124 $
11 */
12
13#ifndef TR_EVENT_H
14
15#include <stddef.h> /* for size_t */
16
17/**
18**/
19
20void tr_eventInit( struct tr_handle * tr_handle );
21
22void tr_eventClose( struct tr_handle * tr_handle );
23
24/**
25**/
26
27struct event;
28enum evhttp_cmd_type;
29struct evhttp_request;
30struct evhttp_connection;
31struct bufferevent;
32
33void tr_evhttp_make_request (struct tr_handle          * tr_handle,
34                             struct evhttp_connection  * evcon,
35                             struct evhttp_request     * req,
36                             enum evhttp_cmd_type        type,
37                             char                      * uri);
38
39void tr_bufferevent_write( struct tr_handle    * tr_handle,
40                           struct bufferevent  * bufferEvent,
41                           const void          * buf,
42                           size_t                buflen );
43
44void tr_bufferevent_free( struct tr_handle   * handle,
45                          struct bufferevent * bufev );
46
47
48void tr_setBufferEventMode( struct tr_handle   * tr_handle,
49                            struct bufferevent * bufferEvent,
50                            short                mode_enable,
51                            short                mode_disable );
52
53/**
54***
55**/
56
57typedef struct tr_timer  tr_timer;
58
59/**
60 * Calls timer_func(user_data) after the specified interval.
61 * The timer is freed if timer_func returns zero.
62 * Otherwise, it's called again after the same interval.
63 */
64tr_timer* tr_timerNew( struct tr_handle  * handle,
65                       int                 func( void * user_data ),
66                       void              * user_data,
67                       int                 timeout_milliseconds );
68
69/**
70 * Frees a timer and sets the timer pointer to NULL.
71 */
72void tr_timerFree( tr_timer ** timer );
73
74void tr_runInEventThread( struct tr_handle * handle,
75                          void               func( void* ),
76                          void             * user_data );
77
78#endif
Note: See TracBrowser for help on using the repository browser.