0d86476
diff -up cups-1.5.2/scheduler/avahi.c.avahi-4-poll cups-1.5.2/scheduler/avahi.c
0d86476
--- cups-1.5.2/scheduler/avahi.c.avahi-4-poll	2012-03-14 15:07:29.477542381 +0000
0d86476
+++ cups-1.5.2/scheduler/avahi.c	2012-03-14 15:07:29.477542381 +0000
3f9aa63
@@ -0,0 +1,441 @@
9829b01
+/*
9829b01
+ * "$Id$"
9829b01
+ *
9829b01
+ *   Avahi poll implementation for the CUPS scheduler.
9829b01
+ *
3f9aa63
+ *   Copyright (C) 2010, 2011 Red Hat, Inc.
9829b01
+ *   Authors:
9829b01
+ *    Tim Waugh <twaugh@redhat.com>
9829b01
+ *
3f9aa63
+ *   Redistribution and use in source and binary forms, with or without
3f9aa63
+ *   modification, are permitted provided that the following conditions
3f9aa63
+ *   are met:
3f9aa63
+ *
3f9aa63
+ *   Redistributions of source code must retain the above copyright
3f9aa63
+ *   notice, this list of conditions and the following disclaimer.
3f9aa63
+ *
3f9aa63
+ *   Redistributions in binary form must reproduce the above copyright
3f9aa63
+ *   notice, this list of conditions and the following disclaimer in the
3f9aa63
+ *   documentation and/or other materials provided with the distribution.
3f9aa63
+ *
3f9aa63
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3f9aa63
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3f9aa63
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
3f9aa63
+ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
3f9aa63
+ *   COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
3f9aa63
+ *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
3f9aa63
+ *   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
3f9aa63
+ *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3f9aa63
+ *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3f9aa63
+ *   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3f9aa63
+ *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3f9aa63
+ *   OF THE POSSIBILITY OF SUCH DAMAGE.
9829b01
+ *
9829b01
+ * Contents:
9829b01
+ *
9829b01
+ *   watch_read_cb         - Read callback for file descriptor
9829b01
+ *   watch_write_cb        - Write callback for file descriptor
9829b01
+ *   watched_fd_add_select() - Call cupsdAddSelect() as needed
9829b01
+ *   watch_new()           - Create a new file descriptor watch
9829b01
+ *   watch_free()          - Free a file descriptor watch
9829b01
+ *   watch_update()        - Update watched events for a file descriptor
9829b01
+ *   watch_get_events()    - Get events that happened for a file descriptor
9829b01
+ *   timeout_cb()          - Run a timed Avahi callback
9829b01
+ *   timeout_new()         - Set a wakeup time
9829b01
+ *   timeout_update()      - Update the expiration time for a timeout
9829b01
+ *   timeout_free()        - Free a timeout
9829b01
+ *   compare_watched_fds() - Compare watched file descriptors for array sorting
9829b01
+ *   avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS
9829b01
+ *   avahi_cups_poll_free() - Free an Avahi main loop object for CUPS
9829b01
+ *   avahi_cups_poll_get() - Get the abstract poll API structure
9829b01
+ */
9829b01
+
9829b01
+#include <config.h>
9829b01
+
9829b01
+#ifdef HAVE_AVAHI /* Applies to entire file... */
9829b01
+
9829b01
+/*
9829b01
+ * Include necessary headers...
9829b01
+ */
9829b01
+
9829b01
+#include "cupsd.h"
9829b01
+
9829b01
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
9829b01
+#  include <malloc.h>
9829b01
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
9829b01
+
9829b01
+#ifdef HAVE_AVAHI
9829b01
+#  include <avahi-common/timeval.h>
9829b01
+#endif /* HAVE_AVAHI */
9829b01
+
9829b01
+
9829b01
+typedef struct
9829b01
+{
9829b01
+  AvahiCupsPoll *cups_poll;
9829b01
+
9829b01
+  int fd;
9829b01
+  AvahiWatchEvent occurred;
9829b01
+  cups_array_t *watches;
9829b01
+} cupsd_watched_fd_t;
9829b01
+
9829b01
+struct AvahiWatch
9829b01
+{
9829b01
+  cupsd_watched_fd_t *watched_fd;
9829b01
+
9829b01
+  AvahiWatchEvent events;
9829b01
+  AvahiWatchCallback callback;
9829b01
+  void *userdata;
9829b01
+};
9829b01
+
9829b01
+struct AvahiTimeout
9829b01
+{
9829b01
+  AvahiCupsPoll *cups_poll;
9829b01
+  AvahiTimeoutCallback callback;
9829b01
+  void *userdata;
9829b01
+  cupsd_timeout_t *cupsd_timeout;
9829b01
+};
9829b01
+
9829b01
+/*
9829b01
+ * Local functions...
9829b01
+ */
9829b01
+
9829b01
+static AvahiWatch *	watch_new(const AvahiPoll *api,
9829b01
+				  int fd,
9829b01
+				  AvahiWatchEvent events,
9829b01
+				  AvahiWatchCallback callback,
9829b01
+				  void *userdata);
9829b01
+static void		watch_free(AvahiWatch *watch);
9829b01
+static void		watch_update(AvahiWatch *watch,
9829b01
+				     AvahiWatchEvent events);
9829b01
+static AvahiWatchEvent	watch_get_events(AvahiWatch *watch);
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'watch_read_cb' - Read callback for file descriptor
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+watch_read_cb (void *userdata)
9829b01
+{
9829b01
+  AvahiWatch *watch;
9829b01
+  cupsd_watched_fd_t *watched_fd = userdata;
9829b01
+  watched_fd->occurred |= AVAHI_WATCH_IN;
9829b01
+  for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
9829b01
+       watch;
3f9aa63
+       watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
3f9aa63
+  {
3f9aa63
+    if (watch->events & watched_fd->occurred)
3f9aa63
+    {
9829b01
+      (watch->callback) (watch, watched_fd->fd,
9829b01
+			 AVAHI_WATCH_IN, watch->userdata);
9829b01
+      watched_fd->occurred &= ~AVAHI_WATCH_IN;
9829b01
+      break;
9829b01
+    }
9829b01
+  }
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'watch_write_cb' - Write callback for file descriptor
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+watch_write_cb (void *userdata)
9829b01
+{
9829b01
+  AvahiWatch *watch;
9829b01
+  cupsd_watched_fd_t *watched_fd = userdata;
9829b01
+  watched_fd->occurred |= AVAHI_WATCH_OUT;
9829b01
+  for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
9829b01
+       watch;
3f9aa63
+       watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
3f9aa63
+  {
3f9aa63
+    if (watch->events & watched_fd->occurred)
3f9aa63
+    {
9829b01
+      (watch->callback) (watch, watched_fd->fd,
9829b01
+			 AVAHI_WATCH_OUT, watch->userdata);
9829b01
+      watched_fd->occurred &= ~AVAHI_WATCH_OUT;
9829b01
+      break;
9829b01
+    }
9829b01
+  }
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'watched_fd_add_select' - Call cupsdAddSelect() as needed
9829b01
+ */
9829b01
+
9829b01
+static int						/* O - Watches? */
9829b01
+watched_fd_add_select (cupsd_watched_fd_t *watched_fd)
9829b01
+{
9829b01
+  AvahiWatch *watch;
9829b01
+  cupsd_selfunc_t read_cb = NULL, write_cb = NULL;
3f9aa63
+  int any_watches = 0;
9829b01
+
9829b01
+  for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
9829b01
+       watch;
3f9aa63
+       watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
3f9aa63
+  {
3f9aa63
+    any_watches = 1;
9829b01
+    if (watch->events & (AVAHI_WATCH_IN |
9829b01
+			     AVAHI_WATCH_ERR |
3f9aa63
+			     AVAHI_WATCH_HUP))
3f9aa63
+    {
9829b01
+      read_cb = (cupsd_selfunc_t)watch_read_cb;
9829b01
+      if (write_cb != NULL)
9829b01
+	break;
9829b01
+    }
9829b01
+
3f9aa63
+    if (watch->events & AVAHI_WATCH_OUT)
3f9aa63
+    {
9829b01
+      write_cb = (cupsd_selfunc_t)watch_write_cb;
9829b01
+      if (read_cb != NULL)
9829b01
+	break;
9829b01
+    }
9829b01
+  }
9829b01
+
9829b01
+  if (read_cb || write_cb)
9829b01
+    cupsdAddSelect (watched_fd->fd, read_cb, write_cb, watched_fd);
9829b01
+  else
9829b01
+    cupsdRemoveSelect (watched_fd->fd);
9829b01
+
3f9aa63
+  return (any_watches);
9829b01
+}
9829b01
+
9829b01
+/*
9829b01
+ * 'watch_new' - Create a new file descriptor watch
9829b01
+ */
9829b01
+
9829b01
+static AvahiWatch *
9829b01
+watch_new (const AvahiPoll *api,
9829b01
+	   int fd,
9829b01
+	   AvahiWatchEvent events,
9829b01
+	   AvahiWatchCallback callback,
9829b01
+	   void *userdata)
9829b01
+{
9829b01
+  cupsd_watched_fd_t key, *watched_fd;
9829b01
+  AvahiCupsPoll *cups_poll = api->userdata;
9829b01
+  AvahiWatch *watch = malloc(sizeof(AvahiWatch));
9829b01
+  if (watch == NULL)
9829b01
+    return (NULL);
9829b01
+
9829b01
+  watch->events = events;
9829b01
+  watch->callback = callback;
9829b01
+  watch->userdata = userdata;
9829b01
+
9829b01
+  key.fd = fd;
9829b01
+  watched_fd = cupsArrayFind (cups_poll->watched_fds, &key);
3f9aa63
+  if (watched_fd == NULL)
3f9aa63
+  {
9829b01
+    watched_fd = malloc(sizeof(cupsd_watched_fd_t));
3f9aa63
+    if (watched_fd == NULL)
3f9aa63
+    {
9829b01
+      free (watch);
9829b01
+      return (NULL);
9829b01
+    }
9829b01
+
9829b01
+    watched_fd->fd = fd;
9829b01
+    watched_fd->occurred = 0;
9829b01
+    watched_fd->cups_poll = cups_poll;
3f9aa63
+    watched_fd->watches = cupsArrayNew (NULL, NULL);
3f9aa63
+    cupsArrayAdd (cups_poll->watched_fds, watched_fd);
9829b01
+  }
9829b01
+
9829b01
+  watch->watched_fd = watched_fd;
9829b01
+  cupsArrayAdd(watched_fd->watches, watch);
9829b01
+  watched_fd_add_select (watched_fd);
9829b01
+  return (watch);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'watch_free' - Free a file descriptor watch
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+watch_free (AvahiWatch *watch)
9829b01
+{
9829b01
+  cupsd_watched_fd_t *watched_fd = watch->watched_fd;
9829b01
+  AvahiCupsPoll *cups_poll = watched_fd->cups_poll;
9829b01
+
9829b01
+  cupsArrayRemove (watched_fd->watches, watch);
9829b01
+  free (watch);
9829b01
+
3f9aa63
+  if (!watched_fd_add_select (watched_fd))
3f9aa63
+  {
9829b01
+    /* No more watches */
9829b01
+    cupsArrayRemove (cups_poll->watched_fds, watched_fd);
9829b01
+    free (watched_fd);
9829b01
+  }
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'watch_update' - Update watched events for a file descriptor
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+watch_update (AvahiWatch *watch,
9829b01
+	      AvahiWatchEvent events)
9829b01
+{
9829b01
+  watch->events = events;
9829b01
+  watched_fd_add_select (watch->watched_fd);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'watch_get_events' - Get events that happened for a file descriptor
9829b01
+ */
9829b01
+
9829b01
+static AvahiWatchEvent
9829b01
+watch_get_events (AvahiWatch *watch)
9829b01
+{
9829b01
+  return (watch->watched_fd->occurred);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'timeout_cb()' - Run a timed Avahi callback
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+timeout_cb (cupsd_timeout_t *cupsd_timeout, void *userdata)
9829b01
+{
9829b01
+  AvahiTimeout *timeout = userdata;
9829b01
+  (timeout->callback) (timeout, timeout->userdata);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'timeout_new' - Set a wakeup time
9829b01
+ */
9829b01
+
9829b01
+static AvahiTimeout *
9829b01
+timeout_new (const AvahiPoll *api,
9829b01
+	     const struct timeval *tv,
9829b01
+	     AvahiTimeoutCallback callback,
9829b01
+	     void *userdata)
9829b01
+{
9829b01
+  AvahiTimeout *timeout;
9829b01
+  AvahiCupsPoll *cups_poll = api->userdata;
9829b01
+
9829b01
+  timeout = malloc(sizeof(AvahiTimeout));
9829b01
+  if (timeout == NULL)
9829b01
+    return (NULL);
9829b01
+
9829b01
+  timeout->cups_poll = cups_poll;
9829b01
+  timeout->callback = callback;
9829b01
+  timeout->userdata = userdata;
9829b01
+  timeout->cupsd_timeout = cupsdAddTimeout (tv,
9829b01
+					    (cupsd_timeoutfunc_t)timeout_cb,
9829b01
+					    timeout);
9829b01
+  cupsArrayAdd (cups_poll->timeouts, timeout);
9829b01
+  return (timeout);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'timeout_update' - Update the expiration time for a timeout
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+timeout_update (AvahiTimeout *timeout,
9829b01
+		const struct timeval *tv)
9829b01
+{
9829b01
+  cupsdUpdateTimeout (timeout->cupsd_timeout, tv);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * ' timeout_free' - Free a timeout
9829b01
+ */
9829b01
+
9829b01
+static void
9829b01
+timeout_free (AvahiTimeout *timeout)
9829b01
+{
9829b01
+  cupsArrayRemove (timeout->cups_poll->timeouts, timeout);
9829b01
+  cupsdRemoveTimeout (timeout->cupsd_timeout);
9829b01
+  free (timeout);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'compare_watched_fds' - Compare watched file descriptors for array sorting
9829b01
+ */
9829b01
+static int
9829b01
+compare_watched_fds(cupsd_watched_fd_t *p0,
9829b01
+		    cupsd_watched_fd_t *p1)
9829b01
+{
3f9aa63
+  /*
3f9aa63
+   * Compare by fd (no two elements have the same fd)
3f9aa63
+   */
9829b01
+
3f9aa63
+  if (p0->fd == p1->fd)
3f9aa63
+    return 0;
9829b01
+
3f9aa63
+  return (p0->fd < p1->fd ? -1 : 1);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'avahi_cups_poll_new' - Create a new Avahi main loop object for CUPS
9829b01
+ */
9829b01
+
9829b01
+AvahiCupsPoll *
9829b01
+avahi_cups_poll_new (void)
9829b01
+{
9829b01
+  AvahiCupsPoll *cups_poll = malloc(sizeof(AvahiCupsPoll));
9829b01
+  if (cups_poll == NULL)
9829b01
+    return (NULL);
9829b01
+
9829b01
+  cups_poll->watched_fds = cupsArrayNew ((cups_array_func_t)compare_watched_fds,
9829b01
+					 NULL);
3f9aa63
+  cups_poll->timeouts = cupsArrayNew (NULL, NULL);
9829b01
+
9829b01
+  cups_poll->api.userdata = cups_poll;
9829b01
+  cups_poll->api.watch_new = watch_new;
9829b01
+  cups_poll->api.watch_free = watch_free;
9829b01
+  cups_poll->api.watch_update = watch_update;
9829b01
+  cups_poll->api.watch_get_events = watch_get_events;
9829b01
+
9829b01
+  cups_poll->api.timeout_new = timeout_new;
9829b01
+  cups_poll->api.timeout_update = timeout_update;
9829b01
+  cups_poll->api.timeout_free = timeout_free;
9829b01
+
9829b01
+  return (cups_poll);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'avahi_cups_poll_free' - Free an Avahi main loop object for CUPS
9829b01
+ */
9829b01
+void
9829b01
+avahi_cups_poll_free (AvahiCupsPoll *cups_poll)
9829b01
+{
9829b01
+  cupsd_watched_fd_t *watched_fd;
9829b01
+
9829b01
+  for (watched_fd = (cupsd_watched_fd_t*)cupsArrayFirst(cups_poll->watched_fds);
9829b01
+       watched_fd;
3f9aa63
+       watched_fd = (cupsd_watched_fd_t*)cupsArrayNext(cups_poll->watched_fds))
9829b01
+    cupsArrayClear (watched_fd->watches);
9829b01
+
9829b01
+  cupsArrayClear (cups_poll->watched_fds);
9829b01
+  cupsArrayClear (cups_poll->timeouts);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * 'avahi_cups_poll_get' - Get the abstract poll API structure
9829b01
+ */
9829b01
+
9829b01
+const AvahiPoll *
9829b01
+avahi_cups_poll_get (AvahiCupsPoll *cups_poll)
9829b01
+{
9829b01
+  return (&cups_poll->api);
9829b01
+}
9829b01
+
9829b01
+
9829b01
+#endif /* HAVE_AVAHI ... from top of file */
9829b01
+
9829b01
+/*
9829b01
+ * End of "$Id$".
9829b01
+ */
0d86476
diff -up cups-1.5.2/scheduler/avahi.h.avahi-4-poll cups-1.5.2/scheduler/avahi.h
0d86476
--- cups-1.5.2/scheduler/avahi.h.avahi-4-poll	2012-03-14 15:07:29.477542381 +0000
0d86476
+++ cups-1.5.2/scheduler/avahi.h	2012-03-14 15:07:29.477542381 +0000
3f9aa63
@@ -0,0 +1,69 @@
9829b01
+/*
9829b01
+ * "$Id$"
9829b01
+ *
9829b01
+ *   Avahi poll implementation for the CUPS scheduler.
9829b01
+ *
3f9aa63
+ *   Copyright (C) 2010, 2011 Red Hat, Inc.
9829b01
+ *   Authors:
9829b01
+ *    Tim Waugh <twaugh@redhat.com>
9829b01
+ *
3f9aa63
+ *   Redistribution and use in source and binary forms, with or without
3f9aa63
+ *   modification, are permitted provided that the following conditions
3f9aa63
+ *   are met:
3f9aa63
+ *
3f9aa63
+ *   Redistributions of source code must retain the above copyright
3f9aa63
+ *   notice, this list of conditions and the following disclaimer.
3f9aa63
+ *
3f9aa63
+ *   Redistributions in binary form must reproduce the above copyright
3f9aa63
+ *   notice, this list of conditions and the following disclaimer in the
3f9aa63
+ *   documentation and/or other materials provided with the distribution.
3f9aa63
+ *
3f9aa63
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3f9aa63
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3f9aa63
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
3f9aa63
+ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
3f9aa63
+ *   COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
3f9aa63
+ *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
3f9aa63
+ *   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
3f9aa63
+ *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3f9aa63
+ *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3f9aa63
+ *   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3f9aa63
+ *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3f9aa63
+ *   OF THE POSSIBILITY OF SUCH DAMAGE.
9829b01
+ */
9829b01
+
9829b01
+#include <config.h>
9829b01
+
9829b01
+#ifdef HAVE_AVAHI
9829b01
+#  include <avahi-client/client.h>
9829b01
+#  include <avahi-client/publish.h>
9829b01
+#endif /* HAVE_AVAHI */
9829b01
+
9829b01
+#ifdef HAVE_AUTHORIZATION_H
9829b01
+#  include <Security/Authorization.h>
9829b01
+#endif /* HAVE_AUTHORIZATION_H */
9829b01
+
9829b01
+
9829b01
+#ifdef HAVE_AVAHI
9829b01
+typedef struct
9829b01
+{
9829b01
+    AvahiPoll api;
9829b01
+    cups_array_t *watched_fds;
9829b01
+    cups_array_t *timeouts;
9829b01
+} AvahiCupsPoll;
9829b01
+#endif /* HAVE_AVAHI */
9829b01
+
9829b01
+/*
9829b01
+ * Prototypes...
9829b01
+ */
9829b01
+
9829b01
+#ifdef HAVE_AVAHI
9829b01
+extern AvahiCupsPoll *	avahi_cups_poll_new(void);
9829b01
+extern void		avahi_cups_poll_free(AvahiCupsPoll *cups_poll);
9829b01
+extern const AvahiPoll *avahi_cups_poll_get(AvahiCupsPoll *cups_poll);
9829b01
+#endif /* HAVE_AVAHI */
9829b01
+
9829b01
+
9829b01
+/*
9829b01
+ * End of "$Id$".
9829b01
+ */
0d86476
diff -up cups-1.5.2/scheduler/Makefile.avahi-4-poll cups-1.5.2/scheduler/Makefile
0d86476
--- cups-1.5.2/scheduler/Makefile.avahi-4-poll	2012-03-14 15:06:36.508476980 +0000
0d86476
+++ cups-1.5.2/scheduler/Makefile	2012-03-14 15:07:29.476542380 +0000
9829b01
@@ -17,6 +17,7 @@ include ../Makedefs
9829b01
 
9829b01
 CUPSDOBJS =	\
9829b01
 		auth.o \
9829b01
+		avahi.o \
9829b01
 		banners.o \
9829b01
 		cert.o \
9829b01
 		classes.o \