parent
a65fd65a1e
commit
fcb8977096
@ -0,0 +1,22 @@
|
||||
diff -urN cnijfilter-source-3.70-1.old/backend/src/Makefile.am cnijfilter-source-3.70-1/backend/src/Makefile.am
|
||||
--- cnijfilter-source-3.70-1.old/backend/src/Makefile.am 2012-12-22 11:09:21.674631729 +0100
|
||||
+++ cnijfilter-source-3.70-1/backend/src/Makefile.am 2012-12-22 14:20:50.879566578 +0100
|
||||
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
-backend_bindir = /usr/lib/cups/backend
|
||||
+backend_bindir = /usr/libexec/cups/backend
|
||||
backend_bin_PROGRAMS = cnijusb
|
||||
transform =
|
||||
|
||||
diff -urN cnijfilter-source-3.70-1.old/backendnet/backend/Makefile.am cnijfilter-source-3.70-1/backendnet/backend/Makefile.am
|
||||
--- cnijfilter-source-3.70-1.old/backendnet/backend/Makefile.am 2012-12-22 11:09:21.673631729 +0100
|
||||
+++ cnijfilter-source-3.70-1/backendnet/backend/Makefile.am 2012-12-22 14:20:20.176569425 +0100
|
||||
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
-backendnet_bindir = /usr/lib/cups/backend
|
||||
+backendnet_bindir = /usr/libexec/cups/backend
|
||||
backendnet_bin_PROGRAMS = cnijnet
|
||||
transform =
|
||||
|
@ -0,0 +1,9 @@
|
||||
diff -urN cnijfilter-source-3.70-1.old/pstocanonij/filter/Makefile.am cnijfilter-source-3.70-1/pstocanonij/filter/Makefile.am
|
||||
--- cnijfilter-source-3.70-1.old/pstocanonij/filter/Makefile.am 2012-12-21 17:27:54.370964561 +0100
|
||||
+++ cnijfilter-source-3.70-1/pstocanonij/filter/Makefile.am 2012-12-21 18:22:48.804097963 +0100
|
||||
@@ -1,4 +1,4 @@
|
||||
-filterdir=$(libdir)/cups/filter
|
||||
+filterdir=$(libexecdir)/cups/filter
|
||||
|
||||
filter_PROGRAMS= pstocanonij
|
||||
|
@ -0,0 +1,22 @@
|
||||
--- cnijfilter-3.70/cnijfilter/src/bjfimage.c 2011-09-22 04:33:34.000000000 +0200
|
||||
+++ cnijfilter-3.70/cnijfilter/src/bjfimage.c 2012-09-15 16:22:38.000000000 +0200
|
||||
@@ -1520,8 +1520,8 @@
|
||||
short tmpformat;
|
||||
short retbyte = 0;
|
||||
short bpp = 3;
|
||||
- long width = 0;
|
||||
- long length = 0;
|
||||
+ png_uint_32 width = 0;
|
||||
+ png_uint_32 length = 0;
|
||||
long rstep = 0;
|
||||
long RasterLength = 0;
|
||||
long i;
|
||||
@@ -1574,7 +1574,7 @@
|
||||
goto onErr;
|
||||
}
|
||||
|
||||
- if (setjmp (png_p->jmpbuf))
|
||||
+ if (setjmp (png_jmpbuf(png_p)))
|
||||
{
|
||||
png_destroy_read_struct(&png_p, &info_p, (png_infopp)NULL);
|
||||
goto onErr;
|
@ -0,0 +1,11 @@
|
||||
diff -urN cnijfilter-source-3.70-1.old/cngpijmon/src/bjcupsmon_cups.c cnijfilter-source-3.70-1/cngpijmon/src/bjcupsmon_cups.c
|
||||
--- cnijfilter-source-3.70-1.old/cngpijmon/src/bjcupsmon_cups.c 2012-12-21 17:27:54.599964570 +0100
|
||||
+++ cnijfilter-source-3.70-1/cngpijmon/src/bjcupsmon_cups.c 2012-12-21 17:28:42.076966493 +0100
|
||||
@@ -20,6 +20,7 @@
|
||||
/*** Includes ***/
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
+#include <cups/ppd.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
@ -0,0 +1,11 @@
|
||||
diff -urN cnijfilter-source-3.70-1.old/backend/src/cnij_backend_common.c cnijfilter-source-3.70-1/backend/src/cnij_backend_common.c
|
||||
--- cnijfilter-source-3.70-1.old/backend/src/cnij_backend_common.c 2012-12-22 11:09:21.674631729 +0100
|
||||
+++ cnijfilter-source-3.70-1/backend/src/cnij_backend_common.c 2012-12-22 11:11:31.903619656 +0100
|
||||
@@ -38,6 +38,7 @@
|
||||
// CUPS Header
|
||||
#include <cups/cups.h>
|
||||
#include <cups/ipp.h>
|
||||
+#include <cups/ppd.h>
|
||||
|
||||
// Header file for CANON
|
||||
#include "cnij_backend_common.h"
|
@ -0,0 +1,90 @@
|
||||
diff -ur cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c cnijfilter-source-3.80-1.new/cngpij/cngpij/bjcups.c
|
||||
--- cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c
|
||||
+++ cnijfilter-source-3.80-1.new/cngpij/cngpij/bjcups.c
|
||||
@@ -66,6 +66,27 @@
|
||||
|
||||
char* g_printer_name = NULL;
|
||||
|
||||
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
|
||||
+#define HAVE_CUPS_1_6 1
|
||||
+#endif
|
||||
+
|
||||
+#ifndef HAVE_CUPS_1_6
|
||||
+
|
||||
+#define ippSetOperation(ipp_request, ipp_op_id) ipp_request->request.op.operation_id = ipp_op_id
|
||||
+#define ippSetRequestId(ipp_request, ipp_rq_id) ipp_request->request.op.request_id = ipp_rq_id
|
||||
+#define ippGetStatusCode(ipp_request) ipp_request->request.status.status_code
|
||||
+#define ippFirstAttribute(ipp) ipp->attrs /* simplistic */
|
||||
+#define bjcups_ippNextAttribute(resp, attr) attr->next
|
||||
+#define ippGetGroupTag(attr) attr->group_tag
|
||||
+#define ippGetName(attr) attr->name
|
||||
+#define ippGetString(attr, ind, lang) attr->values[ind].string.text
|
||||
+#define ippGetValueTag(attr) attr->value_tag
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#define bjcups_ippNextAttribute(resp, attr) ippNextAttribute(resp)
|
||||
+
|
||||
+#endif
|
||||
|
||||
extern int GetIPCData(LPIPCU pipc, char *sname);
|
||||
static short getDeviceURI( const char *pDestName, char *pDeviceURI, short bufSize);
|
||||
@@ -698,8 +719,8 @@
|
||||
else {
|
||||
pRequest = ippNew();
|
||||
|
||||
- pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
- pRequest->request.op.request_id = 1;
|
||||
+ ippSetOperation(pRequest, CUPS_GET_PRINTERS);
|
||||
+ ippSetRequestId(pRequest, 1);
|
||||
|
||||
pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
|
||||
|
||||
@@ -708,29 +729,29 @@
|
||||
ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL);
|
||||
|
||||
if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
|
||||
- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
|
||||
+ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
|
||||
fputs("ERROR: IPP ERROR\n", stderr);
|
||||
goto onErr;
|
||||
}
|
||||
else {
|
||||
- pAttribute = pResponse->attrs;
|
||||
+ pAttribute = ippFirstAttribute(pResponse);
|
||||
|
||||
while (pAttribute != NULL) {
|
||||
- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
|
||||
- pAttribute = pAttribute->next;
|
||||
+ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
|
||||
+ pAttribute = bjcups_ippNextAttribute(pResponse, pAttribute);
|
||||
}
|
||||
if (pAttribute == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
|
||||
- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
|
||||
- pPrinter = pAttribute->values[0].string.text;
|
||||
+ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
|
||||
+ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
|
||||
+ pPrinter = ippGetString(pAttribute, 0, NULL);
|
||||
}
|
||||
- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
|
||||
- pDUri = pAttribute->values[0].string.text;
|
||||
+ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
|
||||
+ pDUri = ippGetString(pAttribute, 0, NULL);
|
||||
}
|
||||
- pAttribute = pAttribute->next;
|
||||
+ pAttribute = bjcups_ippNextAttribute(pResponse, pAttribute);
|
||||
}
|
||||
|
||||
if (strcasecmp(pDestName, pPrinter) == 0) {
|
||||
@@ -739,7 +760,7 @@
|
||||
}
|
||||
|
||||
if (pAttribute != NULL)
|
||||
- pAttribute = pAttribute->next;
|
||||
+ pAttribute = bjcups_ippNextAttribute(pResponse, pAttribute);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue