aboutsummaryrefslogtreecommitdiff
path: root/src/lib/common/watch.h
blob: ca601556c39e918b6dd64083ac297732d8944071 (plain) (blame)
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
#ifndef WATCH_H
#define WATCH_H

#include <dbus/dbus.h>

#include <gnunet/platform.h>
#include <gnunet/gnunet_common.h>
#include <gnunet/gnunet_scheduler_lib.h>

struct Watch;

struct WatchIter
{
  struct WatchIter *next;
  struct WatchIter *prev;

  struct Watch *w;
};

struct Watch *watch_create (DBusWatch *watch);
void watch_ref (struct Watch *w);
void watch_unref (struct Watch *w);

/*
 * Schedule or schedule the scheduler to monitor dbus file descriptors.
 */
void watch_schedule (struct Watch *w);
void watch_unschedule (struct Watch *w);
void do_watch_unschedule (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);

struct WatchIter *watch_find (struct WatchIter *, DBusWatch *watch);

#endif