From 4a5af55ce5ed640edd6629a463f8a33c9c891801 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Wed, 6 Apr 2022 22:23:44 +0200 Subject: [PATCH] libcupsfilters: Rename API functions of ipp.h to "cf..." Also renamed constants to start with "CF_" and data types to start with "cf_". --- backend/implicitclass.c | 2 +- cupsfilters/ipp.c | 110 ++++++++++++++++++++-------------------- cupsfilters/ipp.h | 80 ++++++++++++++--------------- cupsfilters/raster.c | 6 +-- utils/cups-browsed.c | 26 +++++----- utils/driverless.c | 6 +-- 6 files changed, 112 insertions(+), 118 deletions(-) diff --git a/backend/implicitclass.c b/backend/implicitclass.c index 84b520135..090460ccd 100644 --- a/backend/implicitclass.c +++ b/backend/implicitclass.c @@ -307,7 +307,7 @@ main(int argc, /* I - Number of command-line args */ filter_data.copies = atoi(argv[4]); filter_data.job_attrs = NULL; /* We use command line options */ if ((filter_data.printer_attrs = - get_printer_attributes4(printer_uri, NULL, 0, NULL, 0, 1, 0)) != + cfGetPrinterAttributes4(printer_uri, NULL, 0, NULL, 0, 1, 0)) != NULL) /* Poll the printer attributes from the printer */ diff --git a/cupsfilters/ipp.c b/cupsfilters/ipp.c index 7de3c92a0..f3cffdc5f 100644 --- a/cupsfilters/ipp.c +++ b/cupsfilters/ipp.c @@ -44,7 +44,7 @@ enum resolve_uri_converter_type /**** Resolving DNS-SD based URI ****/ IPPFIND_BASED_CONVERTER_FOR_FAX_URI = 1 }; -char get_printer_attributes_log[LOGSIZE]; +char cf_get_printer_attributes_log[CF_GET_PRINTER_ATTRIBUTES_LOGSIZE]; static int convert_to_port(char *a) @@ -63,14 +63,14 @@ log_printf(char *log, va_list arglist; va_start(arglist, format); vsnprintf(log + strlen(log), - LOGSIZE - strlen(log) - 1, + CF_GET_PRINTER_ATTRIBUTES_LOGSIZE - strlen(log) - 1, format, arglist); - log[LOGSIZE - 1] = '\0'; + log[CF_GET_PRINTER_ATTRIBUTES_LOGSIZE - 1] = '\0'; va_end(arglist); } char * -resolve_uri(const char *raw_uri) +cfResolveURI(const char *raw_uri) { char *pseudo_argv[2]; const char *uri; @@ -116,12 +116,12 @@ resolve_uri(const char *raw_uri) #ifdef HAVE_CUPS_1_6 /* Check how the driverless support is provided */ int -check_driverless_support(const char* uri) +cfCheckDriverlessSupport(const char* uri) { - int support_status = DRVLESS_CHECKERR; + int support_status = CF_DRVLESS_CHECKERR; ipp_t *response = NULL; - response = get_printer_attributes3(NULL, uri, NULL, 0, NULL, 0, 1, + response = cfGetPrinterAttributes3(NULL, uri, NULL, 0, NULL, 0, 1, &support_status); if (response != NULL) ippDelete(response); @@ -131,21 +131,21 @@ check_driverless_support(const char* uri) /* Get attributes of a printer specified only by URI */ ipp_t * -get_printer_attributes(const char* raw_uri, +cfGetPrinterAttributes(const char* raw_uri, const char* const pattrs[], int pattrs_size, const char* const req_attrs[], int req_attrs_size, int debug) { - return get_printer_attributes2(NULL, raw_uri, pattrs, pattrs_size, + return cfGetPrinterAttributes2(NULL, raw_uri, pattrs, pattrs_size, req_attrs, req_attrs_size, debug); } /* Get attributes of a printer specified by URI and under a given HTTP connection, for example via a domain socket */ ipp_t * -get_printer_attributes2(http_t *http_printer, +cfGetPrinterAttributes2(http_t *http_printer, const char* raw_uri, const char* const pattrs[], int pattrs_size, @@ -153,7 +153,7 @@ get_printer_attributes2(http_t *http_printer, int req_attrs_size, int debug) { - return get_printer_attributes3(http_printer, raw_uri, pattrs, pattrs_size, + return cfGetPrinterAttributes3(http_printer, raw_uri, pattrs, pattrs_size, req_attrs, req_attrs_size, debug, NULL); } @@ -161,7 +161,7 @@ get_printer_attributes2(http_t *http_printer, connection, for example via a domain socket, and give info about used fallbacks */ ipp_t * -get_printer_attributes3(http_t *http_printer, +cfGetPrinterAttributes3(http_t *http_printer, const char* raw_uri, const char* const pattrs[], int pattrs_size, @@ -170,13 +170,13 @@ get_printer_attributes3(http_t *http_printer, int debug, int* driverless_info) { - return get_printer_attributes5(http_printer, raw_uri, pattrs, pattrs_size, + return cfGetPrinterAttributes5(http_printer, raw_uri, pattrs, pattrs_size, req_attrs, req_attrs_size, debug, driverless_info, CUPS_BACKEND_URI_CONVERTER); } /* Get attributes of a printer specified only by URI and given info about fax-support*/ -ipp_t *get_printer_attributes4(const char* raw_uri, +ipp_t *cfGetPrinterAttributes4(const char* raw_uri, const char* const pattrs[], int pattrs_size, const char* const req_attrs[], @@ -185,11 +185,11 @@ ipp_t *get_printer_attributes4(const char* raw_uri, int is_fax) { if(is_fax) - return get_printer_attributes5(NULL, raw_uri, pattrs, pattrs_size, + return cfGetPrinterAttributes5(NULL, raw_uri, pattrs, pattrs_size, req_attrs, req_attrs_size, debug, NULL, IPPFIND_BASED_CONVERTER_FOR_FAX_URI); else - return get_printer_attributes5(NULL, raw_uri, pattrs, pattrs_size, + return cfGetPrinterAttributes5(NULL, raw_uri, pattrs, pattrs_size, req_attrs, req_attrs_size, debug, NULL, IPPFIND_BASED_CONVERTER_FOR_PRINT_URI); } @@ -198,7 +198,7 @@ ipp_t *get_printer_attributes4(const char* raw_uri, connection, for example via a domain socket, and give info about used fallbacks */ ipp_t * -get_printer_attributes5(http_t *http_printer, +cfGetPrinterAttributes5(http_t *http_printer, const char* raw_uri, const char* const pattrs[], int pattrs_size, @@ -253,7 +253,7 @@ get_printer_attributes5(http_t *http_printer, /* Expect a device capable of standard IPP Everywhere */ if (driverless_info != NULL) - *driverless_info = FULL_DRVLESS; + *driverless_info = CF_DRVLESS_FULL; /* Request printer properties via IPP, for example to - generate a PPD file for the printer @@ -261,17 +261,17 @@ get_printer_attributes5(http_t *http_printer, - generally find capabilities, options, and default settinngs, - printers status: Accepting jobs? Busy? With how many jobs? */ - get_printer_attributes_log[0] = '\0'; + cf_get_printer_attributes_log[0] = '\0'; /* Convert DNS-SD-service-name-based URIs to host-name-based URIs */ if(resolve_uri_type == CUPS_BACKEND_URI_CONVERTER) - uri = resolve_uri(raw_uri); + uri = cfResolveURI(raw_uri); else - uri = ippfind_based_uri_converter(raw_uri, resolve_uri_type); + uri = cfippfindBasedURIConverter(raw_uri, resolve_uri_type); if (uri == NULL) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "get-printer-attibutes: Cannot resolve URI: %s\n", raw_uri); return NULL; } @@ -285,7 +285,7 @@ get_printer_attributes5(http_t *http_printer, resource, sizeof(resource)); if (uri_status != HTTP_URI_OK) { /* Invalid URI */ - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "get-printer-attributes: Cannot parse the printer URI: %s\n", uri); if (uri) free(uri); @@ -303,7 +303,7 @@ get_printer_attributes5(http_t *http_printer, if ((http_printer = httpConnect2 (host_name, host_port, NULL, AF_UNSPEC, encryption, 1, 3000, NULL)) == NULL) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "get-printer-attributes: Cannot connect to printer with URI %s.\n", uri); if (uri) free(uri); @@ -349,25 +349,25 @@ get_printer_attributes5(http_t *http_printer, ipp_status = cupsLastError(); if (response) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "Requested IPP attributes (get-printer-attributes) for printer with URI %s\n", uri); /* Log all printer attributes for debugging and count them */ if (debug) - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "Full list of all IPP attributes:\n"); attr = ippFirstAttribute(response); while (attr) { total_attrs ++; if (debug) { ippAttributeString(attr, valuebuffer, sizeof(valuebuffer)); - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, " Attr: %s\n",ippGetName(attr)); - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, " Value: %s\n", valuebuffer); for (i = 0; i < ippGetCount(attr); i ++) { if ((kw = ippGetString(attr, i, NULL)) != NULL) { - log_printf(get_printer_attributes_log, " Keyword: %s\n", kw); + log_printf(cf_get_printer_attributes_log, " Keyword: %s\n", kw); } } } @@ -384,20 +384,20 @@ get_printer_attributes5(http_t *http_printer, if (ipp_status == IPP_STATUS_ERROR_BAD_REQUEST || ipp_status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED || (req_attrs && i > 0) || (cap && total_attrs < 20)) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "get-printer-attributes IPP request failed:\n"); if (ipp_status == IPP_STATUS_ERROR_BAD_REQUEST) - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, " - ipp_status == IPP_STATUS_ERROR_BAD_REQUEST\n"); else if (ipp_status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, " - ipp_status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED\n"); if (req_attrs && i > 0) - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, " - Required IPP attribute %s not found\n", req_attrs[i - 1]); if (cap && total_attrs < 20) - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, " - Too few IPP attributes: %d (30 or more expected)\n", total_attrs); ippDelete(response); @@ -408,27 +408,27 @@ get_printer_attributes5(http_t *http_printer, return response; } } else { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "Request for IPP attributes (get-printer-attributes) for printer with URI %s failed: %s\n", uri, cupsLastErrorString()); - log_printf(get_printer_attributes_log, "get-printer-attributes IPP request failed:\n"); - log_printf(get_printer_attributes_log, " - No response\n"); + log_printf(cf_get_printer_attributes_log, "get-printer-attributes IPP request failed:\n"); + log_printf(cf_get_printer_attributes_log, " - No response\n"); } if (fallback == 1 + cap) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "No further fallback available, giving up\n"); if (driverless_info != NULL) - *driverless_info = DRVLESS_CHECKERR; + *driverless_info = CF_DRVLESS_CHECKERR; } else if (cap && fallback == 1) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "The server doesn't support the standard IPP request, trying request without media-col\n"); if (driverless_info != NULL) - *driverless_info = DRVLESS_INCOMPLETEIPP; + *driverless_info = CF_DRVLESS_INCOMPLETEIPP; } else if (fallback == 0) { - log_printf(get_printer_attributes_log, + log_printf(cf_get_printer_attributes_log, "The server doesn't support IPP2.0 request, trying IPP1.1 request\n"); if (driverless_info != NULL) - *driverless_info = DRVLESS_IPP11; + *driverless_info = CF_DRVLESS_IPP11; } } @@ -438,7 +438,7 @@ get_printer_attributes5(http_t *http_printer, } char* -ippfind_based_uri_converter (const char *uri, int is_fax) +cfippfindBasedURIConverter (const char *uri, int is_fax) { int ippfind_pid = 0, /* Process ID of ippfind for IPP */ post_proc_pipe[2], /* Pipe to post-processing for IPP */ @@ -480,10 +480,10 @@ ippfind_based_uri_converter (const char *uri, int is_fax) return strdup(uri); } - resolved_uri = (char *)malloc(MAX_URI_LEN * (sizeof(char))); + resolved_uri = (char *)malloc(CF_GET_PRINTER_ATTRIBUTES_MAX_URI_LEN * (sizeof(char))); if (resolved_uri == NULL) goto error; - memset(resolved_uri, 0, MAX_URI_LEN); + memset(resolved_uri, 0, CF_GET_PRINTER_ATTRIBUTES_MAX_URI_LEN); reg_type --; while (reg_type >= hostname && *reg_type != '.') @@ -551,12 +551,12 @@ ippfind_based_uri_converter (const char *uri, int is_fax) fp = cupsFileOpenFd(post_proc_pipe[0], "r"); - buffer = (char*)malloc(MAX_OUTPUT_LEN * sizeof(char)); + buffer = (char*)malloc(CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN * sizeof(char)); if (buffer == NULL) goto error; - memset(buffer, 0, MAX_OUTPUT_LEN); + memset(buffer, 0, CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN); - while ((bytes = cupsFileGetLine(fp, buffer, MAX_OUTPUT_LEN)) > 0) { + while ((bytes = cupsFileGetLine(fp, buffer, CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN)) > 0) { /* Mark all the fields of the output of ippfind */ ptr = buffer; @@ -568,19 +568,19 @@ ippfind_based_uri_converter (const char *uri, int is_fax) while (ptr && !isalnum(*ptr & 255)) ptr ++; service_hostname = ptr; - ptr = memchr(ptr, '\t', MAX_OUTPUT_LEN - (ptr - buffer)); + ptr = memchr(ptr, '\t', CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN - (ptr - buffer)); if (!ptr) goto read_error; *ptr = '\0'; ptr ++; resource_field = ptr; - ptr = memchr(ptr, '\t', MAX_OUTPUT_LEN - (ptr - buffer)); + ptr = memchr(ptr, '\t', CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN - (ptr - buffer)); if (!ptr) goto read_error; *ptr = '\0'; ptr ++; ptr_to_port = ptr; - ptr = memchr(ptr, '\t', MAX_OUTPUT_LEN - (ptr - buffer)); + ptr = memchr(ptr, '\t', CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN - (ptr - buffer)); if (!ptr) goto read_error; *ptr = '\0'; ptr ++; @@ -604,7 +604,7 @@ ippfind_based_uri_converter (const char *uri, int is_fax) output_of_fax_uri = 1; /* fax-uri requested from fax-capable device */ read_error: - memset(buffer, 0, MAX_OUTPUT_LEN); + memset(buffer, 0, CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN); } cupsFileClose(fp); @@ -665,7 +665,7 @@ ippfind_based_uri_converter (const char *uri, int is_fax) #endif /* HAVE_CUPS_1_6 */ const char* /* O - Attribute value as string */ -ippAttrEnumValForPrinter(ipp_t *printer_attrs, /* I - Printer attributes, same +cfIPPAttrEnumValForPrinter(ipp_t *printer_attrs, /* I - Printer attributes, same as to respond get-printer-attributes, or NULL to not consider */ @@ -721,7 +721,7 @@ ippAttrEnumValForPrinter(ipp_t *printer_attrs, /* I - Printer attributes, same } int /* O - 1: Success; 0: Error */ -ippAttrIntValForPrinter(ipp_t *printer_attrs, /* I - Printer attributes, same +cfIPPAttrIntValForPrinter(ipp_t *printer_attrs, /* I - Printer attributes, same as to respond get-printer-attributes, or NULL to not consider */ diff --git a/cupsfilters/ipp.h b/cupsfilters/ipp.h index 35d2aca6a..899e38cab 100644 --- a/cupsfilters/ipp.h +++ b/cupsfilters/ipp.h @@ -33,42 +33,39 @@ extern "C" { #include #include -#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -#define HAVE_CUPS_1_6 1 -#endif - -#define LOGSIZE 4 * 65536 -#define MAX_OUTPUT_LEN 8192 -#define MAX_URI_LEN 2048 - -extern char get_printer_attributes_log[LOGSIZE]; - -char *resolve_uri(const char *raw_uri); -char *ippfind_based_uri_converter(const char *uri ,int is_fax); -#ifdef HAVE_CUPS_1_6 - /* Enum of possible driverless options */ -enum driverless_support_modes { - DRVLESS_CHECKERR, /* Unable to get get-printer-attributes response*/ - FULL_DRVLESS, /* Standard IPP Everywhere support, works with 'everywhere' model */ - DRVLESS_IPP11, /* Driverless support via IPP 1.1 request */ - DRVLESS_INCOMPLETEIPP /* Driverless support without media-col-database attribute */ +#define CF_GET_PRINTER_ATTRIBUTES_LOGSIZE 4 * 65536 +#define CF_GET_PRINTER_ATTRIBUTES_MAX_OUTPUT_LEN 8192 +#define CF_GET_PRINTER_ATTRIBUTES_MAX_URI_LEN 2048 + +extern char cf_get_printer_attributes_log[CF_GET_PRINTER_ATTRIBUTES_LOGSIZE]; + +/* Enum of possible driverless options */ +enum cf_driverless_support_modes_e { + CF_DRVLESS_CHECKERR, /* Unable to get get-printer-attributes response*/ + CF_DRVLESS_FULL, /* Standard IPP Everywhere support, works with + 'everywhere' model */ + CF_DRVLESS_IPP11, /* Driverless support via IPP 1.1 request */ + CF_DRVLESS_INCOMPLETEIPP /* Driverless support without media-col-database + attribute */ }; -int check_driverless_support(const char* uri); -ipp_t *get_printer_attributes(const char* raw_uri, +char *cfResolveURI(const char *raw_uri); +char *cfippfindBasedURIConverter(const char *uri ,int is_fax); +int cfCheckDriverlessSupport(const char* uri); +ipp_t *cfGetPrinterAttributes(const char* raw_uri, const char* const pattrs[], int pattrs_size, const char* const req_attrs[], int req_attrs_size, int debug); -ipp_t *get_printer_attributes2(http_t *http_printer, +ipp_t *cfGetPrinterAttributes2(http_t *http_printer, const char* raw_uri, const char* const pattrs[], int pattrs_size, const char* const req_attrs[], int req_attrs_size, int debug); -ipp_t *get_printer_attributes3(http_t *http_printer, +ipp_t *cfGetPrinterAttributes3(http_t *http_printer, const char* raw_uri, const char* const pattrs[], int pattrs_size, @@ -76,14 +73,14 @@ ipp_t *get_printer_attributes3(http_t *http_printer, int req_attrs_size, int debug, int* driverless_support); -ipp_t *get_printer_attributes4(const char* raw_uri, - const char* const pattrs[], - int pattrs_size, - const char* const req_attrs[], - int req_attrs_size, - int debug, - int isFax); -ipp_t *get_printer_attributes5(http_t *http_printer, +ipp_t *cfGetPrinterAttributes4(const char* raw_uri, + const char* const pattrs[], + int pattrs_size, + const char* const req_attrs[], + int req_attrs_size, + int debug, + int isFax); +ipp_t *cfGetPrinterAttributes5(http_t *http_printer, const char* raw_uri, const char* const pattrs[], int pattrs_size, @@ -91,18 +88,15 @@ ipp_t *get_printer_attributes5(http_t *http_printer, int req_attrs_size, int debug, int* driverless_support, - int resolve_uri_type); - - -#endif /* HAVE_CUPS_1_6 */ - -const char* ippAttrEnumValForPrinter(ipp_t *printer_attrs, - ipp_t *job_attrs, - const char *attr_name); -int ippAttrIntValForPrinter(ipp_t *printer_attrs, - ipp_t *job_attrs, - const char *attr_name, - int *value); + int resolve_uri_type); + +const char* cfIPPAttrEnumValForPrinter(ipp_t *printer_attrs, + ipp_t *job_attrs, + const char *attr_name); +int cfIPPAttrIntValForPrinter(ipp_t *printer_attrs, + ipp_t *job_attrs, + const char *attr_name, + int *value); # ifdef __cplusplus } diff --git a/cupsfilters/raster.c b/cupsfilters/raster.c index a41fa58a3..d0c44d356 100644 --- a/cupsfilters/raster.c +++ b/cupsfilters/raster.c @@ -813,11 +813,11 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I - Raster header */ cspaces_available = valuebuffer; if ((color_mode = cupsGetOption("print-color-mode", num_options, options)) == NULL) - color_mode = ippAttrEnumValForPrinter(printer_attrs, job_attrs, + color_mode = cfIPPAttrEnumValForPrinter(printer_attrs, job_attrs, "print-color-mode"); if ((quality = cupsGetOption("print-quality", num_options, options)) == NULL) - quality = ippAttrEnumValForPrinter(printer_attrs, job_attrs, + quality = cfIPPAttrEnumValForPrinter(printer_attrs, job_attrs, "print-quality"); hi_depth = (!no_high_depth && (!strcasecmp(quality, "high") || !strcmp(quality, "5"))) ? @@ -838,7 +838,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I - Raster header */ cspaces_available = "srgb_8,sgray_8"; if ((color_mode = cupsGetOption("print-color-mode", num_options, options)) == NULL) - color_mode = ippAttrEnumValForPrinter(printer_attrs, job_attrs, + color_mode = cfIPPAttrEnumValForPrinter(printer_attrs, job_attrs, "print-color-mode"); hi_depth = 0; if (log) diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c index f68118eb0..c050dd187 100644 --- a/utils/cups-browsed.c +++ b/utils/cups-browsed.c @@ -3839,7 +3839,7 @@ get_printer_uuid(http_t *http_printer, raw_uri); if ((response = - get_printer_attributes2(http_printer, raw_uri, + cfGetPrinterAttributes2(http_printer, raw_uri, pattrs, 1, req_attrs, 1, 0)) == NULL) { debug_printf ("Printer with URI %s has no \"printer-uuid\" IPP attribute!\n", raw_uri); @@ -6365,10 +6365,10 @@ on_job_state (CupsNotifier *object, /* Check whether the printer is idle, processing, or disabled */ debug_printf("HTTP connection to %s:%d established.\n", p->host, p->port); - response = get_printer_attributes(p->uri, pattrs, + response = cfGetPrinterAttributes(p->uri, pattrs, sizeof(pattrs) / sizeof(pattrs[0]), NULL, 0, 0); - debug_log_out(get_printer_attributes_log); + debug_log_out(cf_get_printer_attributes_log); if (response != NULL) { debug_printf("IPP request to %s:%d successful.\n", p->host, p->port); @@ -6802,11 +6802,11 @@ queue_overwritten (remote_printer_t *p) sizeof(local_queue_uri), "ipp", NULL, "localhost", 0, "/printers/%s", p->queue_name); - response = get_printer_attributes2(conn, local_queue_uri, + response = cfGetPrinterAttributes2(conn, local_queue_uri, pattrs, sizeof(pattrs) / sizeof(pattrs[0]), pattrs, sizeof(pattrs) / sizeof(pattrs[0]), 1); - debug_log_out(get_printer_attributes_log); + debug_log_out(cf_get_printer_attributes_log); if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING) { debug_printf("lpstat: %s\n", cupsLastErrorString()); } else { @@ -7292,8 +7292,8 @@ create_remote_printer_entry (const char *queue_name, or interface script at this point. */ p->netprinter = 0; if (p->uri[0] != '\0') { - p->prattrs = get_printer_attributes(p->uri, NULL, 0, NULL, 0, 1); - debug_log_out(get_printer_attributes_log); + p->prattrs = cfGetPrinterAttributes(p->uri, NULL, 0, NULL, 0, 1); + debug_log_out(cf_get_printer_attributes_log); if (p->prattrs == NULL) debug_printf("get-printer-attributes IPP call failed on printer %s (%s).\n", p->queue_name, p->uri); @@ -7361,8 +7361,8 @@ create_remote_printer_entry (const char *queue_name, p->slave_of = NULL; p->netprinter = 1; - p->prattrs = get_printer_attributes(p->uri, NULL, 0, NULL, 0, 1); - debug_log_out(get_printer_attributes_log); + p->prattrs = cfGetPrinterAttributes(p->uri, NULL, 0, NULL, 0, 1); + debug_log_out(cf_get_printer_attributes_log); if (p->prattrs == NULL) { debug_printf("get-printer-attributes IPP call failed on printer %s (%s).\n", p->queue_name, p->uri); @@ -7951,8 +7951,8 @@ void create_queue(void* arg) { for our IPP network printer, we proceed here */ if (p->netprinter == 1) { if (p->prattrs == NULL) { - p->prattrs = get_printer_attributes(p->uri, NULL, 0, NULL, 0, 1); - debug_log_out(get_printer_attributes_log); + p->prattrs = cfGetPrinterAttributes(p->uri, NULL, 0, NULL, 0, 1); + debug_log_out(cf_get_printer_attributes_log); } if (p->prattrs == NULL) { debug_printf("get-printer-attributes IPP call failed on printer %s (%s).\n", @@ -8123,8 +8123,8 @@ void create_queue(void* arg) { is suppressed. */ /* Generating the ppd file for the remote cups queue */ if (p->prattrs == NULL) { - p->prattrs = get_printer_attributes(p->uri, NULL, 0, NULL, 0, 1); - debug_log_out(get_printer_attributes_log); + p->prattrs = cfGetPrinterAttributes(p->uri, NULL, 0, NULL, 0, 1); + debug_log_out(cf_get_printer_attributes_log); } if (p->prattrs == NULL) { debug_printf("get-printer-attributes IPP call failed on printer %s (%s).\n", diff --git a/utils/driverless.c b/utils/driverless.c index c36f6e0d8..4c1fc048e 100644 --- a/utils/driverless.c +++ b/utils/driverless.c @@ -621,10 +621,10 @@ generate_ppd (const char *uri, int isFax) /* Request printer properties via IPP to generate a PPD file for the printer */ - response = get_printer_attributes4(uri, NULL, 0, NULL, 0, 1, isFax); + response = cfGetPrinterAttributes4(uri, NULL, 0, NULL, 0, 1, isFax); if (debug) { - ptr1 = get_printer_attributes_log; + ptr1 = cf_get_printer_attributes_log; while(ptr1) { ptr2 = strchr(ptr1, '\n'); if (ptr2) *ptr2 = '\0'; @@ -636,7 +636,7 @@ generate_ppd (const char *uri, int isFax) if (response == NULL) { fprintf(stderr, "ERROR: Unable to create PPD file: Could not poll " "sufficient capability info from the printer (%s, %s) via IPP!\n", - uri, resolve_uri(uri)); + uri, cfResolveURI(uri)); goto fail; } -- 2.47.3