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)
}
/* From ioops.h: */
void registerIO( struct ioOps *ops )
void registerIO(struct ioOps *ops)
{
assert( ops != NULL );
assert(ops != NULL);
ops->next = ioList;
ioList = ops;
ops->prev = NULL;
if( ops->next )
if (ops->next)
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;
else if( ops->prev != NULL )
else if (ops->prev != NULL)
ops->prev->next = ops->next;
}
......@@ -29,7 +29,7 @@ struct ioOps {
* To register for IO, call FD_SET for each required queue
* 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.
......@@ -39,13 +39,14 @@ struct ioOps {
* Return the total number of fds left in all sets (Ie, return fdCount
* 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 */
void registerIO( struct ioOps *ops );
void registerIO(struct ioOps *ops);
/* Call this to deregister your io operation handler struct */
void deregisterIO( struct ioOps *ops );
void deregisterIO(struct ioOps *ops);
#endif
......@@ -21,7 +21,16 @@
#include "../config.h"
#ifdef HAVE_ZEROCONF
void initZeroconf(void);
void finishZeroconf(void);
#else /* ! HAVE_ZEROCONF */
static void initZeroconf(void) { }
static void finishZeroconf(void) { }
#endif /* ! HAVE_ZEROCONF */
#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