]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - monitor/bcp.c
Import CUPS v1.7.1
[thirdparty/cups.git] / monitor / bcp.c
index 16054d90b8c4de2c8d7fb6b42e39439c84d1531f..423ab110e941c60cfcea8b2794db7b94c61ef7bc 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: bcp.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id: bcp.c 10996 2013-05-29 11:51:34Z msweet $"
  *
- *   TBCP port monitor for the Common UNIX Printing System (CUPS).
+ *   TBCP port monitor for CUPS.
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 1993-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *
  * Contents:
  *
+ *   main()    - Main entry...
+ *   psgets()  - Get a line from a file.
+ *   pswrite() - Write data from a file.
  */
 
 /*
  * Include necessary headers...
  */
 
-#include <cups/string.h>
-#include <cups/cups.h>
+#include <cups/cups-private.h>
+#include <cups/ppd.h>
 
 
 /*
@@ -55,7 +58,9 @@ main(int  argc,                               /* I - Number of command-line args */
 
   if (argc < 6 || argc > 7)
   {
-    fputs("ERROR: tbcp job-id user title copies options [file]\n", stderr);
+    _cupsLangPrintf(stderr,
+                    _("Usage: %s job-id user title copies options [file]"),
+                   argv[0]);
     return (1);
   }
 
@@ -248,9 +253,19 @@ pswrite(const char *buf,           /* I - Buffer to write */
   for (count = bytes; count > 0; count --, buf ++)
     switch (*buf)
     {
+      case 0x04 : /* CTRL-D */
+          if (bytes == 1)
+         {
+          /*
+           * Don't quote the last CTRL-D...
+           */
+
+           putchar(0x04);
+           break;
+         }
+
       case 0x01 : /* CTRL-A */
       case 0x03 : /* CTRL-C */
-      case 0x04 : /* CTRL-D */
       case 0x05 : /* CTRL-E */
       case 0x11 : /* CTRL-Q */
       case 0x13 : /* CTRL-S */
@@ -273,5 +288,5 @@ pswrite(const char *buf,            /* I - Buffer to write */
 
 
 /*
- * End of "$Id: bcp.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id: bcp.c 10996 2013-05-29 11:51:34Z msweet $".
  */