hop-2012/experiments/cmsg/subscription.h

35 lines
936 B
C

/* Copyright (C) 2010, 2011 Tony Garnock-Jones. All rights reserved. */
#ifndef cmsg_subscription_h
#define cmsg_subscription_h
typedef struct subscription_t_ {
sexp_t *uuid;
sexp_t *filter;
sexp_t *sink;
sexp_t *name;
struct subscription_t_ *link;
} subscription_t;
extern void free_subscription(subscription_t *sub);
extern void free_subscription_chain(subscription_t *chain);
extern int send_to_subscription(sexp_t *source,
hashtable_t *subscriptions,
subscription_t *sub,
sexp_t *body);
extern subscription_t *send_to_subscription_chain(sexp_t *source,
hashtable_t *subscriptions,
subscription_t *chain,
sexp_t *body);
extern subscription_t *handle_subscribe_message(sexp_t *source,
hashtable_t *subscriptions,
parsed_message_t *p);
extern void handle_unsubscribe_message(sexp_t *source,
hashtable_t *subscriptions,
parsed_message_t *p);
#endif