]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/printers.h
Merge changes from CUPS 1.6svn-r10437.
[thirdparty/cups.git] / scheduler / printers.h
index 41ae3b3f9f5a4cd7cf383020fa0ff4e42eecc037..833d2332b724010a8c39d0b55ef9d6edb355684c 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Printer definitions for the CUPS scheduler.
  *
- *   Copyright 2007-2011 by Apple Inc.
+ *   Copyright 2007-2012 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
 
 #ifdef HAVE_DNSSD
 #  include <dns_sd.h>
+#elif defined(HAVE_AVAHI)
+#  include <avahi-client/client.h>
+#  include <avahi-client/publish.h>
+#  include <avahi-common/error.h>
+#  include <avahi-common/thread-watch.h>
 #endif /* HAVE_DNSSD */
 #include <cups/pwg-private.h>
 
@@ -32,6 +37,20 @@ typedef struct
 } cupsd_quota_t;
 
 
+/*
+ * DNS-SD types to make the code cleaner/clearer...
+ */
+
+#ifdef HAVE_DNSSD
+typedef DNSServiceRef cupsd_srv_t;     /* Service reference */
+typedef TXTRecordRef cupsd_txt_t;      /* TXT record */
+
+#elif defined(HAVE_AVAHI)
+typedef AvahiEntryGroup *cupsd_srv_t;  /* Service reference */
+typedef AvahiStringList *cupsd_txt_t;  /* TXT record */
+#endif /* HAVE_DNSSD */
+
+
 /*
  * Printer/class information structure...
  */
@@ -92,16 +111,17 @@ struct cupsd_printer_s
   time_t       marker_time;            /* Last time marker attributes were updated */
   _ppd_cache_t *pc;                    /* PPD cache and mapping data */
 
-#ifdef HAVE_DNSSD
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
   char         *reg_name,              /* Name used for service registration */
-               *pdl,                   /* pdl value for TXT record */
-               *ipp_txt,               /* IPP TXT record contents */
-               *printer_txt;           /* LPD TXT record contents */
-  int          ipp_len,                /* IPP TXT record length */
-               printer_len;            /* LPD TXT record length */
-  DNSServiceRef        ipp_ref,                /* Reference for _ipp._tcp,_cups */
-               printer_ref;            /* Reference for _printer._tcp */
-#endif /* HAVE_DNSSD */
+               *pdl;                   /* pdl value for TXT record */
+  cupsd_srv_t  ipp_srv;                /* IPP service(s) */
+#  ifdef HAVE_DNSSD
+#    ifdef HAVE_SSL
+  cupsd_srv_t  ipps_srv;               /* IPPS service(s) */
+#    endif /* HAVE_SSL */
+  cupsd_srv_t  printer_srv;            /* LPD service */
+#  endif /* HAVE_DNSSD */
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
 };