diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-24 00:39:29 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-24 00:39:29 +0100 |
commit | 9152c765065184d0c1267ed2499e3fe4cac53755 (patch) | |
tree | 70047967e77e502779d1febc6209a4f7b67a1bbf /name.h | |
parent | 476fe607ecbabc5beffafc8efb0778e3d9e1030a (diff) |
add simple event loop
Diffstat (limited to 'name.h')
-rw-r--r-- | name.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |