From: msweet Date: Tue, 25 Mar 2014 18:01:41 +0000 (+0000) Subject: Fix documentation and naming of subscription operations (STR #4389) X-Git-Tag: v2.2b1~694 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42404685b74b7dc2d0270cd6aef413e3e0eaed8d;p=thirdparty%2Fcups.git Fix documentation and naming of subscription operations (STR #4389) (also maintaining compatibility mappings for names and enums...) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11733 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.7.txt b/CHANGES-1.7.txt index 7ef0ef95f2..e7f22683f0 100644 --- a/CHANGES-1.7.txt +++ b/CHANGES-1.7.txt @@ -8,6 +8,8 @@ CHANGES IN CUPS V1.7.2 - Documentation fixes (STR #3259, STR #4346) - Fixed the Japanese localization (STR #4385) - Added a German localization (STR #4363) + - Fixed documentation and naming of Create-Job/Printer-Subscriptions + operations (STR #4389) - Updated Linux "relro" support (STR #4349) - cupsEnumDests did not set the "is_default" field (STR #4332) - cupsDoIORequest could miss the server status, causing failed lpadmin diff --git a/cups/encode.c b/cups/encode.c index fb590246cf..ced37798d5 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -56,8 +56,8 @@ static const ipp_op_t ipp_sub_creation[] = IPP_OP_PRINT_JOB, IPP_OP_PRINT_URI, IPP_OP_CREATE_JOB, - IPP_OP_CREATE_PRINTER_SUBSCRIPTION, - IPP_OP_CREATE_JOB_SUBSCRIPTION, + IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS, + IPP_OP_CREATE_JOB_SUBSCRIPTIONS, IPP_OP_CUPS_NONE }; diff --git a/cups/ipp-support.c b/cups/ipp-support.c index a5c233e205..7ef5819fd3 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -162,8 +162,8 @@ static const char * const ipp_std_ops[] = "Set-Printer-Attributes", "Set-Job-Attributes", "Get-Printer-Supported-Values", - "Create-Printer-Subscription", - "Create-Job-Subscription", + "Create-Printer-Subscriptions", + "Create-Job-Subscriptions", "Get-Subscription-Attributes", "Get-Subscriptions", "Renew-Subscription", @@ -2065,6 +2065,12 @@ ippOpValue(const char *name) /* I - Textual name */ if (!_cups_strcasecmp(name, ipp_cups_ops2[i])) return ((ipp_op_t)(i + 0x4027)); + if (!_cups_strcasecmp(name, "Create-Job-Subscription")) + return (IPP_OP_CREATE_JOB_SUBSCRIPTIONS); + + if (!_cups_strcasecmp(name, "Create-Printer-Subscription")) + return (IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS); + if (!_cups_strcasecmp(name, "CUPS-Add-Class")) return (IPP_OP_CUPS_ADD_MODIFY_CLASS); diff --git a/cups/ipp.h b/cups/ipp.h index d5dc936934..a55ed40350 100644 --- a/cups/ipp.h +++ b/cups/ipp.h @@ -3,7 +3,7 @@ * * Internet Printing Protocol definitions for CUPS. * - * Copyright 2007-2013 by Apple Inc. + * Copyright 2007-2014 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -264,8 +264,8 @@ typedef enum ipp_op_e /**** IPP operations ****/ IPP_OP_SET_PRINTER_ATTRIBUTES, /* Set printer attributes @private@ */ IPP_OP_SET_JOB_ATTRIBUTES, /* Set job attributes */ IPP_OP_GET_PRINTER_SUPPORTED_VALUES, /* Get supported attribute values */ - IPP_OP_CREATE_PRINTER_SUBSCRIPTION, /* Create a printer subscription @since CUPS 1.2/OS X 10.5@ */ - IPP_OP_CREATE_JOB_SUBSCRIPTION, /* Create a job subscription @since CUPS 1.2/OS X 10.5@ */ + IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS, /* Create one or more printer subscriptions @since CUPS 1.2/OS X 10.5@ */ + IPP_OP_CREATE_JOB_SUBSCRIPTIONS, /* Create one of more job subscriptions @since CUPS 1.2/OS X 10.5@ */ IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES, /* Get subscription attributes @since CUPS 1.2/OS X 10.5@ */ IPP_OP_GET_SUBSCRIPTIONS, /* Get list of subscriptions @since CUPS 1.2/OS X 10.5@ */ IPP_OP_RENEW_SUBSCRIPTION, /* Renew a printer subscription @since CUPS 1.2/OS X 10.5@ */ @@ -344,8 +344,10 @@ typedef enum ipp_op_e /**** IPP operations ****/ # define IPP_SET_PRINTER_ATTRIBUTES IPP_OP_SET_PRINTER_ATTRIBUTES # define IPP_SET_JOB_ATTRIBUTES IPP_OP_SET_JOB_ATTRIBUTES # define IPP_GET_PRINTER_SUPPORTED_VALUES IPP_OP_GET_PRINTER_SUPPORTED_VALUES -# define IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTION -# define IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTION +# define IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS +# define IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS +# define IPP_OP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS +# define IPP_OP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS # define IPP_GET_SUBSCRIPTION_ATTRIBUTES IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES # define IPP_GET_SUBSCRIPTIONS IPP_OP_GET_SUBSCRIPTIONS # define IPP_RENEW_SUBSCRIPTION IPP_OP_RENEW_SUBSCRIPTION diff --git a/doc/help/man-ipptoolfile.html b/doc/help/man-ipptoolfile.html index 76f7a00118..612876df13 100644 --- a/doc/help/man-ipptoolfile.html +++ b/doc/help/man-ipptoolfile.html @@ -418,8 +418,8 @@ RFC 2911 and other IPP extension specifications. Here is a complete list: Cancel-Subscription Close-Job Create-Job - Create-Job-Subscription - Create-Printer-Subscription + Create-Job-Subscriptions + Create-Printer-Subscriptions Deactivate-Printer Disable-Printer Enable-Printer diff --git a/man/ipptoolfile.man b/man/ipptoolfile.man index 4b0246fbfa..1c630ffb04 100644 --- a/man/ipptoolfile.man +++ b/man/ipptoolfile.man @@ -11,7 +11,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH ipptoolfile 5 "CUPS" "20 February 2014" "Apple Inc." +.TH ipptoolfile 5 "CUPS" "25 March 2014" "Apple Inc." .SH NAME ipptoolfile \- ipptool file format @@ -423,8 +423,8 @@ RFC 2911 and other IPP extension specifications. Here is a complete list: Cancel-Subscription Close-Job Create-Job - Create-Job-Subscription - Create-Printer-Subscription + Create-Job-Subscriptions + Create-Printer-Subscriptions Deactivate-Printer Disable-Printer Enable-Printer diff --git a/scheduler/ipp.c b/scheduler/ipp.c index d00fddb419..0a99ec9fc2 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -85,7 +85,7 @@ static void copy_subscription_attrs(cupsd_client_t *con, cups_array_t *exclude); static void create_job(cupsd_client_t *con, ipp_attribute_t *uri); static cups_array_t *create_requested_array(ipp_t *request); -static void create_subscription(cupsd_client_t *con, ipp_attribute_t *uri); +static void create_subscriptions(cupsd_client_t *con, ipp_attribute_t *uri); static void delete_printer(cupsd_client_t *con, ipp_attribute_t *uri); static void get_default(cupsd_client_t *con); static void get_devices(cupsd_client_t *con); @@ -434,176 +434,176 @@ cupsdProcessIPPRequest( switch (con->request->request.op.operation_id) { - case IPP_PRINT_JOB : + case IPP_OP_PRINT_JOB : print_job(con, uri); break; - case IPP_VALIDATE_JOB : + case IPP_OP_VALIDATE_JOB : validate_job(con, uri); break; - case IPP_CREATE_JOB : + case IPP_OP_CREATE_JOB : create_job(con, uri); break; - case IPP_SEND_DOCUMENT : + case IPP_OP_SEND_DOCUMENT : send_document(con, uri); break; - case IPP_CANCEL_JOB : + case IPP_OP_CANCEL_JOB : cancel_job(con, uri); break; - case IPP_GET_JOB_ATTRIBUTES : + case IPP_OP_GET_JOB_ATTRIBUTES : get_job_attrs(con, uri); break; - case IPP_GET_JOBS : + case IPP_OP_GET_JOBS : get_jobs(con, uri); break; - case IPP_GET_PRINTER_ATTRIBUTES : + case IPP_OP_GET_PRINTER_ATTRIBUTES : get_printer_attrs(con, uri); break; - case IPP_GET_PRINTER_SUPPORTED_VALUES : + case IPP_OP_GET_PRINTER_SUPPORTED_VALUES : get_printer_supported(con, uri); break; - case IPP_HOLD_JOB : + case IPP_OP_HOLD_JOB : hold_job(con, uri); break; - case IPP_RELEASE_JOB : + case IPP_OP_RELEASE_JOB : release_job(con, uri); break; - case IPP_RESTART_JOB : + case IPP_OP_RESTART_JOB : restart_job(con, uri); break; - case IPP_PAUSE_PRINTER : + case IPP_OP_PAUSE_PRINTER : stop_printer(con, uri); break; - case IPP_RESUME_PRINTER : + case IPP_OP_RESUME_PRINTER : start_printer(con, uri); break; - case IPP_PURGE_JOBS : - case IPP_CANCEL_JOBS : - case IPP_CANCEL_MY_JOBS : + case IPP_OP_PURGE_JOBS : + case IPP_OP_CANCEL_JOBS : + case IPP_OP_CANCEL_MY_JOBS : cancel_all_jobs(con, uri); break; - case IPP_SET_JOB_ATTRIBUTES : + case IPP_OP_SET_JOB_ATTRIBUTES : set_job_attrs(con, uri); break; - case IPP_SET_PRINTER_ATTRIBUTES : + case IPP_OP_SET_PRINTER_ATTRIBUTES : set_printer_attrs(con, uri); break; - case IPP_HOLD_NEW_JOBS : + case IPP_OP_HOLD_NEW_JOBS : hold_new_jobs(con, uri); break; - case IPP_RELEASE_HELD_NEW_JOBS : + case IPP_OP_RELEASE_HELD_NEW_JOBS : release_held_new_jobs(con, uri); break; - case IPP_CLOSE_JOB : + case IPP_OP_CLOSE_JOB : close_job(con, uri); break; - case CUPS_GET_DEFAULT : + case IPP_OP_CUPS_GET_DEFAULT : get_default(con); break; - case CUPS_GET_PRINTERS : + case IPP_OP_CUPS_GET_PRINTERS : get_printers(con, 0); break; - case CUPS_GET_CLASSES : + case IPP_OP_CUPS_GET_CLASSES : get_printers(con, CUPS_PRINTER_CLASS); break; - case CUPS_ADD_PRINTER : + case IPP_OP_CUPS_ADD_MODIFY_PRINTER : add_printer(con, uri); break; - case CUPS_DELETE_PRINTER : + case IPP_OP_CUPS_DELETE_PRINTER : delete_printer(con, uri); break; - case CUPS_ADD_CLASS : + case IPP_OP_CUPS_ADD_MODIFY_CLASS : add_class(con, uri); break; - case CUPS_DELETE_CLASS : + case IPP_OP_CUPS_DELETE_CLASS : delete_printer(con, uri); break; - case CUPS_ACCEPT_JOBS : - case IPP_ENABLE_PRINTER : + case IPP_OP_CUPS_ACCEPT_JOBS : + case IPP_OP_ENABLE_PRINTER : accept_jobs(con, uri); break; - case CUPS_REJECT_JOBS : - case IPP_DISABLE_PRINTER : + case IPP_OP_CUPS_REJECT_JOBS : + case IPP_OP_DISABLE_PRINTER : reject_jobs(con, uri); break; - case CUPS_SET_DEFAULT : + case IPP_OP_CUPS_SET_DEFAULT : set_default(con, uri); break; - case CUPS_GET_DEVICES : + case IPP_OP_CUPS_GET_DEVICES : get_devices(con); break; - case CUPS_GET_DOCUMENT : + case IPP_OP_CUPS_GET_DOCUMENT : get_document(con, uri); break; - case CUPS_GET_PPD : + case IPP_OP_CUPS_GET_PPD : get_ppd(con, uri); break; - case CUPS_GET_PPDS : + case IPP_OP_CUPS_GET_PPDS : get_ppds(con); break; - case CUPS_MOVE_JOB : + case IPP_OP_CUPS_MOVE_JOB : move_job(con, uri); break; - case CUPS_AUTHENTICATE_JOB : + case IPP_OP_CUPS_AUTHENTICATE_JOB : authenticate_job(con, uri); break; - case IPP_CREATE_PRINTER_SUBSCRIPTION : - case IPP_CREATE_JOB_SUBSCRIPTION : - create_subscription(con, uri); + case IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS : + case IPP_OP_CREATE_JOB_SUBSCRIPTIONS : + create_subscriptions(con, uri); break; - case IPP_GET_SUBSCRIPTION_ATTRIBUTES : + case IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES : get_subscription_attrs(con, sub_id); break; - case IPP_GET_SUBSCRIPTIONS : + case IPP_OP_GET_SUBSCRIPTIONS : get_subscriptions(con, uri); break; - case IPP_RENEW_SUBSCRIPTION : + case IPP_OP_RENEW_SUBSCRIPTION : renew_subscription(con, sub_id); break; - case IPP_CANCEL_SUBSCRIPTION : + case IPP_OP_CANCEL_SUBSCRIPTION : cancel_subscription(con, sub_id); break; - case IPP_GET_NOTIFICATIONS : + case IPP_OP_GET_NOTIFICATIONS : get_notifications(con); break; @@ -690,7 +690,7 @@ cupsdProcessIPPRequest( cupsdAddSelect(httpGetFd(con->http), (cupsd_selfunc_t)cupsdReadClient, (cupsd_selfunc_t)cupsdWriteClient, con); - + return (1); } else @@ -5201,11 +5201,11 @@ create_requested_array(ipp_t *request) /* I - IPP request */ /* - * 'create_subscription()' - Create a notification subscription. + * 'create_subscriptions()' - Create one or more notification subscriptions. */ static void -create_subscription( +create_subscriptions( cupsd_client_t *con, /* I - Client connection */ ipp_attribute_t *uri) /* I - Printer URI */ { @@ -5253,9 +5253,7 @@ create_subscription( * Is the destination valid? */ - cupsdLogMessage(CUPSD_LOG_DEBUG, - "cupsdCreateSubscription(con=%p(%d), uri=\"%s\")", - con, con->number, uri->values[0].string.text); + cupsdLogMessage(CUPSD_LOG_DEBUG, "create_subscriptions(con=%p(%d), uri=\"%s\")", con, con->number, uri->values[0].string.text); httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme, sizeof(scheme), userpass, sizeof(userpass), host, @@ -5506,7 +5504,7 @@ create_subscription( if (MaxLeaseDuration && (lease == 0 || lease > MaxLeaseDuration)) { cupsdLogMessage(CUPSD_LOG_INFO, - "create_subscription: Limiting notify-lease-duration to " + "create_subscriptions: Limiting notify-lease-duration to " "%d seconds.", MaxLeaseDuration); lease = MaxLeaseDuration;