From ca6b43fc04e0fe678dbb47c3c1c31be42fcdd4b2 Mon Sep 17 00:00:00 2001
From: msweet
marker-types
, printer-alert
, and
printer-alert-description
printer attributes. Standard
marker-types
values are listed in Table
- 1.
+ 1. String values need special handling - see Reporting Attribute String Values below.
When reporting string values using "ATTR:" messages, a filter or backend must take special care to appropriately quote those values. The scheduler uses the CUPS option parsing code for attributes, so the general syntax is:
+ ++name=simple +name=simple,simple,... +name='complex value' +name="complex value" +name='"complex value"','"complex value"',... ++ +
Simple values are strings that do not contain spaces, quotes, backslashes, or the comma and can be placed verbatim in the "ATTR:" message, for example:
+ ++int levels[4] = { 40, 50, 60, 70 }; /* CMYK */ + +fputs("ATTR: marker-colors=#00FFFF,#FF00FF,#FFFF00,#000000\n", stderr); +fputs("ATTR: marker-high-levels=100,100,100,100\n", stderr); +fprintf(stderr, "ATTR: marker-levels=%d,%d,%d,%d\n", levels[0], levels[1], + levels[2], levels[3], levels[4]); +fputs("ATTR: marker-low-levels=5,5,5,5\n", stderr); +fputs("ATTR: marker-types=toner,toner,toner,toner\n", stderr); ++ +
Complex values that contains spaces, quotes, backslashes, or the comma must be quoted. For a single value a single set of quotes is sufficient:
+ ++fputs("ATTR: marker-message='Levels shown are approximate.'\n", stderr); ++ +
When multiple values are reported, each value must be enclosed by a set of single and double quotes:
+ ++fputs("ATTR: marker-names='\"Cyan Toner\"','\"Magenta Toner\"'," + "'\"Yellow Toner\"','\"Black Toner\"'\n", stderr); ++ +
The IPP backend includes a quote_string function that may be used to properly quote a complex value in an "ATTR:" message:
+ ++static const char * /* O - Quoted string */ +quote_string(const char *s, /* I - String */ + char *q, /* I - Quoted string buffer */ + size_t qsize) /* I - Size of quoted string buffer */ +{ + char *qptr, /* Pointer into string buffer */ + *qend; /* End of string buffer */ + + + qptr = q; + qend = q + qsize - 5; + + if (qend < q) + { + *q = '\0'; + return (q); + } + + *qptr++ = '\''; + *qptr++ = '\"'; + + while (*s && qptr < qend) + { + if (*s == '\\' || *s == '\"' || *s == '\'') + { + if (qptr < (qend - 4)) + { + *qptr++ = '\\'; + *qptr++ = '\\'; + *qptr++ = '\\'; + } + else + break; + } + + *qptr++ = *s++; + } + + *qptr++ = '\"'; + *qptr++ = '\''; + *qptr = '\0'; + + return (q); +} ++ +
Filters are responsible for managing the state keywords they set using diff --git a/doc/help/api-array.html b/doc/help/api-array.html index 0c1998ee3..6bd01d94e 100644 --- a/doc/help/api-array.html +++ b/doc/help/api-array.html @@ -38,7 +38,7 @@ P.example { font-style: italic; margin-left: 36pt; } - + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -77,7 +77,7 @@ A:link:hover IMG { } A:link, A:visited { - font-weight: normal; + font-weight: inherit; text-decoration: none; } diff --git a/doc/help/api-cgi.html b/doc/help/api-cgi.html index 82c740a86..57087c5f5 100644 --- a/doc/help/api-cgi.html +++ b/doc/help/api-cgi.html @@ -38,7 +38,7 @@ P.example { font-style: italic; margin-left: 36pt; } - + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -77,7 +77,7 @@ A:link:hover IMG { } A:link, A:visited { - font-weight: normal; + font-weight: inherit; text-decoration: none; } diff --git a/doc/help/api-cups.html b/doc/help/api-cups.html index b355e108b..cdd11fdfa 100644 --- a/doc/help/api-cups.html +++ b/doc/help/api-cups.html @@ -38,7 +38,7 @@ P.example { font-style: italic; margin-left: 36pt; } - + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -77,7 +77,7 @@ A:link:hover IMG { } A:link, A:visited { - font-weight: normal; + font-weight: inherit; text-decoration: none; } diff --git a/doc/help/api-filedir.html b/doc/help/api-filedir.html index fc7b72a40..f07524af7 100644 --- a/doc/help/api-filedir.html +++ b/doc/help/api-filedir.html @@ -38,7 +38,7 @@ P.example { font-style: italic; margin-left: 36pt; } - + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -77,7 +77,7 @@ A:link:hover IMG { } A:link, A:visited { - font-weight: normal; + font-weight: inherit; text-decoration: none; } diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html index 542805879..db774c4c0 100644 --- a/doc/help/api-filter.html +++ b/doc/help/api-filter.html @@ -38,7 +38,7 @@ P.example { font-style: italic; margin-left: 36pt; } - + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -77,7 +77,7 @@ A:link:hover IMG { } A:link, A:visited { - font-weight: normal; + font-weight: inherit; text-decoration: none; } @@ -345,7 +345,7 @@ div.contents ul.subcontents li { Filter and backend programming header for CUPS. - Copyright 2008-2011 by Apple Inc. + Copyright 2008-2014 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -664,7 +664,7 @@ prefix strings:
marker-types
, printer-alert
, and
printer-alert-description
printer attributes. Standard
marker-types
values are listed in Table
- 1.When reporting string values using "ATTR:" messages, a filter or backend must take special care to appropriately quote those values. The scheduler uses the CUPS option parsing code for attributes, so the general syntax is:
+ ++name=simple +name=simple,simple,... +name='complex value' +name="complex value" +name='"complex value"','"complex value"',... ++ +
Simple values are strings that do not contain spaces, quotes, backslashes, or the comma and can be placed verbatim in the "ATTR:" message, for example:
+ ++int levels[4] = { 40, 50, 60, 70 }; /* CMYK */ + +fputs("ATTR: marker-colors=#00FFFF,#FF00FF,#FFFF00,#000000\n", stderr); +fputs("ATTR: marker-high-levels=100,100,100,100\n", stderr); +fprintf(stderr, "ATTR: marker-levels=%d,%d,%d,%d\n", levels[0], levels[1], + levels[2], levels[3], levels[4]); +fputs("ATTR: marker-low-levels=5,5,5,5\n", stderr); +fputs("ATTR: marker-types=toner,toner,toner,toner\n", stderr); ++ +
Complex values that contains spaces, quotes, backslashes, or the comma must be quoted. For a single value a single set of quotes is sufficient:
+ ++fputs("ATTR: marker-message='Levels shown are approximate.'\n", stderr); ++ +
When multiple values are reported, each value must be enclosed by a set of single and double quotes:
+ ++fputs("ATTR: marker-names='\"Cyan Toner\"','\"Magenta Toner\"'," + "'\"Yellow Toner\"','\"Black Toner\"'\n", stderr); ++ +
The IPP backend includes a quote_string function that may be used to properly quote a complex value in an "ATTR:" message:
+ ++static const char * /* O - Quoted string */ +quote_string(const char *s, /* I - String */ + char *q, /* I - Quoted string buffer */ + size_t qsize) /* I - Size of quoted string buffer */ +{ + char *qptr, /* Pointer into string buffer */ + *qend; /* End of string buffer */ + + + qptr = q; + qend = q + qsize - 5; + + if (qend < q) + { + *q = '\0'; + return (q); + } + + *qptr++ = '\''; + *qptr++ = '\"'; + + while (*s && qptr < qend) + { + if (*s == '\\' || *s == '\"' || *s == '\'') + { + if (qptr < (qend - 4)) + { + *qptr++ = '\\'; + *qptr++ = '\\'; + *qptr++ = '\\'; + } + else + break; + } + + *qptr++ = *s++; + } + + *qptr++ = '\"'; + *qptr++ = '\''; + *qptr = '\0'; + + return (q); +} ++ +
Filters are responsible for managing the state keywords they set using diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html index f6f117b56..5f4f2f38c 100644 --- a/doc/help/api-httpipp.html +++ b/doc/help/api-httpipp.html @@ -38,7 +38,7 @@ P.example { font-style: italic; margin-left: 36pt; } - + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -77,7 +77,7 @@ A:link:hover IMG { } A:link, A:visited { - font-weight: normal; + font-weight: inherit; text-decoration: none; } @@ -408,7 +408,10 @@ current thread.">cupsLastErrorString specified listening socket.">httpAcceptConnection
1 if "any", 0 otherwise
+Close a socket created by httpAddrConnect
or
+httpAddrListen
.
+int httpAddrClose (
+ http_addr_t *addr,
+ int fd
+);
NULL
0 on success, -1 on failure
+Pass NULL
for sockets created with httpAddrConnect
and the
+listen address for sockets created with httpAddrListen
. This will
+ensure that domain sockets are removed when closed.
+
+
Compare two addresses.
@@ -1471,6 +1515,19 @@ int httpAddrEqual (
1 if equal, 0 if not
+Get the address family of an address.
+
+int httpAddrFamily (
+ http_addr_t *addr
+);
Address family
Return the length of the address in bytes.
@@ -1699,7 +1756,7 @@ void httpBlocking (
0 = no data, 1 = data available
@@ -1725,7 +1782,7 @@ void httpClearCookie (Clear HTTP request fields.
@@ -1736,7 +1793,7 @@ void httpClearFields (Close an HTTP connection.
@@ -1747,8 +1804,24 @@ void httpClose (Compare two sets of X.509 credentials.
+
+int httpCompareCredentials (
+ cups_array_t *cred1,
+ cups_array_t *cred2
+);
1 if they match, 0 if they do not
Connect to a HTTP server.
@@ -1827,23 +1900,6 @@ void httpClose (
instead.
Copy the credentials associated with an encrypted -connection.
-
-int httpCopyCredentials (
- http_t *http,
- cups_array_t **credentials
-);
Status of call (0 = success)
Base64-decode a string.
@@ -1894,7 +1950,7 @@ int httpDelete (
Error code (errno) value
+Return the HTTP field enumeration value for a field +name.
+
+http_field_t httpFieldValue (
+ const char *name
+);
Field index
Flush data from a HTTP connection.
@@ -1981,7 +2051,7 @@ void httpFlush (
Flush data in write buffer.
@@ -1992,7 +2062,7 @@ int httpFlushWrite (Bytes written or -1 on error
@@ -2017,12 +2087,46 @@ int httpGet (Status of call (0 = success)
+Get the most recent activity for a connection.
+
+time_t httpGetActivity (
+ http_t *http
+);
Time of last read or write
+The return value is the UNIX time of the last read or write. + +
+Get the address of the connected peer of a connection.
+
+http_addr_t *httpGetAddress (
+ http_t *http
+);
Connected address or NULL
Returns NULL
if the socket is currently unconnected.
+
+
Get the current authorization string.
@@ -2032,7 +2136,7 @@ char *httpGetAuthString (
Authorization string
@@ -2052,7 +2156,7 @@ int httpGetBlocking (1 if blocking, 0 if non-blocking
@@ -2066,7 +2170,7 @@ const char *httpGetContentEncoding (Content-Coding value or
@@ -2137,6 +2241,25 @@ time_t httpGetDateTime (
UNIX time
+Get the current encryption mode of a connection.
+
+http_encryption_t httpGetEncryption (
+ http_t *http
+);
Current encryption mode
+This function returns the encryption mode for the connection. Use the
+httpIsEncrypted
function to determine whether a TLS session has
+been established.
+
+
Get the value of the Expect header, if any.
@@ -2146,7 +2269,7 @@ http_status_t httpGetExpect (
Expect: status, if any
@@ -2164,7 +2287,7 @@ int httpGetFd (File descriptor or -1 if none
@@ -2178,7 +2301,7 @@ const char *httpGetField (FQDN for connection or system
When "http" points to a connected socket, return the hostname or -address that was used in the call to httpConnect() or httpConnectEncrypt(). +address that was used in the call to httpConnect() or httpConnectEncrypt(), +or the address of the client for the connection from httpAcceptConnection(). Otherwise, return the FQDN for the local system using both gethostname() and gethostbyname() to get the local hostname with domain.
+Get the current Keep-Alive state of the connection.
+
+http_keepalive_t httpGetKeepAlive (
+ http_t *http
+);
Keep-Alive state
Get the amount of data remaining from the content-length or transfer-encoding fields.
@@ -2234,7 +2371,7 @@ int httpGetLength (Content length
@@ -2253,7 +2390,7 @@ off_t httpGetLength2 (Content length
@@ -2261,6 +2398,51 @@ off_t httpGetLength2 (This function returns the complete content length, even for content larger than 2^31 - 1. +
+Get the number of bytes that are buffered for writing.
+
+size_t httpGetPending (
+ http_t *http
+);
Number of bytes buffered
+Get the number of bytes that can be read without blocking.
+
+size_t httpGetReady (
+ http_t *http
+);
Number of bytes available
+Get the number of remaining bytes in the message +body or current chunk.
+
+size_t httpGetRemaining (
+ http_t *http
+);
Remaining bytes
+The httpIsChunked
function can be used to determine whether the
+message body is chunked or fixed-length.
+
Get the current state of the HTTP request.
@@ -2271,7 +2453,7 @@ content larger than 2^31 - 1.HTTP state
@@ -2284,7 +2466,7 @@ http_status_t httpGetStatus (HTTP status
@@ -2300,7 +2482,7 @@ char *httpGetSubField (Version number
@@ -2363,7 +2545,7 @@ char *httpGets (Line or NULL
@@ -2377,7 +2559,7 @@ int httpHead (void httpInitialize (void);
+Report whether a message body is chunked.
+
+int httpIsChunked (
+ http_t *http
+);
1 if chunked, 0 if not
+This function returns non-zero if the message body is composed of +variable-length chunks. + +
+Report whether a connection is encrypted.
+
+int httpIsEncrypted (
+ http_t *http
+);
1 if encrypted, 0 if not
+This function returns non-zero if the connection is currently encrypted. + +
Compute the MD5 sum of the username:group:password.
@@ -2460,7 +2677,7 @@ int httpOptions (
0 on success, non-zero on failure
@@ -2617,7 +2834,7 @@ int httpReconnect2 (0 on success, non-zero on failure
+Resolve the hostname of the HTTP connection +address.
+
+const char *httpResolveHostname (
+ http_t *http,
+ char *buffer,
+ size_t bufsize
+);
Resolved hostname or NULL
Separate a Universal Resource Identifier into its components.
@@ -2755,7 +2992,7 @@ void httpSetAuthString (HTTP_STATUS_CONTINUE
)Set the current Keep-Alive state of a connection.
+
+void httpSetKeepAlive (
+ http_t *http,
+ http_keepalive_t keep_alive
+);
Set the content-length and content-encoding.
@@ -2868,7 +3119,7 @@ void httpSetLength (
Shutdown one side of an HTTP connection.
+
+void httpShutdown (
+ http_t *http
+);
Return the string describing a HTTP state value.
+
+const char *httpStateString (
+ http_state_t state
+);
State string
Return a short string describing a HTTP status code.
@@ -2924,12 +3199,25 @@ int httpTrace (
Status of call (0 = success)
+Return a string describing a URI status code.
+
+const char *httpURIStatusString (
+ http_uri_status_t status
+);
Localized status string
Update the current HTTP state for incoming data.
@@ -2939,7 +3227,7 @@ http_status_t httpUpdate (
HTTP status
@@ -2953,7 +3241,7 @@ int httpWait (ippNew
, ip
The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
+ CUPS 2.0 ippStateString
+Return the name corresponding to a state value.
+
+const char *ippStateString (
+ ipp_state_t state
+);
+Parameters
+
+- state
+- State value
+
+Return Value
+State name
CUPS 1.4/OS X 10.6 ippTagString
Return the tag name corresponding to a tag value.
@@ -5784,6 +6085,8 @@ are server-oriented...
- Bind on top
- IPP_FINISHINGS_BOOKLET_MAKER
- Fold to make booklet
+- IPP_FINISHINGS_COAT
+- Apply protective liquid or powder coating
- IPP_FINISHINGS_COVER
- Add cover
- IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN
@@ -5876,6 +6179,8 @@ are server-oriented...
- Fold the paper vertically into three sections, forming a Z
- IPP_FINISHINGS_JOG_OFFSET
- Offset for binding (any type)
+- IPP_FINISHINGS_LAMINATE
+- Apply protective (solid) material
- IPP_FINISHINGS_NONE
- No finishing
- IPP_FINISHINGS_PUNCH
@@ -5932,6 +6237,14 @@ are server-oriented...
- Staple top left corner
- IPP_FINISHINGS_STAPLE_TOP_RIGHT
- Staple top right corner
+- IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM
+- Three staples on bottom
+- IPP_FINISHINGS_STAPLE_TRIPLE_LEFT
+- Three staples on left
+- IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT
+- Three staples on right
+- IPP_FINISHINGS_STAPLE_TRIPLE_TOP
+- Three staples on top
- IPP_FINISHINGS_TRIM
- Trim (any type)
- IPP_FINISHINGS_TRIM_AFTER_COPIES
@@ -5986,10 +6299,10 @@ are server-oriented...
- Close-Job
- IPP_OP_CREATE_JOB
- Create an empty print job
-- IPP_OP_CREATE_JOB_SUBSCRIPTION CUPS 1.2/OS X 10.5
-- Create a job subscription
-- IPP_OP_CREATE_PRINTER_SUBSCRIPTION CUPS 1.2/OS X 10.5
-- Create a printer subscription
+- IPP_OP_CREATE_JOB_SUBSCRIPTIONS CUPS 1.2/OS X 10.5
+- Create one of more job subscriptions
+- IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS CUPS 1.2/OS X 10.5
+- Create one or more printer subscriptions
- IPP_OP_CUPS_ACCEPT_JOBS
- Accept new jobs on a printer
- IPP_OP_CUPS_ADD_MODIFY_CLASS
@@ -6073,6 +6386,8 @@ are server-oriented...
- IPP_ORIENT_LANDSCAPE
- 90 degrees counter-clockwise
+- IPP_ORIENT_NONE
+- No rotation
- IPP_ORIENT_PORTRAIT
- No rotation
- IPP_ORIENT_REVERSE_LANDSCAPE
diff --git a/doc/help/api-mime.html b/doc/help/api-mime.html
index 226992780..dab2365fd 100644
--- a/doc/help/api-mime.html
+++ b/doc/help/api-mime.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/api-overview.html b/doc/help/api-overview.html
index a310f6e16..95c64e29a 100644
--- a/doc/help/api-overview.html
+++ b/doc/help/api-overview.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/api-ppd.html b/doc/help/api-ppd.html
index 6530d4b9f..47c10386c 100644
--- a/doc/help/api-ppd.html
+++ b/doc/help/api-ppd.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/api-ppdc.html b/doc/help/api-ppdc.html
index 484288e68..63285b48e 100644
--- a/doc/help/api-ppdc.html
+++ b/doc/help/api-ppdc.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/api-raster.html b/doc/help/api-raster.html
index f2dade43c..859dde421 100644
--- a/doc/help/api-raster.html
+++ b/doc/help/api-raster.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/postscript-driver.html b/doc/help/postscript-driver.html
index fde5890be..0a3314b76 100644
--- a/doc/help/postscript-driver.html
+++ b/doc/help/postscript-driver.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/ppd-compiler.html b/doc/help/ppd-compiler.html
index 27decdbbb..2ef33fd28 100644
--- a/doc/help/ppd-compiler.html
+++ b/doc/help/ppd-compiler.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/raster-driver.html b/doc/help/raster-driver.html
index 0399f057c..40fc01d3e 100644
--- a/doc/help/raster-driver.html
+++ b/doc/help/raster-driver.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html
index 5853ede5f..894e0bf44 100644
--- a/doc/help/spec-ppd.html
+++ b/doc/help/spec-ppd.html
@@ -38,7 +38,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
-
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -77,7 +77,7 @@ A:link:hover IMG {
}
A:link, A:visited {
- font-weight: normal;
+ font-weight: inherit;
text-decoration: none;
}
--
2.39.2