X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fsimple-watch.h;h=72c1905bcb4f02b746587a6f487b517265f44c5a;hb=6719a40e3d5c2939d59ac76314d2e2ea6ea67764;hp=c8234f20cf340e735859c08daf39c0bba4293724;hpb=fcc9b0efe1accdb0edcb3143a8e15782e69383db;p=catta diff --git a/avahi-common/simple-watch.h b/avahi-common/simple-watch.h index c8234f2..72c1905 100644 --- a/avahi-common/simple-watch.h +++ b/avahi-common/simple-watch.h @@ -1,21 +1,19 @@ #ifndef foosimplewatchhfoo #define foosimplewatchhfoo -/* $Id$ */ - /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -26,12 +24,9 @@ #include #include +#include -#include "watch.h" - -#ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_BEGIN -#endif /** A main loop object. Main loops of this type aren't very flexible * since they only support a single wakeup type. Nevertheless it @@ -65,13 +60,26 @@ 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 -#endif #endif