source: trunk/libtransmission/publish.h @ 7404

Last change on this file since 7404 was 7404, checked in by charles, 12 years ago

updated email address

  • 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@transmissionbt.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: publish.h 7404 2008-12-16 00:20:44Z charles $
11 */
12
13#ifndef __TRANSMISSION__
14#error only libtransmission should #include this header.
15#endif
16
17#ifndef _TR_PUBLISHER_H_
18#define _TR_PUBLISHER_H_
19
20/**
21***  A lightweight implementation of the 'Observable' design pattern.
22**/
23
24typedef struct tr_publisher_s tr_publisher_t;
25
26typedef void * tr_publisher_tag;
27
28typedef void tr_delivery_func ( void * source,
29                                void * event,
30                                void * user_data );
31
32/**
33***  Observer API
34**/
35
36tr_publisher_tag tr_publisherSubscribe( tr_publisher_t * publisher,
37                                        tr_delivery_func delivery_func,
38                                        void *           user_data );
39
40void             tr_publisherUnsubscribe( tr_publisher_t * publisher,
41                                          tr_publisher_tag tag );
42
43/**
44***  Observable API
45**/
46
47tr_publisher_t * tr_publisherNew( void );
48
49void             tr_publisherFree( tr_publisher_t ** publisher );
50
51void             tr_publisherPublish( tr_publisher_t * publisher,
52                                      void *           source,
53                                      void *           event );
54
55#endif
Note: See TracBrowser for help on using the repository browser.