/*
- * "$Id: cups-lpd.c 6723 2007-07-25 17:29:58Z mike $"
+ * "$Id: cups-lpd.c 6781 2007-08-08 21:09:31Z mike $"
*
* Line Printer Daemon interface for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * 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
name = dest;
}
+ else
+ {
+ /*
+ * Get values from the response...
+ */
- /*
- * Get values from the response...
- */
+ if (accepting)
+ {
+ if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs",
+ IPP_TAG_BOOLEAN)) == NULL)
+ syslog(LOG_ERR, "No printer-is-accepting-jobs attribute found in "
+ "response from server!");
+ else
+ *accepting = attr->values[0].boolean;
+ }
- if (accepting)
- {
- if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs",
- IPP_TAG_BOOLEAN)) == NULL)
- syslog(LOG_ERR, "No printer-is-accepting-jobs attribute found in "
- "response from server!");
- else
- *accepting = attr->values[0].boolean;
- }
+ if (shared)
+ {
+ if ((attr = ippFindAttribute(response, "printer-is-shared",
+ IPP_TAG_BOOLEAN)) == NULL)
+ {
+ syslog(LOG_ERR, "No printer-is-shared attribute found in "
+ "response from server!");
+ *shared = 1;
+ }
+ else
+ *shared = attr->values[0].boolean;
+ }
- if (shared)
- {
- if ((attr = ippFindAttribute(response, "printer-is-shared",
- IPP_TAG_BOOLEAN)) == NULL)
+ if (state)
{
- syslog(LOG_ERR, "No printer-is-shared attribute found in "
- "response from server!");
- *shared = 1;
+ if ((attr = ippFindAttribute(response, "printer-state",
+ IPP_TAG_ENUM)) == NULL)
+ syslog(LOG_ERR, "No printer-state attribute found in "
+ "response from server!");
+ else
+ *state = (ipp_pstate_t)attr->values[0].integer;
}
- else
- *shared = attr->values[0].boolean;
- }
- if (state)
- {
- if ((attr = ippFindAttribute(response, "printer-state",
- IPP_TAG_ENUM)) == NULL)
- syslog(LOG_ERR, "No printer-state attribute found in "
- "response from server!");
- else
- *state = (ipp_pstate_t)attr->values[0].integer;
+ ippDelete(response);
}
- ippDelete(response);
-
/*
* Override shared value for LPD using system-specific APIs...
*/
if (status)
break;
}
-
- fclose(fp);
}
+
+ fclose(fp);
}
}
/*
- * End of "$Id: cups-lpd.c 6723 2007-07-25 17:29:58Z mike $".
+ * End of "$Id: cups-lpd.c 6781 2007-08-08 21:09:31Z mike $".
*/