]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/testsub.c
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / scheduler / testsub.c
index 62156bd17e212e4da34a474c77bb7408621479c6..2475f347c5c4de2fa9caf91b21713034171a7783 100644 (file)
@@ -1,32 +1,14 @@
 /*
- * "$Id: testsub.c 5940 2006-09-11 18:30:09Z mike $"
+ * Scheduler notification tester for CUPS.
  *
- *   Scheduler notification tester for the Common UNIX Printing System (CUPS).
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2006-2007 by Easy Software Products.
  *
- *   Copyright 2006 by Easy Software Products.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
- *
- * Contents:
- *
- *   main()             - Subscribe to the .
- *   print_attributes() - Print the attributes in a request...
- *   sigterm_handler()  - Flag when the user hits CTRL-C...
- *   usage()            - Show program usage...
+ * 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/".
  */
 
 /*
  */
 
 #include <cups/cups.h>
-#include <cups/debug.h>
-#include <cups/string.h>
+#include <cups/debug-private.h>
+#include <cups/string-private.h>
 #include <signal.h>
+#include <cups/ipp-private.h>  /* TODO: Update so we don't need this */
 
 
 /*
@@ -50,9 +33,9 @@ static int    terminate = 0;
  * Local functions...
  */
 
-void           print_attributes(ipp_t *ipp, int indent);
+static void    print_attributes(ipp_t *ipp, int indent);
 static void    sigterm_handler(int sig);
-static void    usage(void);
+static void    usage(void) __attribute__((noreturn));
 
 
 /*
@@ -259,7 +242,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       interval = 5;
 
     ippDelete(response);
-    sleep(interval);
+    sleep((unsigned)interval);
   }
 
  /*
@@ -304,14 +287,14 @@ main(int  argc,                           /* I - Number of command-line arguments */
  * 'print_attributes()' - Print the attributes in a request...
  */
 
-void
+static void
 print_attributes(ipp_t *ipp,           /* I - IPP request */
                  int   indent)         /* I - Indentation */
 {
   int                  i;              /* Looping var */
   ipp_tag_t            group;          /* Current group */
   ipp_attribute_t      *attr;          /* Current attribute */
-  ipp_value_t          *val;           /* Current value */
+  _ipp_value_t         *val;           /* Current value */
   static const char * const tags[] =   /* Value/group tag strings */
                        {
                          "reserved-00",
@@ -443,17 +426,10 @@ print_attributes(ipp_t *ipp,              /* I - IPP request */
 
       case IPP_TAG_DATE :
           {
-           time_t      vtime;          /* Date/Time value */
-           struct tm   *vdate;         /* Date info */
            char        vstring[256];   /* Formatted time */
 
            for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
-           {
-             vtime = ippDateToTime(val->date);
-             vdate = localtime(&vtime);
-             strftime(vstring, sizeof(vstring), "%c", vdate);
-             printf(" (%s)", vstring);
-           }
+             printf(" (%s)", _cupsStrDate(vstring, sizeof(vstring), ippDateToTime(val->date)));
           }
           putchar('\n');
           break;
@@ -461,7 +437,7 @@ print_attributes(ipp_t *ipp,                /* I - IPP request */
       case IPP_TAG_RESOLUTION :
           for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
            printf(" %dx%d%s", val->resolution.xres, val->resolution.yres,
-                  val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpc");
+                  val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
           putchar('\n');
           break;
 
@@ -523,9 +499,3 @@ usage(void)
   puts("Usage: testsub [-E] [-e event ... -e eventN] [-h hostname] URI");
   exit(0);
 }
-
-
-
-/*
- * End of "$Id: testsub.c 5940 2006-09-11 18:30:09Z mike $".
- */