aboutsummaryrefslogtreecommitdiff
path: root/src/lib/pubsub/pubsub_connect.h
blob: f3de74c870ed5a591a6b81374b20cfa2ddb54f25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* Copyright (c) 2001, Matej Pfajfar.
 * Copyright (c) 2001-2004, Roger Dingledine.
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
 * Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * @file pubsub_connect.h
 * @brief Header for functions that add relationships to a pubsub builder.
 *
 * These functions are used by modules that need to add publication and
 * subscription requests.  Most users will want to call these functions
 * indirectly, via the macros in pubsub_macros.h.
 **/

#ifndef TOR_PUBSUB_CONNECT_H
#define TOR_PUBSUB_CONNECT_H

#include "lib/dispatch/msgtypes.h"

struct pub_binding_t;
struct pubsub_connector_t;

int pubsub_add_pub_(struct pubsub_connector_t *con,
                    struct pub_binding_t *out,
                    channel_id_t channel,
                    message_id_t msg,
                    msg_type_id_t type,
                    unsigned flags,
                    const char *file,
                    unsigned line);

int pubsub_add_sub_(struct pubsub_connector_t *con,
                    recv_fn_t recv_fn,
                    channel_id_t channel,
                    message_id_t msg,
                    msg_type_id_t type,
                    unsigned flags,
                    const char *file,
                    unsigned line);

int pubsub_connector_define_type_(struct pubsub_connector_t *,
                                  msg_type_id_t,
                                  dispatch_typefns_t *,
                                  const char *file,
                                  unsigned line);

#endif