summaryrefslogtreecommitdiff
path: root/name.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-24 00:39:29 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-24 00:39:29 +0100
commit9152c765065184d0c1267ed2499e3fe4cac53755 (patch)
tree70047967e77e502779d1febc6209a4f7b67a1bbf /name.h
parent476fe607ecbabc5beffafc8efb0778e3d9e1030a (diff)
add simple event loop
Diffstat (limited to 'name.h')
-rw-r--r--name.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/name.h b/name.h
index 8c526baed6..59f3b16f17 100644
--- a/name.h
+++ b/name.h
@@ -140,9 +140,16 @@ struct NameVTable {
* a simpler one that the engine can understand */
NameActiveState (*active_state)(Name *n);
+ void (*fd_event)(Name *n, int fd, uint32_t events);
+ void (*sigchld_event)(Name *n, pid_t pid, int code, int status);
+
void (*free_hook)(Name *n);
};
+extern const NameVTable * const name_vtable[_NAME_TYPE_MAX];
+
+#define NAME_VTABLE(n) name_vtable[(n)->meta.type]
+
/* For casting a name into the various name types */
#define DEFINE_CAST(UPPERCASE, MixedCase) \
static inline MixedCase* UPPERCASE(Name *name) { \
@@ -191,4 +198,10 @@ int name_reload(Name *n);
void name_notify(Name *n, NameActiveState os, NameActiveState ns);
+int name_watch_fd(Name *n, int fd, uint32_t events);
+void name_unwatch_fd(Name *n, int fd);
+
+int name_watch_pid(Name *n, pid_t pid);
+void name_unwatch_pid(Name *n, pid_t pid);
+
#endif