/*
- * "$Id: testsub.c 6649 2007-07-11 21:46:42Z 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 2007 by Apple Inc.
- * Copyright 2006-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/".
- *
- * 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...
+ * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
/*
*/
#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 */
/*
static void print_attributes(ipp_t *ipp, int indent);
static void sigterm_handler(int sig);
-static void usage(void);
+static void usage(void) _CUPS_NORETURN;
/*
interval = 5;
ippDelete(response);
- sleep(interval);
+ sleep((unsigned)interval);
}
/*
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",
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;
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;
puts("Usage: testsub [-E] [-e event ... -e eventN] [-h hostname] URI");
exit(0);
}
-
-
-
-/*
- * End of "$Id: testsub.c 6649 2007-07-11 21:46:42Z mike $".
- */