53 lines
2.6 KiB
Plaintext
53 lines
2.6 KiB
Plaintext
$OpenBSD: patch-libgtklp_libgtklp_c,v 1.1 2012/08/15 13:22:29 ajacoutot Exp $
|
|
|
|
Fix build with cups >= 1.6.0
|
|
|
|
--- libgtklp/libgtklp.c.orig Wed Aug 15 14:48:25 2012
|
|
+++ libgtklp/libgtklp.c Wed Aug 15 14:51:01 2012
|
|
@@ -345,8 +345,8 @@ void getPrinters(int loop)
|
|
}
|
|
snprintf(URI,(size_t)MAX_URI,"ipp://%s/printers/%s",ServerName,dests[i1].name);
|
|
request=ippNew();
|
|
- request->request.op.operation_id=IPP_GET_PRINTER_ATTRIBUTES;
|
|
- request->request.op.request_id=1;
|
|
+ ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES);
|
|
+ ippSetRequestId(request, 1);
|
|
ippAddString(request,IPP_TAG_OPERATION,IPP_TAG_CHARSET,"attributes-charset",NULL,cupsLangEncoding(cupsLanguage));
|
|
ippAddString(request,IPP_TAG_OPERATION,IPP_TAG_LANGUAGE,"attributes-natural-language",NULL,cupsLanguage->language);
|
|
ippAddString(request,IPP_TAG_OPERATION,IPP_TAG_URI,"printer-uri",NULL,URI);
|
|
@@ -359,9 +359,9 @@ void getPrinters(int loop)
|
|
if((attr=ippFindAttribute(response,"job-sheets-default",IPP_TAG_ZERO)) != NULL)
|
|
{
|
|
if(DEBUG)
|
|
- printf("Job-Sheets-Default for %s\n Start: %s\n Stop: %s\n",dests[i1].name,attr->values[0].string.text,attr->values[1].string.text);
|
|
- strncpy(PrinterBannerStart[i1-droppedPrinters],attr->values[0].string.text,(size_t)MAXLINE);
|
|
- strncpy(PrinterBannerEnd[i1-droppedPrinters],attr->values[1].string.text,(size_t)MAXLINE);
|
|
+ printf("Job-Sheets-Default for %s\n Start: %s\n Stop: %s\n",dests[i1].name,ippGetString (attr, 0, NULL),ippGetString (attr, 1, NULL));
|
|
+ strncpy(PrinterBannerStart[i1-droppedPrinters],ippGetString (attr, 0, NULL),(size_t)MAXLINE);
|
|
+ strncpy(PrinterBannerEnd[i1-droppedPrinters],ippGetString (attr, 1, NULL),(size_t)MAXLINE);
|
|
}
|
|
else
|
|
{
|
|
@@ -373,8 +373,8 @@ void getPrinters(int loop)
|
|
if((attr=ippFindAttribute(response,"printer-location",IPP_TAG_ZERO)) != NULL)
|
|
{
|
|
if(DEBUG)
|
|
- printf("Location: %s\n",attr->values[0].string.text);
|
|
- strncpy(PrinterLocations[i1-droppedPrinters],attr->values[0].string.text,(size_t)MAXLINE);
|
|
+ printf("Location: %s\n",ippGetString (attr, 0, NULL));
|
|
+ strncpy(PrinterLocations[i1-droppedPrinters],ippGetString (attr, 0, NULL),(size_t)MAXLINE);
|
|
}
|
|
else
|
|
{
|
|
@@ -384,8 +384,8 @@ void getPrinters(int loop)
|
|
if((attr=ippFindAttribute(response,"printer-info",IPP_TAG_ZERO)) != NULL)
|
|
{
|
|
if(DEBUG)
|
|
- printf("Info: %s\n",attr->values[0].string.text);
|
|
- strncpy(PrinterInfos[i1-droppedPrinters],attr->values[0].string.text,(size_t)MAXLINE);
|
|
+ printf("Info: %s\n",ippGetString (attr, 0, NULL));
|
|
+ strncpy(PrinterInfos[i1-droppedPrinters],ippGetString (attr, 0, NULL),(size_t)MAXLINE);
|
|
}
|
|
else
|
|
{
|