source: trunk/libtransmission/trevent.h @ 6811

Last change on this file since 6811 was 6811, checked in by charles, 13 years ago

(libT) make sure to init the rpc server with the correct event base.

  • Property svn:keywords set to Date Rev Author Id
File size: 1.5 KB
Line 
1/*
2 * This file Copyright (C) 2007-2008 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 6811 2008-09-29 04:26:52Z charles $
11 */
12
13#ifndef TR_EVENT_H
14
15#include <stddef.h> /* size_t */
16#include <inttypes.h> /* uint64_t */
17
18/**
19**/
20
21void      tr_eventInit( struct tr_handle * tr_handle );
22
23void      tr_eventClose( struct tr_handle * tr_handle );
24
25struct event_base * tr_eventGetBase( struct tr_handle * tr_handle );
26
27
28typedef struct tr_timer  tr_timer;
29
30/**
31 * Calls timer_func(user_data) after the specified interval.
32 * The timer is freed if timer_func returns zero.
33 * Otherwise, it's called again after the same interval.
34 */
35tr_timer* tr_timerNew(
36    struct tr_handle *               handle,
37    int                 func( void * user_data ),
38    void *                           user_data,
39    uint64_t
40                                     timeout_milliseconds );
41
42/**
43 * Frees a timer and sets the timer pointer to NULL.
44 */
45void      tr_timerFree( tr_timer ** timer );
46
47
48int       tr_amInEventThread( struct tr_handle * handle );
49
50void      tr_runInEventThread( struct tr_handle *       handle,
51                               void               func( void* ),
52                               void *                   user_data );
53
54#endif
Note: See TracBrowser for help on using the repository browser.