watch.h
Go to the documentation of this file.
00001 #ifndef foowatchhfoo
00002 #define foowatchhfoo
00003 
00004 /* $Id: watch.h 1335 2006-11-19 08:04:07Z lathiat $ */
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 <sys/time.h>
00029 
00030 #include <avahi-common/cdecl.h>
00031 
00032 AVAHI_C_DECL_BEGIN
00033 
00035 typedef struct AvahiWatch AvahiWatch;
00036 
00038 typedef struct AvahiTimeout AvahiTimeout;
00039 
00041 typedef struct AvahiPoll AvahiPoll;
00042 
00044 typedef enum {
00045     AVAHI_WATCH_IN = POLLIN,      
00046     AVAHI_WATCH_OUT = POLLOUT,    
00047     AVAHI_WATCH_ERR = POLLERR,    
00048     AVAHI_WATCH_HUP = POLLHUP     
00049 } AvahiWatchEvent;
00050 
00052 typedef void (*AvahiWatchCallback)(AvahiWatch *w, int fd, AvahiWatchEvent event, void *userdata);
00053 
00055 typedef void (*AvahiTimeoutCallback)(AvahiTimeout *t, void *userdata);
00056 
00062 struct AvahiPoll {
00063 
00065     void* userdata; 
00066 
00070     AvahiWatch* (*watch_new)(const AvahiPoll *api, int fd, AvahiWatchEvent event, AvahiWatchCallback callback, void *userdata);
00071 
00073     void (*watch_update)(AvahiWatch *w, AvahiWatchEvent event);
00074 
00076     AvahiWatchEvent (*watch_get_events)(AvahiWatch *w);
00077 
00079     void (*watch_free)(AvahiWatch *w);
00080 
00086     AvahiTimeout* (*timeout_new)(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata);
00087 
00090     void (*timeout_update)(AvahiTimeout *, const struct timeval *tv);
00091     
00093     void (*timeout_free)(AvahiTimeout *t);
00094 };
00095 
00096 AVAHI_C_DECL_END
00097 
00098 #endif
00099 


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:21