source: trunk/libtransmission/trevent.h @ 3247

Last change on this file since 3247 was 3247, checked in by charles, 14 years ago

fix some memory issues.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.2 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 3247 2007-10-01 04:12:24Z charles $
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
44
45void tr_setBufferEventMode( struct tr_handle   * tr_handle,
46                            struct bufferevent * bufferEvent,
47                            short                mode_enable,
48                            short                mode_disable );
49
50/**
51***
52**/
53
54typedef struct tr_timer  tr_timer;
55
56/**
57 * Calls timer_func(user_data) after the specified interval.
58 * The timer is freed if timer_func returns zero.
59 * Otherwise, it's called again after the same interval.
60 */
61tr_timer* tr_timerNew( struct tr_handle  * handle,
62                       int                 func( void * user_data ),
63                       void              * user_data,
64                       int                 timeout_milliseconds );
65
66/**
67 * Frees a timer and sets the timer pointer to NULL.
68 */
69void tr_timerFree( tr_timer ** timer );
70
71void tr_runInEventThread( struct tr_handle * handle,
72                          void               func( void* ),
73                          void             * user_data );
74
75#endif
Note: See TracBrowser for help on using the repository browser.