]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/sidechannel.c
Return kDNSServiceErr_ServiceNotRunning when Bonjour for Windows not installed.
[thirdparty/cups.git] / cups / sidechannel.c
index 8dc2ce0ff8aeb6ed0d52ac1184063fcafd79d45b..56a5d011621e772c43f63c6652a35684a557633a 100644 (file)
@@ -1,18 +1,11 @@
 /*
- * "$Id$"
- *
  * Side-channel API code for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
- * Copyright 2006 by Easy Software Products.
- *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file.  If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * Copyright © 2007-2019 by Apple Inc.
+ * Copyright © 2006 by Easy Software Products.
  *
- * This file is subject to the Apple OS-Developed Software exception.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
 
 #include "sidechannel.h"
 #include "cups-private.h"
-#ifdef WIN32
+#include "debug-internal.h"
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 */
-#ifndef WIN32
 #  include <sys/select.h>
 #  include <sys/time.h>
-#endif /* !WIN32 */
+#endif /* _WIN32 */
 #ifdef HAVE_POLL
 #  include <poll.h>
 #endif /* HAVE_POLL */
@@ -56,7 +48,7 @@
  * pointed to by the "data" parameter.  cupsSideChannelDoRequest() will
  * update the value to contain the number of data bytes in the buffer.
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 cups_sc_status_t                       /* O  - Status of command */
@@ -95,7 +87,7 @@ cupsSideChannelDoRequest(
  * pointed to by the "data" parameter.  cupsSideChannelDoRequest() will
  * update the value to contain the number of data bytes in the buffer.
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 int                                    /* O - 0 on success, -1 on error */
@@ -295,7 +287,7 @@ cupsSideChannelRead(
  * support SNMP queries.  @code CUPS_SC_STATUS_NO_RESPONSE@ is returned when
  * the printer does not respond to the SNMP query.
  *
- * @since CUPS 1.4/OS X 10.6@
+ * @since CUPS 1.4/macOS 10.6@
  */
 
 cups_sc_status_t                       /* O  - Query status */
@@ -401,7 +393,7 @@ cupsSideChannelSNMPGet(
  * support SNMP queries.  @code CUPS_SC_STATUS_NO_RESPONSE@ is returned when
  * the printer does not respond to the first SNMP query.
  *
- * @since CUPS 1.4/OS X 10.6@
+ * @since CUPS 1.4/macOS 10.6@
  */
 
 cups_sc_status_t                       /* O - Status of first query of @code CUPS_SC_STATUS_OK@ on success */
@@ -520,7 +512,7 @@ cupsSideChannelSNMPWalk(
  * This function is normally only called by backend programs to send
  * responses to a filter, driver, or port monitor program.
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 int                                    /* O - 0 on success, -1 on error */
@@ -598,8 +590,8 @@ cupsSideChannelWrite(
   if ((buffer = _cupsBufferGet((size_t)datalen + 4)) == NULL)
     return (-1);
 
-  buffer[0] = command;
-  buffer[1] = status;
+  buffer[0] = (char)command;
+  buffer[1] = (char)status;
   buffer[2] = (char)(datalen >> 8);
   buffer[3] = (char)(datalen & 255);
 
@@ -622,8 +614,3 @@ cupsSideChannelWrite(
 
   return (0);
 }
-
-
-/*
- * End of "$Id$".
- */