Tim Waugh 0d8647
diff -up cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts cups-1.5.2/scheduler/cupsd.h
Tim Waugh 0d8647
--- cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts	2011-05-11 23:17:34.000000000 +0100
Tim Waugh 0d8647
+++ cups-1.5.2/scheduler/cupsd.h	2012-03-14 15:06:36.509476983 +0000
Tim Waugh 9829b0
@@ -140,6 +140,15 @@ extern const char *cups_hstrerror(int);
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 typedef void (*cupsd_selfunc_t)(void *data);
Tim Waugh 9829b0
 
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * Timeout callback function type...
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+typedef struct _cupsd_timeout_s cupsd_timeout_t;
Tim Waugh 9829b0
+typedef void (*cupsd_timeoutfunc_t)(cupsd_timeout_t *timeout, void *data);
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 /*
Tim Waugh 9829b0
  * Globals...
Tim Waugh 9829b0
@@ -173,6 +182,11 @@ VAR int			Launchd		VALUE(0);
Tim Waugh 9829b0
 					/* Running from launchd */
Tim Waugh 9829b0
 #endif /* HAVE_LAUNCH_H */
Tim Waugh 9829b0
 
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+VAR cups_array_t *Timeouts;		/* Timed callbacks for main loop */
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 /*
Tim Waugh 9829b0
  * Prototypes...
Tim Waugh 9829b0
@@ -242,6 +256,20 @@ extern void		cupsdStopSelect(void);
Tim Waugh 9829b0
 extern void		cupsdStartServer(void);
Tim Waugh 9829b0
 extern void		cupsdStopServer(void);
Tim Waugh 9829b0
 
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+extern void     cupsdInitTimeouts(void);
Tim Waugh 9829b0
+extern cupsd_timeout_t *cupsdAddTimeout (const struct timeval *tv,
Tim Waugh 9829b0
+					 cupsd_timeoutfunc_t cb,
Tim Waugh 9829b0
+					 void *data);
Tim Waugh 9829b0
+extern cupsd_timeout_t *cupsdNextTimeout (long *delay);
Tim Waugh 9829b0
+extern void     cupsdRunTimeout (cupsd_timeout_t *timeout);
Tim Waugh 9829b0
+extern void     cupsdUpdateTimeout (cupsd_timeout_t *timeout,
Tim Waugh 9829b0
+				    const struct timeval *tv);
Tim Waugh 9829b0
+extern void     cupsdRemoveTimeout (cupsd_timeout_t *timeout);
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+extern int	cupsdRemoveFile(const char *filename);
Tim Waugh 9829b0
+
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 /*
Tim Waugh 9829b0
  * End of "$Id: cupsd.h 9766 2011-05-11 22:17:34Z mike $".
Tim Waugh 0d8647
diff -up cups-1.5.2/scheduler/main.c.avahi-3-timeouts cups-1.5.2/scheduler/main.c
Tim Waugh 0d8647
--- cups-1.5.2/scheduler/main.c.avahi-3-timeouts	2012-03-14 15:04:17.655305548 +0000
Tim Waugh 0d8647
+++ cups-1.5.2/scheduler/main.c	2012-03-14 15:06:36.511476986 +0000
Tim Waugh 9829b0
@@ -146,6 +146,10 @@ main(int  argc,				/* I - Number of comm
Tim Waugh 9829b0
   int			launchd_idle_exit;
Tim Waugh 9829b0
 					/* Idle exit on select timeout? */
Tim Waugh 9829b0
 #endif	/* HAVE_LAUNCHD */
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+  cupsd_timeout_t	*tmo;		/* Next scheduled timed callback */
Tim Waugh 9829b0
+  long			tmo_delay;	/* Time before it must be called */
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 #ifdef HAVE_GETEUID
Tim Waugh 9829b0
@@ -535,6 +539,14 @@ main(int  argc,				/* I - Number of comm
Tim Waugh 9829b0
 
Tim Waugh 9829b0
   httpInitialize();
Tim Waugh 9829b0
 
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+ /*
Tim Waugh 9829b0
+  * Initialize timed callback structures.
Tim Waugh 9829b0
+  */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+  cupsdInitTimeouts();
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
   cupsdStartServer();
Tim Waugh 9829b0
 
Tim Waugh 9829b0
  /*
Tim Waugh 9829b0
@@ -874,6 +886,16 @@ main(int  argc,				/* I - Number of comm
Tim Waugh 9829b0
     }
Tim Waugh 9829b0
 #endif /* __APPLE__ */
Tim Waugh 9829b0
 
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+   /*
Tim Waugh 9829b0
+    * If a timed callback is due, run it.
Tim Waugh 9829b0
+    */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+    tmo = cupsdNextTimeout (&tmo_delay);
Tim Waugh 9829b0
+    if (tmo && tmo_delay == 0)
Tim Waugh 9829b0
+      cupsdRunTimeout (tmo);
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
 #ifndef __APPLE__
Tim Waugh 9829b0
    /*
Tim Waugh 9829b0
     * Update the network interfaces once a minute...
Tim Waugh 3d32f5
@@ -1787,6 +1809,10 @@ select_timeout(int fds)			/* I - Number
Tim Waugh 9829b0
   cupsd_job_t		*job;		/* Job information */
Tim Waugh 9829b0
   cupsd_subscription_t	*sub;		/* Subscription information */
Tim Waugh 9829b0
   const char		*why;		/* Debugging aid */
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+  cupsd_timeout_t	*tmo;		/* Timed callback */
Tim Waugh 9829b0
+  long			tmo_delay;	/* Seconds before calling it */
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
 
Tim Waugh 9829b0
 
Tim Waugh 9829b0
  /*
Tim Waugh 3d32f5
@@ -1829,6 +1855,19 @@ select_timeout(int fds)			/* I - Number
Tim Waugh 9829b0
   }
Tim Waugh 9829b0
 #endif /* __APPLE__ */
Tim Waugh 9829b0
 
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+ /*
Tim Waugh 9829b0
+  * See if there are any scheduled timed callbacks to run.
Tim Waugh 9829b0
+  */
Tim Waugh 9829b0
+
Tim Waugh 0d8647
+  if ((tmo = cupsdNextTimeout(&tmo_delay)) != NULL &&
Tim Waugh 0d8647
+      (now + tmo_delay) < timeout)
Tim Waugh 9829b0
+  {
Tim Waugh 9829b0
+    timeout = tmo_delay;
Tim Waugh 9829b0
+    why = "run a timed callback";
Tim Waugh 9829b0
+  }
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
  /*
Tim Waugh 9829b0
   * Check whether we are accepting new connections...
Tim Waugh 9829b0
   */
Tim Waugh 0d8647
diff -up cups-1.5.2/scheduler/Makefile.avahi-3-timeouts cups-1.5.2/scheduler/Makefile
Tim Waugh 0d8647
--- cups-1.5.2/scheduler/Makefile.avahi-3-timeouts	2012-03-14 15:04:17.685305586 +0000
Tim Waugh 0d8647
+++ cups-1.5.2/scheduler/Makefile	2012-03-14 15:06:36.508476980 +0000
Tim Waugh 9829b0
@@ -39,7 +39,8 @@ CUPSDOBJS =	\
Tim Waugh 9829b0
 		server.o \
Tim Waugh 9829b0
 		statbuf.o \
Tim Waugh 9829b0
 		subscriptions.o \
Tim Waugh 9829b0
-		sysman.o
Tim Waugh 9829b0
+		sysman.o \
Tim Waugh 9829b0
+		timeout.o
Tim Waugh 9829b0
 LIBOBJS =	\
Tim Waugh 9829b0
 		filter.o \
Tim Waugh 9829b0
 		mime.o \
Tim Waugh 0d8647
diff -up cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts cups-1.5.2/scheduler/timeout.c
Tim Waugh 0d8647
--- cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts	2012-03-14 15:06:36.552477037 +0000
Tim Waugh 0d8647
+++ cups-1.5.2/scheduler/timeout.c	2012-03-14 15:06:36.552477037 +0000
Tim Waugh 3d32f5
@@ -0,0 +1,235 @@
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * "$Id$"
Tim Waugh 9829b0
+ *
Tim Waugh 9829b0
+ *   Timeout functions for the Common UNIX Printing System (CUPS).
Tim Waugh 9829b0
+ *
Tim Waugh 3d32f5
+ *   Copyright (C) 2010, 2011 Red Hat, Inc.
Tim Waugh 9829b0
+ *   Authors:
Tim Waugh 9829b0
+ *     Tim Waugh <twaugh@redhat.com>
Tim Waugh 9829b0
+ *
Tim Waugh 3d32f5
+ *   Redistribution and use in source and binary forms, with or without
Tim Waugh 3d32f5
+ *   modification, are permitted provided that the following conditions
Tim Waugh 3d32f5
+ *   are met:
Tim Waugh 3d32f5
+ *
Tim Waugh 3d32f5
+ *   Redistributions of source code must retain the above copyright
Tim Waugh 3d32f5
+ *   notice, this list of conditions and the following disclaimer.
Tim Waugh 3d32f5
+ *
Tim Waugh 3d32f5
+ *   Redistributions in binary form must reproduce the above copyright
Tim Waugh 3d32f5
+ *   notice, this list of conditions and the following disclaimer in the
Tim Waugh 3d32f5
+ *   documentation and/or other materials provided with the distribution.
Tim Waugh 3d32f5
+ *
Tim Waugh 3d32f5
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Tim Waugh 3d32f5
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Tim Waugh 3d32f5
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Tim Waugh 3d32f5
+ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Tim Waugh 3d32f5
+ *   COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Tim Waugh 3d32f5
+ *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Tim Waugh 3d32f5
+ *   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Tim Waugh 3d32f5
+ *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Tim Waugh 3d32f5
+ *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Tim Waugh 3d32f5
+ *   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Tim Waugh 3d32f5
+ *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
Tim Waugh 3d32f5
+ *   OF THE POSSIBILITY OF SUCH DAMAGE.
Tim Waugh 9829b0
+ *
Tim Waugh 9829b0
+ * Contents:
Tim Waugh 9829b0
+ *
Tim Waugh 9829b0
+ *   cupsdInitTimeouts()  - Initialise timeout structure.
Tim Waugh 9829b0
+ *   cupsdAddTimeout()    - Add a timed callback.
Tim Waugh 9829b0
+ *   cupsdNextTimeout()   - Find the next enabled timed callback.
Tim Waugh 9829b0
+ *   cupsdUpdateTimeout() - Adjust the time of a timed callback or disable it.
Tim Waugh 9829b0
+ *   cupsdRemoveTimeout() - Discard a timed callback.
Tim Waugh 9829b0
+ *   compare_timeouts()   - Compare timed callbacks for array sorting.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+#include <config.h>
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI /* Applies to entire file... */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * Include necessary headers...
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+#include "cupsd.h"
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
Tim Waugh 9829b0
+#  include <malloc.h>
Tim Waugh 9829b0
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+#ifdef HAVE_AVAHI
Tim Waugh 9829b0
+#  include <avahi-common/timeval.h>
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+struct _cupsd_timeout_s
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  struct timeval when;
Tim Waugh 9829b0
+  int enabled;
Tim Waugh 9829b0
+  cupsd_timeoutfunc_t callback;
Tim Waugh 9829b0
+  void *data;
Tim Waugh 9829b0
+};
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * Local functions...
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'compare_timeouts()' - Compare timed callbacks for array sorting.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+static int
Tim Waugh 3d32f5
+compare_addrs (void *p0, void *p1)
Tim Waugh 3d32f5
+{
Tim Waugh 3d32f5
+  if (p0 == p1)
Tim Waugh 3d32f5
+    return (0);
Tim Waugh 3d32f5
+  if (p0 < p1)
Tim Waugh 3d32f5
+    return (-1);
Tim Waugh 3d32f5
+  return (1);
Tim Waugh 3d32f5
+}
Tim Waugh 3d32f5
+
Tim Waugh 3d32f5
+static int
Tim Waugh 9829b0
+compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1)
Tim Waugh 9829b0
+{
Tim Waugh 3d32f5
+  int addrsdiff = compare_addrs (p0, p1);
Tim Waugh 3d32f5
+  int tvdiff;
Tim Waugh 3d32f5
+
Tim Waugh 3d32f5
+  if (addrsdiff == 0)
Tim Waugh 3d32f5
+    return (0);
Tim Waugh 3d32f5
+
Tim Waugh 9829b0
+  if (!p0->enabled || !p1->enabled)
Tim Waugh 9829b0
+  {
Tim Waugh 9829b0
+    if (!p0->enabled && !p1->enabled)
Tim Waugh 3d32f5
+      return (addrsdiff);
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+    return (p0->enabled ? -1 : 1);
Tim Waugh 9829b0
+  }
Tim Waugh 9829b0
+
Tim Waugh 3d32f5
+  tvdiff = avahi_timeval_compare (&p0->when, &p1->when);
Tim Waugh 3d32f5
+  if (tvdiff != 0)
Tim Waugh 3d32f5
+    return (tvdiff);
Tim Waugh 3d32f5
+
Tim Waugh 3d32f5
+  return (addrsdiff);
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'cupsdInitTimeouts()' - Initialise timeout structures.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+void
Tim Waugh 9829b0
+cupsdInitTimeouts(void)
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  Timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, NULL);
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'cupsdAddTimeout()' - Add a timed callback.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+cupsd_timeout_t *				/* O - Timeout handle */
Tim Waugh 9829b0
+cupsdAddTimeout(const struct timeval *tv,	/* I - Absolute time */
Tim Waugh 9829b0
+		cupsd_timeoutfunc_t cb,		/* I - Callback function */
Tim Waugh 9829b0
+		void *data)			/* I - User data */
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  cupsd_timeout_t *timeout;
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+  timeout = malloc (sizeof(cupsd_timeout_t));
Tim Waugh 9829b0
+  if (timeout != NULL)
Tim Waugh 9829b0
+  {
Tim Waugh 9829b0
+    timeout->enabled = (tv != NULL);
Tim Waugh 9829b0
+    if (tv)
Tim Waugh 9829b0
+    {
Tim Waugh 9829b0
+      timeout->when.tv_sec = tv->tv_sec;
Tim Waugh 9829b0
+      timeout->when.tv_usec = tv->tv_usec;
Tim Waugh 9829b0
+    }
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+    timeout->callback = cb;
Tim Waugh 9829b0
+    timeout->data = data;
Tim Waugh 9829b0
+    cupsArrayAdd (Timeouts, timeout);
Tim Waugh 9829b0
+  }
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+  return timeout;
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'cupsdNextTimeout()' - Find the next enabled timed callback.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+cupsd_timeout_t *		/* O - Next enabled timeout or NULL */
Tim Waugh 9829b0
+cupsdNextTimeout(long *delay)	/* O - Seconds before scheduled */
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  cupsd_timeout_t *first = cupsArrayFirst (Timeouts);
Tim Waugh 9829b0
+  struct timeval curtime;
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+  if (first && !first->enabled)
Tim Waugh 9829b0
+    first = NULL;
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+  if (first && delay)
Tim Waugh 9829b0
+  {
Tim Waugh 9829b0
+    gettimeofday (&curtime, NULL);
Tim Waugh 9829b0
+    if (avahi_timeval_compare (&curtime, &first->when) > 0)
Tim Waugh 9829b0
+    {
Tim Waugh 9829b0
+      *delay = 0;
Tim Waugh 9829b0
+    } else {
Tim Waugh 9829b0
+      *delay = 1 + first->when.tv_sec - curtime.tv_sec;
Tim Waugh 9829b0
+      if (first->when.tv_usec < curtime.tv_usec)
Tim Waugh 9829b0
+	(*delay)--;
Tim Waugh 9829b0
+    }
Tim Waugh 9829b0
+  }
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+  return (first);
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'cupsdRunTimeout()' - Run a timed callback.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+void
Tim Waugh 9829b0
+cupsdRunTimeout(cupsd_timeout_t *timeout)	/* I - Timeout */
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  if (!timeout)
Tim Waugh 9829b0
+    return;
Tim Waugh 9829b0
+  timeout->enabled = 0;
Tim Waugh 9829b0
+  if (!timeout->callback)
Tim Waugh 9829b0
+    return;
Tim Waugh 9829b0
+  timeout->callback (timeout, timeout->data);
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'cupsdUpdateTimeout()' - Adjust the time of a timed callback or disable it.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+void
Tim Waugh 9829b0
+cupsdUpdateTimeout(cupsd_timeout_t *timeout,	/* I - Timeout */
Tim Waugh 9829b0
+		   const struct timeval *tv)	/* I - Absolute time or NULL */
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  cupsArrayRemove (Timeouts, timeout);
Tim Waugh 9829b0
+  timeout->enabled = (tv != NULL);
Tim Waugh 9829b0
+  if (tv)
Tim Waugh 9829b0
+  {
Tim Waugh 9829b0
+    timeout->when.tv_sec = tv->tv_sec;
Tim Waugh 9829b0
+    timeout->when.tv_usec = tv->tv_usec;
Tim Waugh 9829b0
+  }
Tim Waugh 9829b0
+  cupsArrayAdd (Timeouts, timeout);
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * 'cupsdRemoveTimeout()' - Discard a timed callback.
Tim Waugh 9829b0
+ */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+void
Tim Waugh 9829b0
+cupsdRemoveTimeout(cupsd_timeout_t *timeout)	/* I - Timeout */
Tim Waugh 9829b0
+{
Tim Waugh 9829b0
+  cupsArrayRemove (Timeouts, timeout);
Tim Waugh 9829b0
+  free (timeout);
Tim Waugh 9829b0
+}
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+#endif /* HAVE_AVAHI ... from top of file */
Tim Waugh 9829b0
+
Tim Waugh 9829b0
+/*
Tim Waugh 9829b0
+ * End of "$Id$".
Tim Waugh 9829b0
+ */