From: Michael R Sweet Once you are done using the IPP response message, free it using the CUPS normally handles authentication through the console. GUI applications should set a password callback using the CUPS supports authentication and authorization using HTTP Basic, HTTP Digest, peer credentials when communicating over domain sockets, and OAuth/OpenID Connect. Peer credential authorization happens automatically when connected over a domain socket. Other types of authentication requires the application to handle When you call The password callback is called when needed and is responsible for setting the current user name using The "prompt" argument is a string from CUPS that should be displayed to the user. The "http" argument is the connection hosting the request that is being authenticated. The password callback can call the The "method" argument specifies the HTTP method used for the request and is typically "GET", "POST", or "PUT". The "resource" argument specifies the path or URI used for the request. The "cb_data" argument provides the data pointer from the When you call The password callback will be called when needed and is responsible for setting the current user name using The OAuth callback is called when needed and is responsible for performing any necessary authorization and returning an access token string: The "http" argument is the connection hosting the request that is being authenticated. The OAuth callback can call the The "realm" and "scope" arguments provide the "realm" and "scope" parameters, if any, from the "WWW-Authenticate" header. The "resource" argument specifies the path or URI used for the request. The "cb_data" argument provides the data pointer from the CUPS provides a generic OAuth/OpenID client for authorizing access to printers and other network resources. The following functions are provided: Once you have an access token you use the Users can authorize using their preferred web browser via the Users can authorize using a mobile device via the The The The The The The following standards are supported: RFC 6750: The OAuth 2.0 Authorization Framework: Bearer Token Usage RFC 7636: Proof Key for Code Exchange by OAuth Public Clients RFC 9068: JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens The IPP data file API provides functions to read and write IPP attributes and other commands or data using a common base format that supports tools such as 0 on success, -1 on error This function should be called in response to a This function performs authentication for a request. It should be called in
+response to a Create a new JSON key node.
-cups_json_t *cupsJSONNewKey(cups_json_t *parent, cups_json_t *after, const char *value);
ippDelete function:
-ippDelete(response);
Authentication
-cupsSetPasswordCB2 function:Authentication and Authorization
+HTTP_STATUS_UNAUTHORIZED responses beyond simply calling cupsDoAuthentication.Authentication Using Passwords
+cupsDoAuthentication and the HTTP server requires the "Basic" or "Digest" authentication schemes, CUPS normally requests a password from the console. GUI applications should set a password callback using the cupsSetPasswordCB2 function:
+void
+cupsSetPasswordCB2(cups_password_cb2_t cb, void *cb_data);
+cupsSetUser and returning a (password) string:
+const char *
+cups_password_cb(const char *prompt, http_t *http,
+ const char *method, const char *resource,
+ void *cb_data);
+httpGetField and httpGetSubField functions to look for additional details concerning the authentication challenge.cupsSetPasswordCB2 call.Authorization using OAuth/OpenID Connect
+cupsDoAuthentication and the HTTP server requires the "Bearer" authentication scheme, CUPS will call an OAuth callback that you register using the cupsSetOAuthCB function:
-void
-cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
+cupsSetOAuthCB(cups_oauth_cb_t cb, void *cb_data);
cupsSetUser and returning a string:
+const char *
-cups_password_cb2(const char *prompt, http_t *http,
- const char *method, const char *resource,
- void *user_data);
+cups_oauth_cb(http_t *http, const char *realm, const char *scope,
+ const char *resource, void *cb_data);
+httpGetField and httpGetSubField functions to look for additional details concerning the authentication challenge.cupsSetOAuthCB call.OAuth Client Functions
+
+
+cupsOAuthClearTokens: Clear all cached tokens.cupsOAuthCopyAccessToken: Copy the cached access token.cupsOAuthCopyClientId: Copy the cached client ID.cupsOAuthCopyRefreshToken: Copy the cached refresh token.cupsOAuthCopyUserId: Copy the cached user ID.cupsOAuthGetAuthorizationCode: Get an authorization code using a web browser.cupsOAuthGetClientId: Get a client ID using dynamic client registration.cupsOAuthGetDeviceGrant: Get a device authorization grant code.cupsOAuthGetJWKS: Get the key set for an authorization server.cupsOAuthGetMetadata: Get the metadata for an authorization server.cupsOAuthGetTokens: Get access and refresh tokens for an authorization/grant code.cupsOAuthGetUserId: Get the user ID associated with an access token.cupsOAuthMakeAuthorizationURL: Make the URL for web browser authorization.cupsOAuthMakeBase64Random: Make a Base64-encoded string of random bytes.cupsOAuthSaveClientData: Save a client ID and secret for an authorization server.cupsOAuthSaveTokens: Save access and refresh tokens for an authorization server.httpSetAuthString function to use it for a HTTP connection:
+http_t *http;
+char *access_token;
+
+httpSetAuthString(http, "Bearer", access_token);
+Authorizing Using a Web Browser
+cupsOAuthGetAuthorizationCode function, which returns an authorization grant code string. The following code gets the authorization server metadata, authorizes access through the web browser, and then obtains a HTTP Bearer access token:
+http_t *http; // HTTP connection
+const char *auth_uri; // Base URL for Authorization Server
+cups_json_t *metadata; // Authorization Server metadata
+const char *printer_uri; // Printer URI
+char *auth_code; // Authorization grant code
+char *access_token; // Access token
+time_t access_expires; // Date/time when access token expires
+
+// Get the metadata for the authorization server.
+metadata = cupsOAuthGetMetadata(auth_uri);
+
+if (metadata == NULL)
+{
+ // Handle error getting metadata from authorization server.
+}
+
+// Bring up the web browser to authorize and get an authorization code.
+auth_code = cupsOAuthGetAuthorizationCode(auth_uri, metadata, printer_uri,
+ /*scopes*/NULL,
+ /*redirect_uri*/NULL);
+
+if (auth_code == NULL)
+{
+ // Unable to authorize.
+}
+
+// Get the access code from the authorization code.
+access_token = cupsOAuthGetTokens(auth_uri, metadata, printer_uri, auth_code,
+ CUPS_OGRANT_AUTHORIZATION_CODE,
+ /*redirect_uri*/NULL, &access_expires);
+
+if (access_token == NULL)
+{
+ // Unable to get access token.
+}
+
+// Set the Bearer token for authorization.
+httpSetAuthString(http, "Bearer", access_token);
+free(access_token);
+Authorizing Using a Mobile Device
+cupsOAuthGetDeviceGrant function, which returns a JSON object with the mobile authorization URLs, user (verification) code string, and device grant code. The following code gets the authorization server metadata, gets the mobile device authorization information, and then obtains a HTTP Bearer access token:
-http_t *http; // HTTP connection
+const char *auth_uri; // Base URL for Authorization Server
+cups_json_t *metadata; // Authorization Server metadata
+const char *printer_uri; // Printer URI
+cups_json_t *device_grant; // Device authorization grant object
+const char *device_code; // Device grant code
+const char *verify_url; // Mobile device URL
+const char *verify_urlc; // Mobile device URL with user code
+const char *user_code; // User code
+char *access_token; // Access token
+time_t access_expires; // Date/time when access token expires
+
+// Get the metadata for the authorization server.
+metadata = cupsOAuthGetMetadata(auth_uri);
+
+if (metadata == NULL)
+{
+ // Handle error getting metadata from authorization server.
+}
+
+// Get a device authorization grant for mobile authorization.
+device_grant = cupsOAuthGetDeviceGrant(auth_uri, metadata, printer_uri,
+ /*scopes*/NULL);
+
+device_code = cupsJSONGetString(
+ cupsJSONFind(device_grant, CUPS_ODEVGRANT_DEVICE_CODE));
+verify_url = cupsJSONGetString(
+ cupsJSONFind(device_grant, CUPS_ODEVGRANT_VERIFICATION_URI));
+verify_urlc = cupsJSONGetString(
+ cupsJSONFind(device_grant, CUPS_ODEVGRANT_VERIFICATION_URI_COMPLETE));
+user_code = cupsJSONGetString(
+ cupsJSONFind(device_grant, CUPS_ODEVGRANT_USER_CODE));
+
+if (device_code == NULL || verify_url == NULL || verify_urlc == NULL ||
+ user_code == NULL)
+{
+ // Unable to authorize.
+}
+
+// Show the URLs and user code to the user (links and/or QR codes).
+printf("Open this URL: %s\n", verify_urlc);
+
+// Get the access code from the authorization code.
+do
+{
+ // Delay check for several seconds.
+ sleep(5);
+
+ // Try getting an access token.
+ access_token = cupsOAuthGetTokens(auth_uri, metadata, printer_uri, device_code,
+ CUPS_OGRANT_DEVICE_CODE,
+ /*redirect_uri*/NULL, &access_expires);
+}
+while (access_token == NULL && access_expires > 0);
+ // Continue checking until we have an access token or
+ // the device code has expired.
+
+if (access_token == NULL)
+{
+ // Unable to get access token.
+}
+
+// Set the Bearer token for authorization.
+httpSetAuthString(http, "Bearer", access_token);
+free(access_token);
prompt argument is a string from CUPS that should be displayed to the user.http argument is the connection hosting the request that is being authenticated. The password callback can call the httpGetField and httpGetSubField functions to look for additional details concerning the authentication challenge.method argument specifies the HTTP method used for the request and is typically "POST".resource argument specifies the path used for the request.user_data argument provides the user data pointer from the cupsSetPasswordCB2 call.Supported OAuth Standards
+
+
IPP Data File API
ipptool and ippeveprinter.Creating an IPP Data File
@@ -3490,10 +3705,11 @@ You must call this function prior to cupsDN
Resource path
Return Value
-0 on success, -1 on errorDiscussion
-HTTP_STATUS_UNAUTHORIZED
-status, prior to resubmitting your request.
+HTTP_STATUS_UNAUTHORIZED status, prior to resubmitting your
+request.
cupsDoFileRequest
@@ -5306,14 +5522,14 @@ or a suitable IPP_STATUS_ERROR_ value if an error occurred.
CUPS 2.5 cupsJSONNewKey
| parent | Parent JSON node or NULL for a root node |
|---|---|
| after | Previous sibling node or NULL to append to the end |
| value | +|
| key | Key string |
This function performs a local/"native" OAuth authorization flow to obtain an
authorization code for use with the cupsOAuthGetTokens function.
-The "auth_uri" parameter specifies the URI for the OAuth Authorization
-Server. The "metadata" parameter specifies the Authorization Server metadata
+The "auth_uri" argument specifies the URI for the OAuth Authorization
+Server. The "metadata" argument specifies the Authorization Server metadata
as obtained using cupsOAuthCopyMetadata and/or
cupsOAuthGetMetadata.
-The "resource_uri" parameter specifies the URI for a resource (printer, web
+The "resource_uri" argument specifies the URI for a resource (printer, web
file, etc.) that you which to access.
-The "scopes" parameter specifies zero or more whitespace-delimited scope
+The "scopes" argument specifies zero or more whitespace-delimited scope
names to request during authorization. The list of supported scope names are
available from the Authorization Server metadata, for example:
@@ -6068,7 +6284,7 @@ cups_json_t *metadata = cupsOAuthGetMetadata(auth_uri);
cups_json_t *scopes_supported = cupsJSONFind(metadata, "scopes_supported");
-The "redirect_uri" parameter specifies a 'http:' URL with a listen address,
+The "redirect_uri" argument specifies a 'http:' URL with a listen address,
port, and path to use. If NULL, 127.0.0.1 on a random port is used with a
path of "/".
@@ -6098,8 +6314,8 @@ The returned authorization code must be freed using the free functi
This function registers a client application with the specified OAuth
Authorization Server.
-The "auth_uri" parameter specifies the URI for the OAuth Authorization
-Server. The "metadata" parameter specifies the Authorization Server metadata
+The "auth_uri" argument specifies the URI for the OAuth Authorization
+Server. The "metadata" argument specifies the Authorization Server metadata
as obtained using cupsOAuthCopyMetadata and/or
cupsOAuthGetMetadata.
@@ -6116,6 +6332,77 @@ The returned "client_id" string must be freed using the freecupsOAuthGetAuthorizationCode function handles registration of
local/"native" applications for you.
+
Get a device authorization grant for the specified resource and scope(s).
++cups_json_t *cupsOAuthGetDeviceGrant(const char *auth_uri, cups_json_t *metadata, const char *resource_uri, const char *scopes);
+| auth_uri | +Authorization Server URI |
|---|---|
| metadata | +Authorization Server metadata |
| resource_uri | +Resource URI |
| scopes | +Space-delimited scopes |
Grant data or NULL on error
This function requests a device authorization grant for the specified
+resource and scope(s). Device authorization grants allow a user to open a
+web page on any device to authorize access to the resource.
+
+The "auth_uri" argument specifies the URI for the OAuth Authorization
+Server. The "metadata" argument specifies the Authorization Server metadata
+as obtained using cupsOAuthCopyMetadata and/or
+cupsOAuthGetMetadata.
+
+The "resource_uri" argument specifies the URI for a resource (printer, web
+file, etc.) that you which to access.
+
+The "scopes" argument specifies zero or more whitespace-delimited scope
+names to request during authorization. The list of supported scope names are
+available from the Authorization Server metadata, for example:
+
+
+cups_json_t *metadata = cupsOAuthGetMetadata(auth_uri); +cups_json_t *scopes_supported = cupsJSONFind(metadata, "scopes_supported"); ++ +The returned JSON object must be freed using the
cupsJSONDelete
+function and contains the following information:
+
+CUPS_ODEVGRANT_DEVICE_CODE: The device code string to be used in
+ subsequent cupsOAuthGetTokens calls.
+CUPS_ODEVGRANT_EXPIRES_IN: The expiration date/time as a number of
+ seconds since the Unix epoch.
+CUPS_ODEVGRANT_INTERVAL: The number of seconds to wait between calls to
+ cupsOAuthGetTokens.
+CUPS_ODEVGRANT_USER_CODE: The user code to enter on the verification
+ web page.
+CUPS_ODEVGRANT_VERIFICATION_URL: The URL for the verification web page.
+CUPS_ODEVGRANT_VERIFICATION_URL_COMPLETE: The URL for the verification
+ web page with the user code filled in.The values can be obtained using the cupsJSONFind,
+@cupsJSONGetNumber@, and @cupsJSONGetString@ functions, for example:
+
+
+cups_json_t *grant = cupsOAuthGetDeviceGrant(...); + +const char *verification_url = cupsJSONGetString(cupsJSONFind(grant, CUPS_ODEVGRANT_VERIFICATION_URL)); +double interval = cupsJSONGetNumber(cupsJSONFind(grant, CUPS_ODEVGRANT_INTERVAL)); ++
Get the JWT key set for an Authorization Server.
@@ -6173,11 +6460,11 @@ freed using thecupsJSONDelete functi
NULL for device grantscupsJSONDelete functi
Server. OpenID Authorization Servers also provide user identification
information.cupsOAuthCopyMetadata and/or
cupsOAuthGetMetadata.CUPS_OGRANT_AUTHORIZATION_CODE: A user authorization grant code.
@@ -6214,7 +6501,12 @@ When successful, the access token and expiration time are returned. The
access token must be freed using the free function. The new refresh token
and any user ID information can be obtained using the
cupsOAuthCopyRefreshToken and cupsOAuthCopyUserId functions
-respectively.
+respectively.CUPS_OGRANT_DEVICE_CODE) and a device
+access token is not yet ready, a NULL access token is returned with the
+expiration time set to the next recommended query time. If the
+"access_expires" value is set to 0 then the device authorization failed.
This function makes an authorization URL for the specified authorization
server and resource.
-The "auth_uri" parameter specifies the URI for the OAuth Authorization
-Server. The "metadata" parameter specifies the Authorization Server metadata
+The "auth_uri" argument specifies the URI for the OAuth Authorization
+Server. The "metadata" argument specifies the Authorization Server metadata
as obtained using cupsOAuthCopyMetadata and/or
cupsOAuthGetMetadata.
-The "resource_uri" parameter specifies the URI for a resource (printer, web
+The "resource_uri" argument specifies the URI for a resource (printer, web
file, etc.) that you which to access.
-The "scopes" parameter specifies zero or more whitespace-delimited scope
+The "scopes" argument specifies zero or more whitespace-delimited scope
names to request during authorization. The list of supported scope names are
available from the Authorization Server metadata, for example:
@@ -6286,25 +6578,25 @@ cups_json_t *metadata = cupsOAuthGetMetadata(auth_uri);
cups_json_t *scopes_supported = cupsJSONFind(metadata, "scopes_supported");
-The "client_id" parameter specifies the client identifier obtained using
+The "client_id" argument specifies the client identifier obtained using
cupsOAuthCopyClientId and/or cupsOAuthGetClientId.
-The "client_id" parameter is the string returned by
+The "client_id" argument is the string returned by
cupsOAuthCopyClientId or cupsOAuthGetClientId.
-The "code_verifier" parameter specifies a random Base64URL-encoded string
+The "code_verifier" argument specifies a random Base64URL-encoded string
that is used by the Proof Key for Code Exchange [RFC7636] extension to help
secure the authorization flow. The cupsOAuthMakeBase64Random function
can be used to generate this string.
-The "nonce" parameter specifies a random Base64URL-encoded string that is
+The "nonce" argument specifies a random Base64URL-encoded string that is
used by OpenID to validate the ID token. The cupsOAuthMakeBase64Random
function can be used to generate this string.
-The "redirect_uri" parameter specifies the URI that will receive the
+The "redirect_uri" argument specifies the URI that will receive the
authorization grant code.
-The "state" parameter is a unique (random) identifier for the authorization
+The "state" argument is a unique (random) identifier for the authorization
request. It is provided to the redirection URI as a form parameter.
Set the OAuth 2.0 callback for CUPS.
-void cupsSetOAuthCB(cups_oauth_cb_t cb, void *user_data);
+void cupsSetOAuthCB(cups_oauth_cb_t cb, void *cb_data);| cb | Callback function |
|---|---|
| user_data | -User data pointer |
| cb_data | +Callback data pointer |
This function sets the OAuth 2.0 callback for the various CUPS APIs that
-send HTTP requests. Pass NULL to restore the default (console-based)
-callback.
+send HTTP requests. Pass NULL to disable OAuth authorization.
The OAuth callback receives the HTTP connection, realm name, scope name (if
any), resource path, and the "user_data" pointer for each request that
@@ -7041,13 +7332,13 @@ each thread for the same callback to be used.
Set the advanced password callback for CUPS.
-void cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
+void cupsSetPasswordCB2(cups_password_cb2_t cb, void *cb_data);| cb | Callback function |
|---|---|
| user_data | -User data pointer |
| cb_data | +Callback data pointer |
Pass NULL to restore the default (console) password callback, which
@@ -8019,7 +8310,7 @@ This function supports both Base64 and Base64url strings.
Encoded string
This function encodes a Base64 string as defined by RFC 4648. The "url"
-parameter controls whether the original Base64 ("url" = false) or the
+argument controls whether the original Base64 ("url" = false) or the
Base64url ("url" = true) alphabet is used.
NULL to use HTTP bufferThis function resolves a DNS-SD URI of the form "scheme://service-instance-name._protocol._tcp.domain/...". The "options" -parameter specifies a bitfield of resolution options including: +argument specifies a bitfield of resolution options including:
HTTP_RESOLVE_DEFAULT: Use default options
@@ -8649,7 +8940,7 @@ parameter specifies a bitfield of resolution options including:
HTTP_RESOLVE_FAXOUT: Resolve the FaxOut service instead of Print (IPP/IPPS)The "cb" parameter specifies a callback that allows resolution to be +
The "cb" argument specifies a callback that allows resolution to be
terminated. The callback is provided the "cb_data" value and returns a
bool value that is true to continue and false to stop. If no callback
is specified ("cb" is NULL), then this function will block up to 90 seconds
@@ -8871,8 +9162,8 @@ data pointer and must return 1 to continue or 0 to error (time) out.
Localized status string
The returned string is localized to the current POSIX locale and is based -on the status strings defined in RFC 7231. +
This function returns a short (localized) string describing a HTTP status +code. The strings are taken from the IANA HTTP Status Code registry.
Localized status string
+This function returns a short (localized) string describing a URI status +value. + +
Update the current HTTP state for incoming data.
@@ -8971,10 +9267,10 @@ ssize_t httpWrite2(http_t *http, co
New attribute The "ipp" parameter refers to an IPP message previously created using
+ The "ipp" argument refers to an IPP message previously created using
the New attribute The "ipp" parameter refers to an IPP message previously created using
+ The "ipp" argument refers to an IPP message previously created using
the New attribute The "ipp" parameter refers to an IPP message previously created using
+ The "ipp" argument refers to an IPP message previously created using
the Return Value
Discussion
-ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -8999,10 +9295,10 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
Return Value
Discussion
-ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9025,14 +9321,21 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
Return Value
Discussion
-ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
-(IPP_TAG_SUBSCRIPTION), or unsupported (IPP_TAG_UNSUPPORTED_GROUP).
+(IPP_TAG_SUBSCRIPTION), or unsupported (IPP_TAG_UNSUPPORTED_GROUP).
+
+The "name" argument specifies the name of the attribute, while the "value"
+argument provides an IPP message containing the collection member attributes.
+
+
+Note: You must call the
ippDelete function on the "value"
+argument to make sure the memory used by the value is released.
IPP_TAG_EVENT_NOTIFICATION), operation
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
-(IPP_TAG_SUBSCRIPTION), or unsupported (IPP_TAG_UNSUPPORTED_GROUP).
+(IPP_TAG_SUBSCRIPTION), or unsupported (IPP_TAG_UNSUPPORTED_GROUP).
+
+The "name" argument specifies the name of the attribute, while the
+"num_values" and "values" arguments provide IPP messages containing the
+collection member attributes for each value.
+
+
+Note: You must call the ippDelete function on each of the
+"values" arguments to make sure the memory used by the value is released.
IPP_TAG_EVENT_NOTIFICATION), operation
This function adds a 1setOf text attribute to an IPP message corresponding to
the specified credentials string.
-The "ipp" parameter refers to an IPP message previously created using
+The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9114,10 +9425,10 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9144,10 +9455,10 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
This function adds an integer or enum attribute to an IPP message.
-The "ipp" parameter refers to an IPP message previously created using
+The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9177,10 +9488,10 @@ Supported values include enum (IPP_TAG_ENUM) and integer
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9208,10 +9519,10 @@ Supported values include enum (IPP_TAG_ENUM) and integer
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9236,10 +9547,10 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9272,16 +9583,16 @@ admin-define (IPP_TAG_ADMINDEFINE).
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
(IPP_TAG_SUBSCRIPTION), or unsupported (IPP_TAG_UNSUPPORTED_GROUP).
-The "lower" parameter must be less than or equal to the "upper" parameter.
Add ranges of values to an IPP message.
@@ -9304,10 +9615,10 @@ The "lower" parameter must be less than or equal to the "upper&qu
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9334,10 +9645,10 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9366,10 +9677,10 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9386,7 +9697,7 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
Add a language-encoded string to an IPP message.
@@ -9410,10 +9721,10 @@ theippNew, ip
Return Value
New attribute
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9426,7 +9737,7 @@ Supported string values include charset (IPP_TAG_CHARSET), keyword
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).
-The "language" parameter must be non-`NULL` for nameWithLanguage and
+The "language" argument must be non-`NULL` for nameWithLanguage and
textWithLanguage string values and must be `NULL` for all other string values.
Add a formatted string to an IPP message.
@@ -9452,10 +9763,10 @@ textWithLanguage string values and must be `NULL` for all other string values.New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document
(IPP_TAG_DOCUMENT), event notification
(IPP_TAG_EVENT_NOTIFICATION), operation (IPP_TAG_OPERATION),
@@ -9469,11 +9780,11 @@ Supported string values include charset (IPP_TAG_CHARSET), keyword
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).
-The "language" parameter must be non-`NULL` for nameWithLanguage
+The "language" argument must be non-`NULL` for nameWithLanguage
and textWithLanguage string values and must be `NULL` for all other
string values.
-The "format" parameter uses formatting characters compatible with the
+The "format" argument uses formatting characters compatible with the
printf family of standard functions. Additional arguments follow it as
needed. The formatted string is truncated as needed to the maximum length of
the corresponding value type.
@@ -9503,10 +9814,10 @@ the corresponding value type.
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document
(IPP_TAG_DOCUMENT), event notification
(IPP_TAG_EVENT_NOTIFICATION), operation (IPP_TAG_OPERATION),
@@ -9520,11 +9831,11 @@ Supported string values include charset (IPP_TAG_CHARSET), keyword
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).
-The "language" parameter must be non-`NULL` for nameWithLanguage
+The "language" argument must be non-`NULL` for nameWithLanguage
and textWithLanguage string values and must be `NULL` for all other
string values.
-The "format" parameter uses formatting characters compatible with the
+The "format" argument uses formatting characters compatible with the
printf family of standard functions. Additional arguments are passed in the
stdarg pointer "ap". The formatted string is truncated as needed to the
maximum length of the corresponding value type.
@@ -9554,10 +9865,10 @@ maximum length of the corresponding value type.
New attribute
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -9570,7 +9881,7 @@ Supported string values include charset (IPP_TAG_CHARSET), keyword
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).
-The "language" parameter must be non-`NULL` for nameWithLanguage and
+The "language" argument must be non-`NULL` for nameWithLanguage and
textWithLanguage string values and must be `NULL` for all other string values.
Convert the attribute's value to a string.
@@ -9581,16 +9892,17 @@ size_t ippAttributeString(ipp_attribute_t *attr,NULLNumber of bytes less nul
+Number of bytes less nul
Returns the number of bytes that would be written, not including the -trailing nul. The buffer pointer can be NULL to get the required length, -just like (v)snprintf. +
This function converts an attribute's values into a string and returns the
+number of bytes that would be written, not including the trailing nul. The
+buffer pointer can be NULL to get the required length, just like
+(v)snprintf.
1 on a match, 0 on no match
Returns non-zero when the attribute contains either a matching integer or -enum value, or the value falls within one of the rangeOfInteger values for -the attribute. +
This function returns non-zero when the attribute contains either a matching +integer or enum value, or the value falls within one of the rangeOfInteger +values for the attribute.
1 on a match, 0 on no match
Returns non-zero when the attribute contains a matching charset, keyword, -naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value. +
This function returns non-zero when the attribute contains a matching +charset, keyword, naturalLanguage, mimeMediaType, name, text, uri, or +uriScheme value.
1 for a referenced copy, 0 for a new copyNew attribute
The specified attribute, attr, is copied to the destination IPP message.
-When "quickcopy" is non-zero, a "shallow" reference copy of the attribute is
-created - this should only be done as long as the original source IPP message will
-not be freed for the life of the destination.
+
This function copies an attribute to another IPP message. When "quickcopy" +is non-zero, a shallow reference copy of the attribute is created - this +should only be done as long as the original source IPP message will not be +freed for the life of the destination.
Copy attributes from one IPP message to another.
-int ippCopyAttributes(ipp_t *dst, ipp_t *src, int quickcopy, ipp_copy_cb_t cb, void *context);
+int ippCopyAttributes(ipp_t *dst, ipp_t *src, int quickcopy, ipp_copy_cb_t cb, void *cb_data);| dst | @@ -9665,25 +9978,26 @@ not be freed for the life of the destination.|
|---|---|
| src | Source IPP message |
| quickcopy | -1 for a referenced copy, 0 for normal | 1 for a referenced copy, 0 for normal |
| cb | Copy callback or NULL for none |
| context | -Context pointer |
| cb_data | +Callback data pointer |
1 on success, 0 on error
+1 on success, 0 on error
Zero or more attributes are copied from the source IPP message "src" to the -destination IPP message "dst". When "quickcopy" is non-zero, a "shallow" -reference copy of the attribute is created - this should only be done as long -as the original source IPP message will not be freed for the life of the +
This function copies zero or more attributes from the source to the
+destination IPP message. When "quickcopy" is non-zero, a shallow reference
+copy of the attribute is created - this should only be done as long as the
+original source IPP message will not be freed for the life of the
destination.
-The "cb" and "context" parameters provide a generic way to "filter" the
-attributes that are copied - the function must return 1 to copy the attribute or
-0 to skip it. The function may also choose to do a partial copy of the source attribute
-itself.
+The "cb" and "cb_data" arguments provide a generic way to "filter" the
+attributes that are copied - the function must return 1 to copy the
+attribute or 0 to skip it. The function may also choose to do a
+partial copy of the source attribute itself and return 0 to tell this
+function to skip it.
request parameter specifies the request message that was read from
-the client.
-
+The "request" argument specifies the request message that was read from
+the client.NULL is returned if all attributes should be returned. Otherwise, the
-result is a sorted array of attribute names, where cupsArrayFind(array,
-"attribute-name") will return a non-NULL pointer. The array must be freed
-using the cupsArrayDelete function.
+result is a sorted array of attribute names, where
+cupsArrayFind(array, "attribute-name") will return a non-NULL pointer.
+The array must be freed using cupsArrayDelete.
0-based)1 on success, 0 on failure
+1 on success, 0 on failure
This function deletes one or more values in an attribute. The "element"
-parameter specifies the first value to delete, starting at 0. It must be
+argument specifies the first value to delete, starting at 0. It must be
less than the number of values returned by ippGetCount.
-The "attr" parameter may be modified as a result of setting the value,
+The "attr" argument may be modified as a result of setting the value,
which will set the variable to NULL.
Deleting all values in an attribute deletes the attribute.
@@ -9813,7 +10127,7 @@ Deleting all values in an attribute deletes the attribute.
Enum value or -1 if unknown
+Enum value or -1 if unknown
Return a name for the given status code.
@@ -9836,7 +10150,7 @@ ipp_status_t ippErrorValue(const Return Value
IPP status code Close an IPP data file.
bool ippFileClose(ipp_file_t *file);ippFileClose
+ CUPS 2.5 ippFileClose
true on success, false on error
This function closes the current IPP data file. The ipp_file_t object can
-be reused for another file as needed.
Close an IPP data file and free all memory.
bool ippFileDelete(ipp_file_t *file);
@@ -9863,8 +10179,10 @@ be reused for another file as needed.true on success, false on error
This function closes an IPP data file, if necessary, and frees all memory -associated with it.
-Expand IPP data file and environment variables in a string.
size_t ippFileExpandVars(ipp_file_t *file, char *dst, const char *src, size_t dstsize);
@@ -9884,8 +10202,10 @@ size_t ippFileExpandVars(ipp_file_t *file, DiscussionThis function expands IPP data file variables of the form "$name" and environment variables of the form "$ENV[name]" in the source string to the -destination string. The
-Get a single named attribute from an IPP data file.
ipp_attribute_t *ippFileGetAttribute(ipp_file_t *file, const char *name, ipp_tag_t value_tag);
@@ -9904,8 +10224,10 @@ destination string. TheThis function finds the first occurence of a named attribute in the current
IPP attributes in the specified data file. Unlike
ippFileGetAttributes, this function does not clear the attribute
-state.
Get the current set of attributes from an IPP data file.
ipp_t *ippFileGetAttributes(ipp_file_t *file);
@@ -9917,8 +10239,10 @@ state.IPP attributes
This function gets the current set of attributes from an IPP data file.
-This function gets the current set of attributes from an IPP data file. + +
+Get the filename for an IPP data file.
const char *ippFileGetFilename(ipp_file_t *file);
@@ -9930,8 +10254,10 @@ state.Filename
This function returns the filename associated with an IPP data file.
-This function returns the filename associated with an IPP data file. + +
+Get the current line number in an IPP data file.
int ippFileGetLineNumber(ipp_file_t *file);
@@ -9943,8 +10269,10 @@ state.Line number
This function returns the current line number in an IPP data file.
-This function returns the current line number in an IPP data file. + +
+Get the value of an IPP data file variable.
const char *ippFileGetVar(ipp_file_t *file, const char *name);
@@ -9959,9 +10287,11 @@ state.Variable value or NULL if none.
This function returns the value of an IPP data file variable. NULL is
-returned if the variable is not set.
Create a new IPP data file object for reading or writing.
+returned if the variable is not set. + + +Create a new IPP data file object in preparation for reading or writing.
ipp_file_t *ippFileNew(ipp_file_t *parent, ipp_fattr_cb_t attr_cb, ipp_ferror_cb_t error_cb, void *cb_data);
IPP data file
This function opens an IPP data file for reading (mode="r") or writing
-(mode="w"). If the "parent" argument is not NULL, all variables from the
-parent data file are copied to the new file.
This function creates a new IPP data file object. If the "parent" argument
+is not NULL, all variables from the parent data file are copied to the new
+object.
+
+Call the ippFileOpen function to open the IPP data file.
+
+
Open an IPP data file for reading or writing.
bool ippFileOpen(ipp_file_t *file, const char *filename, const char *mode);
@@ -9997,10 +10331,11 @@ parent data file are copied to the new file.true on success, false on error
This function opens an IPP data file for reading (mode="r") or writing
-(mode="w"). If the "parent" argument is not NULL, all variables from the
-parent data file are copied to the new file.
This function opens the IPP data file specified by the "filename" argument +for reading ("mode" is "r") or writing ("mode" is "w"). + +
+Read an IPP data file.
bool ippFileRead(ipp_file_t *file, ipp_ftoken_cb_t token_cb, bool with_groups);
@@ -10015,7 +10350,17 @@ parent data file are copied to the new file.true on success, false on error
This function reads tokens from an IPP data file, processes standard
+directives that define attributes and values, and passes on unknown tokens
+to the token callback "token_cb" for processing.
+
+If the "with_groups" argument is true then the "GROUP" directive will be
+supported for specifying the attribute group(s) associated with any
+defined attributes.
+
+
Read a collection from an IPP data file.
ipp_t *ippFileReadCollection(ipp_file_t *file);
@@ -10029,8 +10374,10 @@ parent data file are copied to the new file.This function reads a collection value from an IPP data file. Collection values are surrounded by curly braces ("{" and "}") and have "MEMBER" -directives to define member attributes in the collection.
-Read a token from an IPP data file.
bool ippFileReadToken(ipp_file_t *file, char *token, size_t tokensize);
@@ -10047,8 +10394,10 @@ directives to define member attributes in the collection.true on success, false on error
This function reads a single token or value from an IPP data file, skipping -comments and whitespace as needed.
-Restore the previous position in an IPP data file.
bool ippFileRestorePosition(ipp_file_t *file);
@@ -10061,8 +10410,10 @@ comments and whitespace as needed.true on success, false on failure
This function restores the previous position in an IPP data file that is open -for reading.
-Save the current position in an IPP data file.
bool ippFileSavePosition(ipp_file_t *file);
@@ -10075,8 +10426,10 @@ for reading.true on success, false on failure
This function saves the current position in an IPP data file that is open -for reading.
-Set the attributes for an IPP data file.
bool ippFileSetAttributes(ipp_file_t *file, ipp_t *attrs);
@@ -10091,8 +10444,10 @@ for reading.true on success, false otherwise
This function sets the current set of attributes for an IPP data file,
-typically an empty collection created with ippNew.
ippNew.
+
+
+Set the group tag for an IPP data file.
bool ippFileSetGroupTag(ipp_file_t *file, ipp_tag_t group_tag);
@@ -10107,8 +10462,10 @@ typically an empty collection created withippNew
true on success, false otherwise
This function sets the group tag associated with attributes that are read -from an IPP data file.
-Set an IPP data file variable to a constant value.
bool ippFileSetVar(ipp_file_t *file, const char *name, const char *value);
@@ -10126,8 +10483,10 @@ from an IPP data file.This function sets an IPP data file variable to a constant value. Setting the "uri" variable also initializes the "scheme", "uriuser", "hostname", -"port", and "resource" variables.
-Set an IPP data file variable to a formatted value.
bool ippFileSetVarf(ipp_file_t *file, const char *name, const char *value, ...);
@@ -10147,8 +10506,10 @@ the "uri" variable also initializes the "scheme", "uriuThis function sets an IPP data file variable to a formatted value. Setting the "uri" variable also initializes the "scheme", "uriuser", "hostname", -"port", and "resource" variables.
-Write an IPP message to an IPP data file.
bool ippFileWriteAttributes(ipp_file_t *file, ipp_t *ipp, bool with_groups);
@@ -10167,8 +10528,10 @@ the "uri" variable also initializes the "scheme", "uriuThis function writes an IPP message to an IPP data file using the attribute
filter specified in the call to ippFileOpen. If "with_group" is
true, "GROUP" directives are written as necessary to place the attributes
-in the correct groups.
Write a comment to an IPP data file.
bool ippFileWriteComment(ipp_file_t *file, const char *comment, ...);
@@ -10185,8 +10548,10 @@ in the correct groups.true on success, false on error
This function writes a comment to an IPP data file. Every line in the string -is prefixed with the "#" character and indented as needed.
-Write a token or value string to an IPP data file.
bool ippFileWriteToken(ipp_file_t *file, const char *token);
@@ -10201,8 +10566,10 @@ is prefixed with the "#" character and indented as needed.true on success, false on error
This function writes a token or value string to an IPP data file, quoting -and indenting the string as needed.
-Write a formatted token or value string to an IPP data file.
bool ippFileWriteTokenf(ipp_file_t *file, const char *token, ...);
@@ -10219,9 +10586,11 @@ and indenting the string as needed.true on success, false on error
This function writes a formatted token or value string to an IPP data file, -quoting and indenting the string as needed.
+quoting and indenting the string as needed. + +Find a named attribute in a request.
+Find a named attribute in an IPP message.
ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t type);
Find the next named attribute in a request.
+Find the next named attribute in an IPP message.
ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name, ipp_tag_t type);
0-based)Boolean value or 0 on error
+Boolean value or 0 on error
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)Collection value or NULL on error
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)dateTime value or NULL
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)Value or 0 on error
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)Pointer to octetString data
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)Lower value of range or 0
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)Horizontal/cross feed resolution or 0
The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)NULL for don't care)Get the string and optionally the language code for an attribute.
-The "element" parameter specifies which value to get from 0 to
-ippGetCount(attr) - 1.
+
The "element" argument specifies which value to get from 0 to
+ippGetCount(attr) - 1.
0-based)1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
0-based)1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
0-based)1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "group" parameter specifies the IPP attribute group tag: none
+The "group" argument specifies the IPP attribute group tag: none
(IPP_TAG_ZERO, for member attributes), document (IPP_TAG_DOCUMENT),
event notification (IPP_TAG_EVENT_NOTIFICATION), operation
(IPP_TAG_OPERATION), printer (IPP_TAG_PRINTER), subscription
@@ -10799,19 +11168,19 @@ event notification (IPP_TAG_EVENT_NOTIFICATION), operation
0-based)1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
0-based)1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
1 on success, 0 on failure
+1 on success, 0 on failure
The "ipp" parameter refers to an IPP message previously created using +
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
ippNew, ip
attr
IPP attribute
element
-Value number (0-based)
+Value number (0-based)
lowervalue
Lower bound for range
uppervalue
Upper bound for range
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
@@ -10934,12 +11303,12 @@ The "element" parameter specifies which value to set from 0 to
Request ID
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The request_id parameter must be greater than 0.
+The "request_id" argument must be greater than 0.
CUPS 1.6 ippSetResolution
@@ -10953,7 +11322,7 @@ The request_id parameter must be greater than 0.
attr
IPP attribute
element
-Value number (0-based)
+Value number (0-based)
unitsvalue
Resolution units
xresvalue
@@ -10962,14 +11331,14 @@ The request_id parameter must be greater than 0.
Vertical/feed resolution
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
@@ -10985,7 +11354,7 @@ The "element" parameter specifies which value to set from 0 to
IPP state value
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
CUPS 1.6 ippSetStatusCode
Set the status code in an IPP response or event message.
@@ -10998,9 +11367,9 @@ The "element" parameter specifies which value to set from 0 to
Status code
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
@@ -11015,19 +11384,19 @@ the ippNew, ip
attr
IPP attribute
element
-Value number (0-based)
+Value number (0-based)
strvalue
String value
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
@@ -11042,24 +11411,24 @@ The "element" parameter specifies which value to set from 0 to
attr
IPP attribute
element
-Value number (0-based)
+Value number (0-based)
format
Printf-style format string
...
Additional arguments as needed
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
-The "format" parameter uses formatting characters compatible with the
+The "format" argument uses formatting characters compatible with the
printf family of standard functions. Additional arguments follow it as
needed. The formatted string is truncated as needed to the maximum length of
the corresponding value type.
@@ -11076,24 +11445,24 @@ the corresponding value type.
attr
IPP attribute
element
-Value number (0-based)
+Value number (0-based)
format
Printf-style format string
ap
Pointer to additional arguments
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
-The "element" parameter specifies which value to set from 0 to
+The "element" argument specifies which value to set from 0 to
ippGetCount(attr).
-The "format" parameter uses formatting characters compatible with the
+The "format" argument uses formatting characters compatible with the
printf family of standard functions. Additional arguments follow it as
needed. The formatted string is truncated as needed to the maximum length of
the corresponding value type.
@@ -11113,12 +11482,12 @@ the corresponding value type.
Value tag
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
-The "attr" parameter may be modified as a result of setting the value.
+The "attr" argument may be modified as a result of setting the value.
Integer (IPP_TAG_INTEGER) values can be promoted to rangeOfInteger
(IPP_TAG_RANGE) values, the various string tags can be promoted to name
@@ -11128,9 +11497,9 @@ Integer (IPP_TAG_INTEGER) values can be promoted to rangeOfInteger
out-of-band value tags such as no-value (IPP_TAG_NOVALUE). All other
changes will be rejected.
-Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
-code in the "attributes-natural-language" attribute or, if not present, the language
-code for the current locale.
+Promoting a string attribute to nameWithLanguage or textWithLanguage adds the
+language code in the "attributes-natural-language" attribute or, if not
+present, the language code for the current locale.
CUPS 1.6 ippSetVersion
@@ -11147,9 +11516,9 @@ code for the current locale.
Minor version number (major.minor)
Return Value
-1 on success, 0 on failure
+1 on success, 0 on failure
Discussion
-The "ipp" parameter refers to an IPP message previously created using
+
The "ipp" argument refers to an IPP message previously created using
the ippNew, ippNewRequest, or ippNewResponse functions.
The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
@@ -11217,10 +11586,10 @@ ipp_tag_t ippTagValue(const Attribute
Return Value
-1 if valid, 0 otherwise
+1 if valid, 0 otherwise
Discussion
This function validates the contents of an attribute based on the name and
-value tag. 1 is returned if the attribute is valid, 0 otherwise. On
+value tag. 1 is returned if the attribute is valid, 0 otherwise. On
failure, cupsGetErrorString is set to a human-readable message.
@@ -11234,7 +11603,7 @@ failure, cupsGetErrorString is se
IPP message
Return Value
-1 if valid, 0 otherwise
+1 if valid, 0 otherwise
Discussion
This function validates the contents of the IPP message, including each
attribute. Like ippValidateAttribute, cupsGetErrorString is
@@ -11666,7 +12035,7 @@ typedef pthread_mutex_t cups_mutex_t;
CUPS 2.4 cups_oauth_cb_t
OAuth callback
-typedef const char *(*)(http_t *http, const char *realm, const char *scope, const char *resource, void *user_data)cups_oauth_cb_t;
+typedef const char *(*)(http_t *http, const char *realm, const char *scope, const char *resource, void *cb_data)cups_oauth_cb_t;
cups_ogrant_t
OAuth Grant Types
@@ -11701,7 +12070,7 @@ typedef struct cups_page_header_s cups_page_he
CUPS 1.4 cups_password_cb2_t
New password callback
-typedef const char *(*)(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data)cups_password_cb2_t;
+typedef const char *(*)(const char *prompt, http_t *http, const char *method, const char *resource, void *cb_data)cups_password_cb2_t;
cups_ptype_t
Combined printer type/capability flags