]> git.meshlink.io Git - catta/blobdiff - subscribe.h
fix two memory leaks
[catta] / subscribe.h
index 75818c768cf2bdec961f70263072a310a8ab83ad..2399077169900572b87668c807d7678a7eb02c15 100644 (file)
@@ -1,19 +1,12 @@
 #ifndef foosubscribehfoo
 #define foosubscribehfoo
 
-typedef struct _flxSubscription flxSubscription;
-
 #include "llist.h"
+#include "flx.h"
+#include "subscribe.h"
+#include "timeeventq.h"
 #include "server.h"
 
-typedef enum {
-    FLX_SUBSCRIPTION_NEW,
-    FLX_SUBSCRIPTION_REMOVE,
-    FLX_SUBSCRIPTION_CHANGE
-} flxSubscriptionEvent;
-
-typedef void (*flxSubscriptionCallback)(flxSubscription *s, flxRecord *record, gint interface, guchar protocol, flxSubscriptionEvent event, gpointer userdata);
-
 struct _flxSubscription {
     flxServer *server;
     flxKey *key;
@@ -31,9 +24,8 @@ struct _flxSubscription {
     FLX_LLIST_FIELDS(flxSubscription, by_key);
 };
 
-flxSubscription *flx_subscription_new(flxServer *s, flxKey *key, gint interface, guchar protocol, flxSubscriptionCallback callback, gpointer userdata);
-void flx_subscription_free(flxSubscription *s);
-
 void flx_subscription_notify(flxServer *s, flxInterface *i, flxRecord *record, flxSubscriptionEvent event);
 
+gboolean flx_is_subscribed(flxServer *s, flxKey *k);
+
 #endif