00001 #ifndef foosimplewatchhfoo 00002 #define foosimplewatchhfoo 00003 00004 /* $Id: simple-watch.h 1151 2006-02-20 16:21:29Z lennart $ */ 00005 00006 /*** 00007 This file is part of avahi. 00008 00009 avahi is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Lesser General Public License as 00011 published by the Free Software Foundation; either version 2.1 of the 00012 License, or (at your option) any later version. 00013 00014 avahi is distributed in the hope that it will be useful, but WITHOUT 00015 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00016 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General 00017 Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with avahi; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00022 USA. 00023 ***/ 00024 00027 #include <sys/poll.h> 00028 #include <avahi-common/cdecl.h> 00029 #include <avahi-common/watch.h> 00030 00031 AVAHI_C_DECL_BEGIN 00032 00036 typedef struct AvahiSimplePoll AvahiSimplePoll; 00037 00039 AvahiSimplePoll *avahi_simple_poll_new(void); 00040 00042 void avahi_simple_poll_free(AvahiSimplePoll *s); 00043 00047 const AvahiPoll* avahi_simple_poll_get(AvahiSimplePoll *s); 00048 00058 int avahi_simple_poll_iterate(AvahiSimplePoll *s, int sleep_time); 00059 00062 void avahi_simple_poll_quit(AvahiSimplePoll *s); 00063 00065 typedef int (*AvahiPollFunc)(struct pollfd *ufds, unsigned int nfds, int timeout, void *userdata); 00066 00068 void avahi_simple_poll_set_func(AvahiSimplePoll *s, AvahiPollFunc func, void *userdata); 00069 00071 int avahi_simple_poll_prepare(AvahiSimplePoll *s, int timeout); 00072 00074 int avahi_simple_poll_run(AvahiSimplePoll *s); 00075 00077 int avahi_simple_poll_dispatch(AvahiSimplePoll *s); 00078 00080 int avahi_simple_poll_loop(AvahiSimplePoll *s); 00081 00083 void avahi_simple_poll_wakeup(AvahiSimplePoll *s); 00084 00085 AVAHI_C_DECL_END 00086 00087 #endif