diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-10-02 02:16:02 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-10-02 02:16:02 +0000 |
commit | d3e893754d3158b72d488e515535dfcac980e1c3 (patch) | |
tree | 9896b619589fa78ebfa6692f28bab06636b3a3cf /avahi-common/simple-watch.h | |
parent | cc9205deaefa0e2f1222298aa64bb456da009fb2 (diff) |
* Split up avahi_simple_poll_iterate() into avahi_simple_poll_prepare(),avahi_simple_poll_run() and avahi_simple_poll_dispatch()
* Export wakeup function()
* add a userdata argument to poll() function
* add avahi_simple_poll_loop()
* minimize number of system calls
* threading compat improvements
* request pollfd rebuild in avahi_simple_poll_new()
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@671 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common/simple-watch.h')
-rw-r--r-- | avahi-common/simple-watch.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/avahi-common/simple-watch.h b/avahi-common/simple-watch.h index c8234f2..0833570 100644 --- a/avahi-common/simple-watch.h +++ b/avahi-common/simple-watch.h @@ -65,10 +65,25 @@ int avahi_simple_poll_iterate(AvahiSimplePoll *s, int sleep_time); void avahi_simple_poll_quit(AvahiSimplePoll *s); /** Prototype for a poll() type function */ -typedef int (*AvahiPollFunc)(struct pollfd *ufds, unsigned int nfds, int timeout); +typedef int (*AvahiPollFunc)(struct pollfd *ufds, unsigned int nfds, int timeout, void *userdata); /** Replace the internally used poll() function. By default the system's poll() will be used */ -void avahi_simple_poll_set_func(AvahiSimplePoll *s, AvahiPollFunc func); +void avahi_simple_poll_set_func(AvahiSimplePoll *s, AvahiPollFunc func, void *userdata); + +/** The first stage of avahi_simple_poll_iterate(), use this function only if you know what you do */ +int avahi_simple_poll_prepare(AvahiSimplePoll *s, int timeout); + +/** The second stage of avahi_simple_poll_iterate(), use this function only if you know what you do */ +int avahi_simple_poll_run(AvahiSimplePoll *s); + +/** The third and final stage of avahi_simple_poll_iterate(), use this function only if you know what you do */ +int avahi_simple_poll_dispatch(AvahiSimplePoll *s); + +/** Call avahi_simple_poll_iterate() in a loop and return if it returns non-zero */ +int avahi_simple_poll_loop(AvahiSimplePoll *s); + +/** Wakeup the main loop. (for threaded environments) */ +void avahi_simple_poll_wakeup(AvahiSimplePoll *s); #ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END |