/*
- * "$Id: statbuf.c 177 2006-06-21 00:20:03Z jlovell $"
+ * "$Id: statbuf.c 7674 2008-06-18 23:18:32Z mike $"
*
* Status buffer routines for the Common UNIX Printing System (CUPS)
* scheduler.
*
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* 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
+ * 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:
*
- * cupsdStatBufNew() - Create a new status buffer.
* cupsdStatBufDelete() - Destroy a status buffer.
+ * cupsdStatBufNew() - Create a new status buffer.
* cupsdStatBufUpdate() - Update the status buffer.
*/
#include <stdarg.h>
+/*
+ * 'cupsdStatBufDelete()' - Destroy a status buffer.
+ */
+
+void
+cupsdStatBufDelete(cupsd_statbuf_t *sb) /* I - Status buffer */
+{
+ /*
+ * Range check input...
+ */
+
+ if (!sb)
+ return;
+
+ /*
+ * Close the status pipe and free memory used...
+ */
+
+ close(sb->fd);
+
+ free(sb);
+}
+
+
/*
* 'cupsdStatBufNew()' - Create a new status buffer.
*/
}
-/*
- * 'cupsdStatBufDelete()' - Destroy a status buffer.
- */
-
-void
-cupsdStatBufDelete(cupsd_statbuf_t *sb) /* I - Status buffer */
-{
- /*
- * Range check input...
- */
-
- if (!sb)
- return;
-
- /*
- * Close the status pipe and free memory used...
- */
-
- close(sb->fd);
-
- free(sb);
-}
-
-
/*
* 'cupsdStatBufUpdate()' - Update the status buffer.
*/
lineptr = NULL;
}
- if (lineptr == NULL)
+ if (!lineptr)
{
/*
* End of file...
*loglevel = CUPSD_LOG_ATTR;
message = sb->buffer + 5;
}
+ else if (!strncmp(sb->buffer, "PPD:", 4))
+ {
+ *loglevel = CUPSD_LOG_PPD;
+ message = sb->buffer + 4;
+ }
else
{
*loglevel = CUPSD_LOG_DEBUG;
* Send it to the log file as needed...
*/
- if (*loglevel > CUPSD_LOG_NONE &&
- (*loglevel != CUPSD_LOG_INFO || LogLevel == CUPSD_LOG_DEBUG2))
+ if (sb->prefix[0])
{
- /*
- * General status message; send it to the error_log file...
- */
+ if (*loglevel > CUPSD_LOG_NONE &&
+ (*loglevel != CUPSD_LOG_INFO || LogLevel == CUPSD_LOG_DEBUG2))
+ {
+ /*
+ * General status message; send it to the error_log file...
+ */
- if (message[0] == '[')
- cupsdLogMessage(*loglevel, "%s", message);
- else
- cupsdLogMessage(*loglevel, "%s %s", sb->prefix, message);
+ if (message[0] == '[')
+ cupsdLogMessage(*loglevel, "%s", message);
+ else
+ cupsdLogMessage(*loglevel, "%s %s", sb->prefix, message);
+ }
+ else if (*loglevel < CUPSD_LOG_NONE && LogLevel == CUPSD_LOG_DEBUG2)
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "%s %s", sb->prefix, sb->buffer);
}
- else if (*loglevel < CUPSD_LOG_NONE && LogLevel == CUPSD_LOG_DEBUG2)
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "%s %s", sb->prefix, sb->buffer);
/*
* Copy the message to the line buffer...
/*
- * End of "$Id: statbuf.c 177 2006-06-21 00:20:03Z jlovell $".
+ * End of "$Id: statbuf.c 7674 2008-06-18 23:18:32Z mike $".
*/