Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ru gtklp-1.3.0.orig/gtklp/gtklp_functions.c gtklp-1.3.0/gtklp/gtklp_functions.c
- --- gtklp-1.3.0.orig/gtklp/gtklp_functions.c 2013-03-12 12:18:31.000000000 -0500
- +++ gtklp-1.3.0/gtklp/gtklp_functions.c 2013-07-24 13:40:28.000000000 -0500
- @@ -172,9 +172,8 @@
- if(z1 != NULL)
- *z1='/';
- - request=ippNew();
- - ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES);
- - ippSetRequestId(request, 1);
- + request=ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
- + request->request.op.request_id = 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);
- @@ -194,7 +193,7 @@
- }
- else
- {
- - bannerAnz=ippGetCount(attr);
- + bannerAnz=attr->num_values;
- if(bannerAnz > MAX_BANNER)
- {
- if(DEBUG)
- @@ -206,8 +205,8 @@
- for(i1=0;i1<bannerAnz;i1++)
- {
- if(DEBUG)
- - printf(" %s\n",ippGetString (attr, i1, NULL));
- - strncpy(Banners[i1],(char *)ippGetString (attr, i1, NULL),(size_t)MAXLINE);
- + printf(" %s\n",attr->values[i1].string.text);
- + strncpy(Banners[i1],(char *)attr->values[i1].string.text,(size_t)MAXLINE);
- bannerList=g_list_append(bannerList,(gchar *)str2str(Banners[i1]));
- }
- }
- diff -ru gtklp-1.3.0.orig/gtklpq/printer.c gtklp-1.3.0/gtklpq/printer.c
- --- gtklp-1.3.0.orig/gtklpq/printer.c 2013-03-12 12:18:31.000000000 -0500
- +++ gtklp-1.3.0/gtklpq/printer.c 2013-07-24 13:58:19.000000000 -0500
- @@ -344,9 +344,7 @@
- gtk_statusbar_remove ((GtkStatusbar *) statbar, c_id_state, m_id_state);
- }
- - request = ippNew ();
- - ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES);
- - ippSetRequestId(request, 1);
- + request = ippNewRequest (IPP_GET_PRINTER_ATTRIBUTES);
- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
- "attributes-charset", NULL, cupsLangEncoding (cupsLanguage));
- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
- @@ -360,7 +358,7 @@
- != NULL)
- {
- aktPrinterHold=0;
- - switch (ippGetInteger (attr, 0))
- + switch (attr->values[0].integer)
- {
- case IPP_PRINTER_IDLE:
- strncpy (toolstring, str2str(_("Printer Idle")),(size_t)MAXLINE);
- @@ -373,17 +371,17 @@
- aktPrinterHold=1;
- break;
- default:
- - snprintf (toolstring, (size_t)MAXLINE, "%i", ippGetInteger (attr, 0));
- + snprintf (toolstring, (size_t)MAXLINE, "%i", attr->values[0].integer);
- break;
- }
- jobsRejected=0;
- attr = ippFindAttribute (response, "printer-is-accepting-jobs", IPP_TAG_ZERO);
- if(attr != NULL) {
- - if(ippGetInteger (attr, 0) == 0)
- + if(attr->values[0].integer == 0)
- jobsRejected=1;
- if(DEBUG)
- - printf("Attr=printer-is-accepting-jobs: %i\n",ippGetInteger (attr, 0));
- + printf("Attr=printer-is-accepting-jobs: %i\n",attr->values[0].integer);
- }
- if(nox == 0) {
- @@ -429,8 +427,8 @@
- if ( (attr = ippFindAttribute (response, "printer-state-message", IPP_TAG_ZERO)) != NULL)
- {
- - if ((strlen (toolstring) + strlen (ippGetString (attr, 0, NULL))) < MAXLINE)
- - snprintf (toolstring, (size_t)MAXLINE, "%s - %s", toolstring, ippGetString (attr, 0, NULL));
- + if ((strlen (toolstring) + strlen (attr->values[0].string.text)) < MAXLINE)
- + snprintf (toolstring, (size_t)MAXLINE, "%s - %s", toolstring, attr->values[0].string.text);
- }
- if(nox == 0)
- m_id_state = gtk_statusbar_push ((GtkStatusbar *) statbar, c_id_state, (const char *) str2str(toolstring));
- @@ -520,7 +518,7 @@
- }
- request = ippNewRequest(IPP_GET_JOBS);
- - ippSetRequestId(request, 1);
- + request->request.op.request_id = 1;
- language = cupsLangDefault ();
- @@ -563,12 +561,12 @@
- if ((response = cupsDoRequest (cupsHttp, request, "/")) != NULL)
- {
- - if (ippGetStatusCode(response) > IPP_OK_CONFLICT)
- + if (response->request.status.status_code > IPP_OK_CONFLICT)
- {
- if(nox == 0)
- - m_id_upd = gtk_statusbar_push ((GtkStatusbar *) statbar, c_id_upd, str2str((char *)ippErrorString(ippGetStatusCode(response))));
- + m_id_upd = gtk_statusbar_push ((GtkStatusbar *) statbar, c_id_upd, str2str((char *)ippErrorString(response->request.status.status_code)));
- else
- - g_print("[%s] %s: %s\n\n",PrinterNames[PrinterChoice], str2str(_("Error")),ippErrorString (ippGetStatusCode(response)));
- + g_print("[%s] %s: %s\n\n",PrinterNames[PrinterChoice], str2str(_("Error")),ippErrorString (response->request.status.status_code));
- ippDelete (response);
- return(FALSE);
- }
- @@ -637,10 +635,10 @@
- }
- rank = 1;
- - for (attr = ippFirstAttribute (response); attr != NULL; attr = ippNextAttribute (response))
- + for (attr = response->attrs; attr != NULL; attr = attr->next)
- {
- - while (attr != NULL && ippGetGroupTag (attr) != IPP_TAG_JOB)
- - attr = ippNextAttribute (response);
- + while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
- + attr = attr->next;
- if (attr == NULL)
- break;
- @@ -653,32 +651,32 @@
- jobdest = NULL;
- jobcopies = 1;
- - while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_JOB)
- + while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
- {
- - if (strcmp (ippGetName (attr), "job-id") == 0 && ippGetValueTag (attr) == IPP_TAG_INTEGER)
- - jobid = ippGetInteger (attr, 0);
- + if (strcmp (attr->name, "job-id") == 0 && attr->value_tag == IPP_TAG_INTEGER)
- + jobid = attr->values[0].integer;
- - if (strcmp (ippGetName (attr), "job-k-octets") == 0 && ippGetValueTag (attr) == IPP_TAG_INTEGER)
- - jobsize = ippGetInteger (attr, 0) * 1024;
- + if (strcmp (attr->name, "job-k-octets") == 0 && attr->value_tag == IPP_TAG_INTEGER)
- + jobsize = attr->values[0].integer * 1024;
- - if (strcmp (ippGetName (attr), "job-state") == 0 && ippGetValueTag (attr) == IPP_TAG_ENUM)
- - jobstate = (ipp_jstate_t) ippGetInteger (attr, 0);
- + if (strcmp (attr->name, "job-state") == 0 && attr->value_tag == IPP_TAG_ENUM)
- + jobstate = (ipp_jstate_t) attr->values[0].integer;
- - if (strcmp (ippGetName (attr), "job-printer-uri") == 0 && ippGetValueTag (attr) == IPP_TAG_URI)
- - if ((jobdest = strrchr (ippGetString (attr, 0, NULL), '/')) != NULL)
- + if (strcmp (attr->name, "job-printer-uri") == 0 && attr->value_tag == IPP_TAG_URI)
- + if ((jobdest = strrchr (attr->values[0].string.text, '/')) != NULL)
- jobdest++;
- - if (strcmp (ippGetName (attr), "job-originating-user-name") == 0 && ippGetValueTag (attr) == IPP_TAG_NAME)
- - jobuser = ippGetString (attr, 0, NULL);
- + if (strcmp (attr->name, "job-originating-user-name") == 0 && attr->value_tag == IPP_TAG_NAME)
- + jobuser = attr->values[0].string.text;
- - if (strcmp (ippGetName (attr), "job-name") == 0 && ippGetValueTag (attr) == IPP_TAG_NAME)
- - jobname = ippGetString (attr, 0, NULL);
- + if (strcmp (attr->name, "job-name") == 0 && attr->value_tag == IPP_TAG_NAME)
- + jobname = attr->values[0].string.text;
- - if (strcmp (ippGetName (attr), "copies") == 0 && ippGetValueTag (attr) == IPP_TAG_INTEGER)
- - jobcopies = ippGetInteger (attr, 0);
- + if (strcmp (attr->name, "copies") == 0 && attr->value_tag == IPP_TAG_INTEGER)
- + jobcopies = attr->values[0].integer;
- - attr = ippNextAttribute (response);
- + attr = attr->next;
- }
- if (jobdest == NULL || jobid == 0)
- @@ -1085,9 +1083,8 @@
- char uri[MAX_URI+1];
- cups_lang_t *language;
- - request = ippNew();
- - ippSetOperation(request, IPP_SET_JOB_ATTRIBUTES);
- - ippSetRequestId(request, 1);
- + request = ippNewRequest(IPP_SET_JOB_ATTRIBUTES);
- + request->request.op.request_id = 1;
- language = cupsLangDefault ();
- @@ -1115,10 +1112,10 @@
- if ((response = cupsDoRequest(cupsHttp, request, "/jobs")) != NULL)
- {
- - if (ippGetStatusCode (response) > IPP_OK_CONFLICT)
- + if (response->request.status.status_code > IPP_OK_CONFLICT)
- {
- if(DEBUG)
- - printf("set-job-attributes failed(1): %s\n",ippErrorString(ippGetStatusCode (response)));
- + printf("set-job-attributes failed(1): %s\n",ippErrorString(response->request.status.status_code));
- quick_message(str2str(_("Unable to change priority!")),2);
- ippDelete(response);
- return (1);
- @@ -1239,9 +1236,8 @@
- if(dialog != (GtkWidget *)NULL)
- gtk_widget_destroy (dialog);
- - request = ippNew ();
- - ippSetOperation(request, op);
- - ippSetRequestId(request, 1);
- + request = ippNewRequest (op);
- + request->request.op.request_id = 1;
- language = cupsLangDefault ();
- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
- "attributes-charset", NULL,
- @@ -1307,7 +1303,7 @@
- if (response != NULL)
- {
- - switch (ippGetStatusCode (response))
- + switch (response->request.status.status_code)
- {
- case IPP_NOT_FOUND:
- quick_message(str2str(_("Job or printer not found!")),2);
- @@ -1319,7 +1315,7 @@
- quick_message(str2str(_("You don't own this job!")),2);
- break;
- default:
- - if (ippGetStatusCode (response) > IPP_OK_CONFLICT)
- + if (response->request.status.status_code > IPP_OK_CONFLICT)
- quick_message(str2str(_("Unable to do so!")),2);
- break;
- }
- diff -ru gtklp-1.3.0.orig/libgtklp/libgtklp.c gtklp-1.3.0/libgtklp/libgtklp.c
- --- gtklp-1.3.0.orig/libgtklp/libgtklp.c 2013-03-12 12:18:31.000000000 -0500
- +++ gtklp-1.3.0/libgtklp/libgtklp.c 2013-07-24 13:40:38.000000000 -0500
- @@ -407,9 +407,8 @@
- PrinterChoice=i1-droppedPrinters;
- }
- snprintf(URI,(size_t)MAX_URI,"ipp://%s/printers/%s",ServerAddr,dests[i1].name);
- - request=ippNew();
- - ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES);
- - ippSetRequestId(request, 1);
- + request=ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
- + request->request.op.request_id = 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);
- @@ -422,9 +421,9 @@
- 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,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);
- + 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);
- }
- else
- @@ -437,8 +436,8 @@
- if((attr=ippFindAttribute(response,"printer-location",IPP_TAG_ZERO)) != NULL)
- {
- if(DEBUG)
- - printf("Location: %s\n",ippGetString (attr, 0, NULL));
- - strncpy(PrinterLocations[i1-droppedPrinters],ippGetString (attr, 0, NULL),(size_t)MAXLINE);
- + printf("Location: %s\n",attr->values[0].string.text);
- + strncpy(PrinterLocations[i1-droppedPrinters],attr->values[0].string.text,(size_t)MAXLINE);
- }
- else
- {
- @@ -448,8 +447,8 @@
- if((attr=ippFindAttribute(response,"printer-info",IPP_TAG_ZERO)) != NULL)
- {
- if(DEBUG)
- - printf("Info: %s\n",ippGetString (attr, 0, NULL));
- - strncpy(PrinterInfos[i1-droppedPrinters],ippGetString (attr, 0, NULL),(size_t)MAXLINE);
- + printf("Info: %s\n",attr->values[0].string.text);
- + strncpy(PrinterInfos[i1-droppedPrinters],attr->values[0].string.text,(size_t)MAXLINE);
- }
- else
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement