openbsd-ports/x11/xfce4/xfprint/patches/patch-printing-systems_cups_cups_c
2012-08-04 14:48:18 +00:00

57 lines
2.2 KiB
Plaintext

$OpenBSD: patch-printing-systems_cups_cups_c,v 1.1 2012/08/04 14:48:18 ajacoutot Exp $
Fix build with cups >= 1.6.0
--- printing-systems/cups/cups.c.orig Tue Feb 24 22:34:16 2009
+++ printing-systems/cups/cups.c Mon Jul 30 14:11:22 2012
@@ -133,8 +133,8 @@ cups_request_new (int operation_id)
language = cupsLangDefault ();
request = ippNew ();
- request->request.op.operation_id = operation_id;
- request->request.op.request_id = 1;
+ ippSetOperation(request, operation_id);
+ ippSetRequestId(request, 1);
ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
@@ -242,24 +242,24 @@ get_printers ()
if (!request)
continue;
- if (request->state == IPP_ERROR || request->state == IPP_IDLE) {
+ if (ippGetState (request) == IPP_ERROR || ippGetState (request) == IPP_IDLE) {
ippDelete (request);
continue;
}
attr = ippFindAttribute (request, "printer-info", IPP_TAG_TEXT);
- if (!attr || strlen (attr->values[0].string.text) == 0) {
+ if (!attr || strlen (ippGetString (attr, 0, NULL)) == 0) {
attr = ippFindAttribute (request, "printer-make-and-model", IPP_TAG_TEXT);
if (attr)
- printer->alias = g_strdup (attr->values[0].string.text);
+ printer->alias = g_strdup (ippGetString (attr, 0, NULL));
else
printer->alias = g_strdup ("");
}
else
- printer->alias = g_strdup (attr->values[0].string.text);
+ printer->alias = g_strdup (ippGetString (attr, 0, NULL));
attr = ippFindAttribute (request, "printer-type", IPP_TAG_ENUM);
- if (attr && (attr->values[0].integer & CUPS_PRINTER_CLASS))
+ if (attr && (ippGetInteger (attr, 0) & CUPS_PRINTER_CLASS))
printer->type = PRINTER_TYPE_CLASS;
else
printer->type = PRINTER_TYPE_PRINTER;
@@ -309,7 +309,7 @@ get_printer_state (const gchar * printer)
ipp_attribute_t *attr = ippFindAttribute (request, "printer-state",
IPP_TAG_ENUM);
if (attr)
- switch (attr->values[0].integer) {
+ switch (ippGetInteger (attr, 0)) {
case IPP_PRINTER_IDLE:
state = PRINTER_STATE_IDLE;
break;