X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=cups%2Fbackchannel.c;h=916c31433706890c20b2017fe1b18435983d705d;hb=HEAD;hp=bcc4331a5a0165f3df1a8c1e8f2c3c58c0d15efa;hpb=4c8dd44ec57d63e728bda99034c043b8941419df;p=platform%2Fupstream%2Fcups.git diff --git a/cups/backchannel.c b/cups/backchannel.c index bcc4331..916c314 100644 --- a/cups/backchannel.c +++ b/cups/backchannel.c @@ -1,24 +1,10 @@ /* - * "$Id: backchannel.c 9042 2010-03-24 00:45:34Z mike $" + * Backchannel functions for CUPS. * - * Backchannel functions for CUPS. + * Copyright 2007-2014 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products. * - * Copyright 2007-2010 by Apple Inc. - * Copyright 1997-2007 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/". - * - * This file is subject to the Apple OS-Developed Software exception. - * - * Contents: - * - * cupsBackChannelRead() - Read data from the backchannel. - * cupsBackChannelWrite() - Write data to the backchannel. - * cups_setup() - Setup select() + * Licensed under Apache License v2.0. See the file "LICENSE" for more information. */ /* @@ -26,13 +12,14 @@ */ #include "cups.h" +#include "sidechannel.h" #include -#ifdef WIN32 +#ifdef _WIN32 # include # include #else # include -#endif /* WIN32 */ +#endif /* _WIN32 */ /* @@ -50,7 +37,7 @@ static void cups_setup(fd_set *set, struct timeval *tval, * parameter controls how many seconds to wait for the data - use 0.0 to * return immediately if there is no data, -1.0 to wait for data indefinitely. * - * @since CUPS 1.2/Mac OS X 10.5@ + * @since CUPS 1.2/macOS 10.5@ */ ssize_t /* O - Bytes read or -1 on error */ @@ -85,11 +72,11 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read into */ * Read bytes from the pipe... */ -#ifdef WIN32 +#ifdef _WIN32 return ((ssize_t)_read(3, buffer, (unsigned)bytes)); #else return (read(3, buffer, bytes)); -#endif /* WIN32 */ +#endif /* _WIN32 */ } @@ -101,7 +88,7 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read into */ * 0.0 to return immediately if the data cannot be written, -1.0 to wait * indefinitely. * - * @since CUPS 1.2/Mac OS X 10.5@ + * @since CUPS 1.2/macOS 10.5@ */ ssize_t /* O - Bytes written or -1 on error */ @@ -147,11 +134,11 @@ cupsBackChannelWrite( * Write bytes to the pipe... */ -#ifdef WIN32 +#ifdef _WIN32 count = (ssize_t)_write(3, buffer, (unsigned)(bytes - total)); #else count = write(3, buffer, bytes - total); -#endif /* WIN32 */ +#endif /* _WIN32 */ if (count < 0) { @@ -169,7 +156,7 @@ cupsBackChannelWrite( */ buffer += count; - total += count; + total += (size_t)count; } } @@ -178,7 +165,7 @@ cupsBackChannelWrite( /* - * 'cups_setup()' - Setup select() + * 'cups_setup()' - Setup select() */ static void @@ -192,8 +179,3 @@ cups_setup(fd_set *set, /* I - Set for select() */ FD_ZERO(set); FD_SET(3, set); } - - -/* - * End of "$Id: backchannel.c 9042 2010-03-24 00:45:34Z mike $". - */