source: branches/encryption/libtransmission/publish.h @ 2984

Last change on this file since 2984 was 2984, checked in by charles, 15 years ago

periodic checkin. nothing to see here.

  • Property svn:keywords set to Date Rev Author Id
File size: 1.5 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: publish.h 2984 2007-09-07 17:05:56Z charles $
11 */
12
13#ifndef _TR_PUBLISHER_H_
14#define _TR_PUBLISHER_H_
15
16/**
17***  A lightweight implementation of the 'Observable' design pattern.
18**/
19
20typedef struct tr_publisher_s tr_publisher_t;
21
22typedef void * tr_publisher_tag;
23
24typedef void tr_delivery_func( void * source,
25                               void * event,
26                               void * user_data );
27
28/**
29***  Observer API
30**/
31
32tr_publisher_tag   tr_publisherSubscribe   ( tr_publisher_t    * publisher,
33                                             tr_delivery_func    delivery_func,
34                                             void              * user_data );
35
36void               tr_publisherUnsubscribe ( tr_publisher_t    * publisher,
37                                             tr_publisher_tag    tag );
38
39/**
40***  Observable API
41**/
42
43tr_publisher_t *   tr_publisherNew         ( void );
44
45void               tr_publisherFree        ( tr_publisher_t   ** publisher );
46
47void               tr_publisherPublish     ( tr_publisher_t    * publisher,
48                                             void              * source,
49                                             void              * event );
50
51#endif
Note: See TracBrowser for help on using the repository browser.