diff -ura cnijfilter-source-3.80-1/backend/src/cnij_backend_common.c cnijfilter-source-3.80-1_patched/backend/src/cnij_backend_common.c --- cnijfilter-source-3.80-1/backend/src/cnij_backend_common.c 2012-03-29 05:50:27.000000000 +0100 +++ cnijfilter-source-3.80-1_patched/backend/src/cnij_backend_common.c 2018-08-08 22:51:15.721515633 +0100 @@ -38,6 +38,7 @@ // CUPS Header #include #include +#include // Header file for CANON #include "cnij_backend_common.h" diff -ura cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c cnijfilter-source-3.80-1_patched/cngpij/cngpij/bjcups.c --- cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c 2012-04-17 04:39:20.000000000 +0100 +++ cnijfilter-source-3.80-1_patched/cngpij/cngpij/bjcups.c 2018-08-08 22:52:24.107765920 +0100 @@ -21,6 +21,7 @@ #include #endif // HAVE_CONFIG_H +#define _IPP_PRIVATE_STRUCTURES 1 #include #include #include diff -ura cnijfilter-source-3.80-1/cngpijmnt/src/main.c cnijfilter-source-3.80-1_patched/cngpijmnt/src/main.c --- cnijfilter-source-3.80-1/cngpijmnt/src/main.c 2012-04-26 10:49:34.000000000 +0100 +++ cnijfilter-source-3.80-1_patched/cngpijmnt/src/main.c 2018-08-08 23:45:18.929408652 +0100 @@ -21,6 +21,7 @@ #include #endif // HAVE_CONFIG_H +#define _IPP_PRIVATE_STRUCTURES 1 #include #include #include diff -ura cnijfilter-source-3.80-1/cngpijmon/src/bjcupsmon_cups.c cnijfilter-source-3.80-1_patched/cngpijmon/src/bjcupsmon_cups.c --- cnijfilter-source-3.80-1/cngpijmon/src/bjcupsmon_cups.c 2012-05-22 10:49:27.000000000 +0100 +++ cnijfilter-source-3.80-1_patched/cngpijmon/src/bjcupsmon_cups.c 2018-08-08 22:53:50.693927746 +0100 @@ -18,6 +18,7 @@ */ /*** Includes ***/ +#define _IPP_PRIVATE_STRUCTURES 1 #include #include #include diff -ura cnijfilter-source-3.80-1/cnijfilter/src/bjfimage.c cnijfilter-source-3.80-1_patched/cnijfilter/src/bjfimage.c --- cnijfilter-source-3.80-1/cnijfilter/src/bjfimage.c 2012-03-22 02:50:19.000000000 +0100 +++ cnijfilter-source-3.80-1_patched/cnijfilter/src/bjfimage.c 2018-08-08 22:57:36.022705896 +0100 @@ -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; diff -ura cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c cnijfilter-source-3.80-1_patched/cngpij/cngpij/bjcups.c --- cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c 2012-03-22 02:50:19.000000000 +0100 +++ cnijfilter-source-3.80-1_patched/cngpij/cngpij/bjcups.c 2020-05-03 21:47:17.827711720 +0200 @@ -659,24 +659,6 @@ } } - - -static cups_lang_t * bjcupsLangDefault( ) -{ - cups_lang_t *pLanguage; - char *tLang; - - if( (tLang = getenv("LC_ALL"))==NULL) - tLang = getenv("LANG"); - - pLanguage = cupsLangDefault(); - setlocale(LC_ALL,tLang); - - return pLanguage; -} - - - static short getDeviceURI( const char *pDestName, char *pDeviceURI, short bufSize) { /*** Parameters start ***/ @@ -684,7 +667,6 @@ ipp_t *pRequest, // Pointer to CUPS IPP request. *pResponse; // Pointer to CUPS IPP response. ipp_attribute_t *pAttribute; // Pointer to CUPS attributes. - cups_lang_t *pLanguage; // Pointer to language. char *pPrinter = NULL; // Pointer to printer name. char *pDUri = NULL; // Pointer to Device uri. short retVal = -1; // Return value. @@ -696,41 +678,32 @@ goto onErr; } else { - pRequest = ippNew(); - - pRequest->request.op.operation_id = CUPS_GET_PRINTERS; - pRequest->request.op.request_id = 1; - - pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 - - ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage)); - ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language); - ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL); - + pRequest = ippNewRequest(CUPS_GET_PRINTERS); + 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 = ippNextAttribute(pResponse); } 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 = ippNextAttribute(pResponse); } if (strcasecmp(pDestName, pPrinter) == 0) { @@ -739,7 +712,7 @@ } if (pAttribute != NULL) - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } } @@ -750,7 +723,6 @@ goto onErr; } - cupsLangFree(pLanguage); httpClose(pHTTP); } diff -ura cnijfilter-source-3.80-1/cngpijmnt/src/main.c cnijfilter-source-3.80-1_patched/cngpijmnt/src/main.c --- cnijfilter-source-3.80-1/cngpijmnt/src/main.c 2020-05-03 22:21:15.717278277 +0200 +++ cnijfilter-source-3.80-1_patched/cngpijmnt/src/main.c 2020-05-03 22:25:09.912041029 +0200 @@ -283,24 +283,6 @@ } } - - -static cups_lang_t * bjcupsLangDefault( ) -{ - cups_lang_t *pLanguage; - char *tLang; - - if( (tLang = getenv("LC_ALL"))==NULL) - tLang = getenv("LANG"); - - pLanguage = cupsLangDefault(); - setlocale(LC_ALL,tLang); - - return pLanguage; -} - - - static short getDeviceURI( const char *pDestName, char *pDeviceURI, short bufSize) { /*** Parameters start ***/ @@ -308,7 +290,6 @@ ipp_t *pRequest, // Pointer to CUPS IPP request. *pResponse; // Pointer to CUPS IPP response. ipp_attribute_t *pAttribute; // Pointer to CUPS attributes. - cups_lang_t *pLanguage; // Pointer to language. char *pPrinter = NULL; // Pointer to printer name. char *pDUri = NULL; // Pointer to Device uri. short retVal = -1; // Return value. @@ -320,41 +301,32 @@ goto onErr; } else { - pRequest = ippNew(); - - pRequest->request.op.operation_id = CUPS_GET_PRINTERS; - pRequest->request.op.request_id = 1; - - pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 - - ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage)); - ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language); - ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL); + pRequest = ippNewRequest(CUPS_GET_PRINTERS); 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 = ippNextAttribute(pResponse); } 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 = ippNextAttribute(pResponse); } if (strcasecmp(pDestName, pPrinter) == 0) { @@ -363,7 +335,7 @@ } if (pAttribute != NULL) - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } } @@ -374,7 +346,6 @@ goto onErr; } - cupsLangFree(pLanguage); httpClose(pHTTP); } diff -ura cnijfilter-source-3.80-1/cngpijmnt/src/main.c cnijfilter-source-3.80-1_patched/cngpijmnt/src/main.c --- cnijfilter-source-3.80-1/cngpijmon/src/bjcupsmon_cups.c 2012-05-22 04:49:27.000000000 -0500 +++ cnijfilter-source-3.80-1_patched/cngpijmon/src/bjcupsmon_cups.c 2020-02-27 19:13:14.074174222 -0600 @@ -215,8 +215,8 @@ else { pRequest = ippNew(); - pRequest->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - pRequest->request.op.request_id = 1; + ippSetOperation(pRequest, IPP_GET_PRINTER_ATTRIBUTES); + ippSetRequestId(pRequest, 1); pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 @@ -225,12 +225,12 @@ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, pURI); if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { - if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { + if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { retVal = ID_ERR_CUPS_API_FAILED; } else { if ((pAttribute = ippFindAttribute(pResponse, "printer-state", IPP_TAG_ENUM)) != NULL) { - printerState = (ipp_state_t)pAttribute->values[0].integer; + printerState = (ipp_state_t)ippGetInteger(pAttribute, 0); } } @@ -288,8 +288,8 @@ else { pRequest = ippNew(); - pRequest->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - pRequest->request.op.request_id = 1; + ippSetOperation(pRequest, IPP_GET_PRINTER_ATTRIBUTES); + ippSetRequestId(pRequest, 1); pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 @@ -298,7 +298,7 @@ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printerURI); if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { - if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { + if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { retVal = ID_ERR_CUPS_API_FAILED; } else { @@ -310,7 +310,7 @@ //} pAttribute = ippFindAttribute(pResponse, "printer-state-message", IPP_TAG_TEXT); if (pAttribute != NULL) { - strncpy(pStatus, pAttribute->values[0].string.text, bufSize); + strncpy(pStatus, ippGetString(pAttribute, 0, NULL), bufSize); } } ippDelete(pResponse); @@ -369,8 +369,8 @@ else { pRequest = ippNew(); - pRequest->request.op.operation_id = IPP_CANCEL_JOB; - pRequest->request.op.request_id = 1; + ippSetOperation(pRequest, IPP_CANCEL_JOB); + ippSetRequestId(pRequest, 1); pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 @@ -381,7 +381,7 @@ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser()); if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/jobs/")) != NULL) { - if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { + if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { retVal = ID_ERR_CUPS_API_FAILED; } ippDelete(pResponse); @@ -444,8 +444,8 @@ else { pRequest = ippNew(); - pRequest->request.op.operation_id = IPP_GET_JOBS; - pRequest->request.op.request_id = 1; + ippSetOperation(pRequest, IPP_GET_JOBS); + ippSetRequestId(pRequest, 1); pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 @@ -456,31 +456,31 @@ ippAddStrings(pRequest, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes",(int)(sizeof(jobattrs) / sizeof(jobattrs[0])), NULL, jobattrs); if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { - if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { + if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { retVal = ID_ERR_CUPS_API_FAILED; } else { - pAttribute = pResponse->attrs; + pAttribute = ippFirstAttribute(pResponse); while (pAttribute != NULL) { - while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_JOB) { - pAttribute = pAttribute->next; + while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_JOB) { + pAttribute = ippNextAttribute(pResponse); } if (pAttribute == NULL) { break; } - while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_JOB) { - if (strcmp(pAttribute->name, "job-id") == 0 && pAttribute->value_tag == IPP_TAG_INTEGER) { - jobID = pAttribute->values[0].integer; + while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_JOB) { + if (strcmp(ippGetName(pAttribute), "job-id") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_INTEGER) { + jobID = ippGetInteger(pAttribute, 0); } - if (strcmp(pAttribute->name, "job-state") == 0 && pAttribute->value_tag == IPP_TAG_ENUM) { - jobState = (ipp_jstate_t)pAttribute->values[0].integer; + if (strcmp(ippGetName(pAttribute), "job-state") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_ENUM) { + jobState = (ipp_jstate_t)ippGetInteger(pAttribute, 0); } - if (strcmp(pAttribute->name, "job-originating-user-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) { - pJobUserName = pAttribute->values[0].string.text; + if (strcmp(ippGetName(pAttribute), "job-originating-user-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) { + pJobUserName = ippGetString(pAttribute, 0, NULL); } - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } if (jobState == IPP_JOB_PROCESSING) { if (pJobUserName != NULL) { @@ -497,7 +497,7 @@ } if (pAttribute != NULL) - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } } @@ -555,8 +555,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 @@ -565,28 +565,28 @@ ippAddStrings(pRequest, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", sizeof(attributes) / sizeof(attributes[0]), NULL, attributes); if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { - if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { + if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { retVal = ID_ERR_CUPS_API_FAILED; } 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 = ippNextAttribute(pResponse); } 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, "printer-uri-supported") == 0 && pAttribute->value_tag == IPP_TAG_URI) { - pUri = pAttribute->values[0].string.text; + if (strcmp(ippGetName(pAttribute), "printer-uri-supported") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) { + pUri = ippGetString(pAttribute, 0, NULL); } - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } // Tora 020418: Compare two printer names ignoring the character case. @@ -603,7 +603,7 @@ } if (pAttribute != NULL) - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } } @@ -658,8 +658,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 @@ -668,28 +668,28 @@ 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) { retVal = ID_ERR_CUPS_API_FAILED; } 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 = ippNextAttribute(pResponse); } 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 = ippNextAttribute(pResponse); } if (strcasecmp(pDestName, pPrinter) == 0) { @@ -698,7 +698,7 @@ } if (pAttribute != NULL) - pAttribute = pAttribute->next; + pAttribute = ippNextAttribute(pResponse); } }