Commit a9b581f6 authored by Eric Wong's avatar Eric Wong

zeroconf: reformat (with mpd-indent.sh + manual tweaks)

Also, lower the impact of compiling this w/o zeroconf by making the init/teardown functions static no-ops. Eventually, we should separate the Bonjour and Avahi code into separate files and have callbacks registered for each one, avoiding the #ifdef mess we have now... git-svn-id: https://svn.musicpd.org/mpd/trunk@7132 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 776ccc89
...@@ -811,23 +811,23 @@ static void printInterfaceOutBuffer(Interface * interface) ...@@ -811,23 +811,23 @@ static void printInterfaceOutBuffer(Interface * interface)
} }
/* From ioops.h: */ /* From ioops.h: */
void registerIO( struct ioOps *ops ) void registerIO(struct ioOps *ops)
{ {
assert( ops != NULL ); assert(ops != NULL);
ops->next = ioList; ops->next = ioList;
ioList = ops; ioList = ops;
ops->prev = NULL; ops->prev = NULL;
if( ops->next ) if (ops->next)
ops->next->prev = ops; ops->next->prev = ops;
} }
void deregisterIO( struct ioOps *ops ) void deregisterIO(struct ioOps *ops)
{ {
assert( ops != NULL ); assert(ops != NULL);
if( ioList == ops ) if (ioList == ops)
ioList = ops->next; ioList = ops->next;
else if( ops->prev != NULL ) else if (ops->prev != NULL)
ops->prev->next = ops->next; ops->prev->next = ops->next;
} }
...@@ -29,7 +29,7 @@ struct ioOps { ...@@ -29,7 +29,7 @@ struct ioOps {
* To register for IO, call FD_SET for each required queue * To register for IO, call FD_SET for each required queue
* Return the highest fd number you registered * Return the highest fd number you registered
*/ */
int (*fdset) ( fd_set *rfds, fd_set *wfds, fd_set *efds ); int (*fdset) (fd_set * rfds, fd_set * wfds, fd_set * efds);
/* /*
* Called after each 'select' statement. * Called after each 'select' statement.
...@@ -39,13 +39,14 @@ struct ioOps { ...@@ -39,13 +39,14 @@ struct ioOps {
* Return the total number of fds left in all sets (Ie, return fdCount * Return the total number of fds left in all sets (Ie, return fdCount
* minus the number of times you called FD_CLR). * minus the number of times you called FD_CLR).
*/ */
int (*consume) ( int fdCount, fd_set *rfds, fd_set *wfds, fd_set *efds ); int (*consume) (int fdCount, fd_set * rfds, fd_set * wfds,
fd_set * efds);
}; };
/* Call this to register your io operation handler struct */ /* Call this to register your io operation handler struct */
void registerIO( struct ioOps *ops ); void registerIO(struct ioOps *ops);
/* Call this to deregister your io operation handler struct */ /* Call this to deregister your io operation handler struct */
void deregisterIO( struct ioOps *ops ); void deregisterIO(struct ioOps *ops);
#endif #endif
...@@ -21,7 +21,16 @@ ...@@ -21,7 +21,16 @@
#include "../config.h" #include "../config.h"
#ifdef HAVE_ZEROCONF
void initZeroconf(void); void initZeroconf(void);
void finishZeroconf(void); void finishZeroconf(void);
#else /* ! HAVE_ZEROCONF */
static void initZeroconf(void) { }
static void finishZeroconf(void) { }
#endif /* ! HAVE_ZEROCONF */
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment