From: Michael Sweet
Date: Thu, 8 Jun 2017 23:59:02 +0000 (-0400)
Subject: Save work on documentation.
X-Git-Tag: v2.2.4~42
X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=98d88c8d4796d2adc7b0afeb99ae8f34eae42e63
Save work on documentation.
---
diff --git a/cups/Makefile b/cups/Makefile
index 28584bc41..962bee636 100644
--- a/cups/Makefile
+++ b/cups/Makefile
@@ -574,10 +574,8 @@ apihelp:
$(RM) cupspm.xml
mxmldoc --section "Programming" --body cupspm.md \
cupspm.xml \
- auth.c cups.h dest*.c encode.c \
- http.h http*.c ipp.h ipp*.c language.[ch] \
- notify.c options.c \
- tls-darwin.c usersys.c util.c \
+ auth.c cups.h dest*.c encode.c http.h http*.c ipp.h ipp*.c \
+ options.c tls-darwin.c usersys.c util.c \
--coverimage cupspm.png \
--epub ../doc/help/cupspm.epub
mxmldoc --section "Programming" --body cupspm.md \
diff --git a/cups/dest-job.c b/cups/dest-job.c
index 9fc0bdb9a..f12b1dc58 100644
--- a/cups/dest-job.c
+++ b/cups/dest-job.c
@@ -25,13 +25,13 @@
* The "job_id" is the number returned by cupsCreateDestJob.
*
* Returns @code IPP_STATUS_OK@ on success and
- * @code IPP_STATUS_ERRPR_NOT_AUTHORIZED@ or
+ * @code IPP_STATUS_ERROR_NOT_AUTHORIZED@ or
* @code IPP_STATUS_ERROR_FORBIDDEN@ on failure.
*
* @since CUPS 1.6/macOS 10.8@
*/
-ipp_status_t
+ipp_status_t /* O - Status of cancel operation */
cupsCancelDestJob(http_t *http, /* I - Connection to destination */
cups_dest_t *dest, /* I - Destination */
int job_id) /* I - Job ID */
diff --git a/cups/dest-options.c b/cups/dest-options.c
index 2832055a4..4a3a03ab0 100644
--- a/cups/dest-options.c
+++ b/cups/dest-options.c
@@ -833,6 +833,8 @@ cupsFindDestSupported(
/*
* 'cupsFreeDestInfo()' - Free destination information obtained using
* @link cupsCopyDestInfo@.
+ *
+ * @since CUPS 1.6/macOS 10.8@
*/
void
diff --git a/cups/dest.c b/cups/dest.c
index 674d8d2da..0be2bbeb5 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -570,18 +570,19 @@ _cupsAppleSetUseLastPrinter(
/*
- * 'cupsConnectDest()' - Connect to the server for a destination.
+ * 'cupsConnectDest()' - Open a conection to the destination.
*
- * Connect to the destination, returning a new http_t connection object and
- * optionally the resource path to use for the destination. These calls will
- * block until a connection is made, the timeout expires, the integer pointed
- * to by "cancel" is non-zero, or the callback function (or block) returns 0,
- * The caller is responsible for calling httpClose() on the returned object.
+ * Connect to the destination, returning a new @code http_t@ connection object
+ * and optionally the resource path to use for the destination. These calls
+ * will block until a connection is made, the timeout expires, the integer
+ * pointed to by "cancel" is non-zero, or the callback function (or block)
+ * returns 0. The caller is responsible for calling @link httpClose@ on the
+ * returned connection.
*
* @since CUPS 1.6/macOS 10.8@
*/
-http_t * /* O - Connection to server or @code NULL@ */
+http_t * /* O - Connection to destination or @code NULL@ */
cupsConnectDest(
cups_dest_t *dest, /* I - Destination */
unsigned flags, /* I - Connection flags */
@@ -746,18 +747,18 @@ cupsConnectDest(
#ifdef __BLOCKS__
/*
- * 'cupsConnectDestBlock()' - Connect to the server for a destination.
+ * 'cupsConnectDestBlock()' - Open a connection to the destination.
*
- * Connect to the destination, returning a new http_t connection object and
- * optionally the resource path to use for the destination. These calls will
- * block until a connection is made, the timeout expires, the integer pointed
- * to by "cancel" is non-zero, or the callback function (or block) returns 0,
- * The caller is responsible for calling httpClose() on the returned object.
+ * Connect to the destination, returning a new @code http_t@ connection object
+ * and optionally the resource path to use for the destination. These calls
+ * will block until a connection is made, the timeout expires, the integer
+ * pointed to by "cancel" is non-zero, or the block returns 0. The caller is
+ * responsible for calling @link httpClose@ on the returned connection.
*
* @since CUPS 1.6/macOS 10.8@ @exclude all@
*/
-http_t * /* O - Connection to server or @code NULL@ */
+http_t * /* O - Connection to destination or @code NULL@ */
cupsConnectDestBlock(
cups_dest_t *dest, /* I - Destination */
unsigned flags, /* I - Connection flags */
@@ -1414,7 +1415,7 @@ cupsFreeDests(int num_dests, /* I - Number of destinations */
/*
* 'cupsGetDest()' - Get the named destination from the list.
*
- * Use the @link cupsGetDests@ or @link cupsGetDests2@ functions to get a
+ * Use the @link cupsEnumDests@ or @link cupsGetDests2@ functions to get a
* list of supported destinations for the current user.
*/
@@ -1943,12 +1944,18 @@ _cupsGetDests(http_t *http, /* I - Connection to server or
* 'cupsGetDests()' - Get the list of destinations from the default server.
*
* Starting with CUPS 1.2, the returned list of destinations include the
- * printer-info, printer-is-accepting-jobs, printer-is-shared,
- * printer-make-and-model, printer-state, printer-state-change-time,
- * printer-state-reasons, and printer-type attributes as options. CUPS 1.4
- * adds the marker-change-time, marker-colors, marker-high-levels,
- * marker-levels, marker-low-levels, marker-message, marker-names,
- * marker-types, and printer-commands attributes as well.
+ * "printer-info", "printer-is-accepting-jobs", "printer-is-shared",
+ * "printer-make-and-model", "printer-state", "printer-state-change-time",
+ * "printer-state-reasons", "printer-type", and "printer-uri-supported"
+ * attributes as options.
+ *
+ * CUPS 1.4 adds the "marker-change-time", "marker-colors",
+ * "marker-high-levels", "marker-levels", "marker-low-levels", "marker-message",
+ * "marker-names", "marker-types", and "printer-commands" attributes as options.
+ *
+ * CUPS 2.2 adds accessible IPP printers to the list of destinations that can
+ * be used. The "printer-uri-supported" option will be present for those IPP
+ * printers that have been recently used.
*
* Use the @link cupsFreeDests@ function to free the destination list and
* the @link cupsGetDest@ function to find a particular destination.
@@ -1967,17 +1974,23 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
* 'cupsGetDests2()' - Get the list of destinations from the specified server.
*
* Starting with CUPS 1.2, the returned list of destinations include the
- * printer-info, printer-is-accepting-jobs, printer-is-shared,
- * printer-make-and-model, printer-state, printer-state-change-time,
- * printer-state-reasons, and printer-type attributes as options. CUPS 1.4
- * adds the marker-change-time, marker-colors, marker-high-levels,
- * marker-levels, marker-low-levels, marker-message, marker-names,
- * marker-types, and printer-commands attributes as well.
+ * "printer-info", "printer-is-accepting-jobs", "printer-is-shared",
+ * "printer-make-and-model", "printer-state", "printer-state-change-time",
+ * "printer-state-reasons", "printer-type", and "printer-uri-supported"
+ * attributes as options.
+ *
+ * CUPS 1.4 adds the "marker-change-time", "marker-colors",
+ * "marker-high-levels", "marker-levels", "marker-low-levels", "marker-message",
+ * "marker-names", "marker-types", and "printer-commands" attributes as options.
+ *
+ * CUPS 2.2 adds accessible IPP printers to the list of destinations that can
+ * be used. The "printer-uri-supported" option will be present for those IPP
+ * printers that have been recently used.
*
* Use the @link cupsFreeDests@ function to free the destination list and
* the @link cupsGetDest@ function to find a particular destination.
*
- * @since CUPS 1.1.21/macOS 10.4@ @exclude all@
+ * @since CUPS 1.1.21/macOS 10.4@
*/
int /* O - Number of destinations */
@@ -2143,10 +2156,10 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
* 'cupsGetNamedDest()' - Get options for the named destination.
*
* This function is optimized for retrieving a single destination and should
- * be used instead of @link cupsGetDests@ and @link cupsGetDest@ when you either
- * know the name of the destination or want to print to the default destination.
- * If @code NULL@ is returned, the destination does not exist or there is no
- * default destination.
+ * be used instead of @link cupsGetDests2@ and @link cupsGetDest@ when you
+ * either know the name of the destination or want to print to the default
+ * destination. If @code NULL@ is returned, the destination does not exist or
+ * there is no default destination.
*
* If "http" is @code CUPS_HTTP_DEFAULT@, the connection to the default print
* server will be used.
@@ -2383,6 +2396,8 @@ cupsSetDefaultDest(
*
* This function saves the destinations to /etc/cups/lpoptions when run
* as root and ~/.cups/lpoptions when run as a normal user.
+ *
+ * @exclude all@
*/
void
diff --git a/cups/encode.c b/cups/encode.c
index cf9ea8e88..94695d083 100644
--- a/cups/encode.c
+++ b/cups/encode.c
@@ -329,10 +329,8 @@ static int compare_ipp_options(_ipp_option_t *a, _ipp_option_t *b);
* 'cupsEncodeOptions()' - Encode printer options into IPP attributes.
*
* This function adds operation, job, and then subscription attributes,
- * in that order. Use the cupsEncodeOptions2() function to add attributes
+ * in that order. Use the @link cupsEncodeOptions2@ function to add attributes
* for a single group.
- *
- * @exclude all@
*/
void
@@ -356,7 +354,7 @@ cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
* 'cupsEncodeOptions2()' - Encode printer options into IPP attributes for a group.
*
* This function only adds attributes for a single group. Call this
- * function multiple times for each group, or use cupsEncodeOptions()
+ * function multiple times for each group, or use @link cupsEncodeOptions@
* to add the standard groups.
*
* @since CUPS 1.2/macOS 10.5@
diff --git a/cups/http-addr.c b/cups/http-addr.c
index 12d13a697..61c86384b 100644
--- a/cups/http-addr.c
+++ b/cups/http-addr.c
@@ -58,9 +58,9 @@ httpAddrAny(const http_addr_t *addr) /* I - Address to check */
* 'httpAddrClose()' - Close a socket created by @link httpAddrConnect@ or
* @link httpAddrListen@.
*
- * Pass @code NULL@ for sockets created with @link httpAddrConnect@ and the
- * listen address for sockets created with @link httpAddrListen@. This will
- * ensure that domain sockets are removed when closed.
+ * Pass @code NULL@ for sockets created with @link httpAddrConnect2@ and the
+ * listen address for sockets created with @link httpAddrListen@. This function
+ * ensures that domain sockets are removed when closed.
*
* @since CUPS 2.0/OS 10.10@
*/
@@ -648,6 +648,10 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
/*
* 'httpGetAddress()' - Get the address of the connected peer of a connection.
*
+ * For connections created with @link httpConnect2@, the address is for the
+ * server. For connections created with @link httpAccept@, the address is for
+ * the client.
+ *
* Returns @code NULL@ if the socket is currently unconnected.
*
* @since CUPS 2.0/OS 10.10@
@@ -667,7 +671,7 @@ httpGetAddress(http_t *http) /* I - HTTP connection */
* 'httpGetHostByName()' - Lookup a hostname or IPv4 address, and return
* address records for the specified name.
*
- * @deprecated@
+ * @deprecated@ @exclude all@
*/
struct hostent * /* O - Host entry */
diff --git a/cups/http-support.c b/cups/http-support.c
index 3ab461e14..76dbb7dbf 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -566,6 +566,10 @@ httpDecode64(char *out, /* I - String to write to */
/*
* 'httpDecode64_2()' - Base64-decode a string.
*
+ * The caller must initialize "outlen" to the maximum size of the decoded
+ * string before calling @code httpDecode64_2@. On return "outlen" contains the
+ * decoded length of the string.
+ *
* @since CUPS 1.1.21/macOS 10.4@
*/
@@ -690,7 +694,7 @@ httpEncode64(char *out, /* I - String to write to */
char * /* O - Encoded string */
httpEncode64_2(char *out, /* I - String to write to */
- int outlen, /* I - Size of output string */
+ int outlen, /* I - Maximum size of output string */
const char *in, /* I - String to read from */
int inlen) /* I - Size of input string */
{
@@ -782,7 +786,7 @@ httpEncode64_2(char *out, /* I - String to write to */
*/
const char * /* O - Date/time string */
-httpGetDateString(time_t t) /* I - UNIX time */
+httpGetDateString(time_t t) /* I - Time in seconds */
{
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
@@ -798,7 +802,7 @@ httpGetDateString(time_t t) /* I - UNIX time */
*/
const char * /* O - Date/time string */
-httpGetDateString2(time_t t, /* I - UNIX time */
+httpGetDateString2(time_t t, /* I - Time in seconds */
char *s, /* I - String buffer */
int slen) /* I - Size of string buffer */
{
@@ -819,7 +823,7 @@ httpGetDateString2(time_t t, /* I - UNIX time */
* 'httpGetDateTime()' - Get a time value from a formatted date/time string.
*/
-time_t /* O - UNIX time */
+time_t /* O - Time in seconds */
httpGetDateTime(const char *s) /* I - Date/time string */
{
int i; /* Looping var */
@@ -1419,7 +1423,7 @@ _httpStatus(cups_lang_t *lang, /* I - Language */
* 'httpStatus()' - Return a short string describing a HTTP status code.
*
* The returned string is localized to the current POSIX locale and is based
- * on the status strings defined in RFC 2616.
+ * on the status strings defined in RFC 7231.
*/
const char * /* O - Localized status string */
diff --git a/cups/http.c b/cups/http.c
index 15004b624..61b88c9db 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -439,7 +439,7 @@ http_t * /* O - New HTTP connection */
httpConnect2(
const char *host, /* I - Host to connect to */
int port, /* I - Port number */
- http_addrlist_t *addrlist, /* I - List of addresses or NULL to lookup */
+ http_addrlist_t *addrlist, /* I - List of addresses or @code NULL@ to lookup */
int family, /* I - Address family to use or @code AF_UNSPEC@ for any */
http_encryption_t encryption, /* I - Type of encryption to use */
int blocking, /* I - 1 for blocking connection, 0 for non-blocking */
@@ -609,7 +609,7 @@ httpFieldValue(const char *name) /* I - String name */
/*
- * 'httpFlush()' - Flush data from a HTTP connection.
+ * 'httpFlush()' - Flush data read from a HTTP connection.
*/
void
@@ -679,7 +679,7 @@ httpFlush(http_t *http) /* I - HTTP connection */
/*
- * 'httpFlushWrite()' - Flush data in write buffer.
+ * 'httpFlushWrite()' - Flush data written to a HTTP connection.
*
* @since CUPS 1.2/macOS 10.5@
*/
@@ -751,7 +751,7 @@ httpGet(http_t *http, /* I - HTTP connection */
/*
* 'httpGetActivity()' - Get the most recent activity for a connection.
*
- * The return value is the UNIX time of the last read or write.
+ * The return value is the time in seconds of the last read or write.
*
* @since CUPS 2.0/OS 10.10@
*/
@@ -766,10 +766,10 @@ httpGetActivity(http_t *http) /* I - HTTP connection */
/*
* 'httpGetAuthString()' - Get the current authorization string.
*
- * The authorization string is set by cupsDoAuthentication() and
- * httpSetAuthString(). Use httpGetAuthString() to retrieve the
- * string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
- * value.
+ * The authorization string is set by @link cupsDoAuthentication@ and
+ * @link httpSetAuthString@. Use @link httpGetAuthString@ to retrieve the
+ * string to use with @link httpSetField@ for the
+ * @code HTTP_FIELD_AUTHORIZATION@ value.
*
* @since CUPS 1.3/macOS 10.5@
*/
@@ -891,7 +891,7 @@ httpGetContentEncoding(http_t *http) /* I - HTTP connection */
* @since CUPS 1.1.19/macOS 10.3@
*/
-const char * /* O - Cookie data or NULL */
+const char * /* O - Cookie data or @code NULL@ */
httpGetCookie(http_t *http) /* I - HTTP connection */
{
return (http ? http->cookie : NULL);
@@ -1150,7 +1150,7 @@ httpGetRemaining(http_t *http) /* I - HTTP connection */
* 'httpGets()' - Get a line of text from a HTTP connection.
*/
-char * /* O - Line or NULL */
+char * /* O - Line or @code NULL@ */
httpGets(char *line, /* I - Line to read into */
int length, /* I - Max length of buffer */
http_t *http) /* I - HTTP connection */
@@ -1349,7 +1349,7 @@ httpGetStatus(http_t *http) /* I - HTTP connection */
* @deprecated@ @exclude all@
*/
-char * /* O - Value or NULL */
+char * /* O - Value or @code NULL@ */
httpGetSubField(http_t *http, /* I - HTTP connection */
http_field_t field, /* I - Field index */
const char *name, /* I - Name of sub-field */
@@ -1365,7 +1365,7 @@ httpGetSubField(http_t *http, /* I - HTTP connection */
* @since CUPS 1.2/macOS 10.5@
*/
-char * /* O - Value or NULL */
+char * /* O - Value or @code NULL@ */
httpGetSubField2(http_t *http, /* I - HTTP connection */
http_field_t field, /* I - Field index */
const char *name, /* I - Name of sub-field */
@@ -1616,7 +1616,7 @@ httpOptions(http_t *http, /* I - HTTP connection */
*
* This function copies available data from the given HTTP connection, reading
* a buffer as needed. The data is still available for reading using
- * @link httpRead@ or @link httpRead2@.
+ * @link httpRead2@.
*
* For non-blocking connections the usual timeouts apply.
*
@@ -2467,9 +2467,10 @@ httpReconnect2(http_t *http, /* I - HTTP connection */
* 'httpSetAuthString()' - Set the current authorization string.
*
* This function just stores a copy of the current authorization string in
- * the HTTP connection object. You must still call httpSetField() to set
- * HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
- * httpHead(), httpOptions(), httpPost, or httpPut().
+ * the HTTP connection object. You must still call @link httpSetField@ to set
+ * @code HTTP_FIELD_AUTHORIZATION@ prior to issuing a HTTP request using
+ * @link httpGet@, @link httpHead@, @link httpOptions@, @link httpPost@, or
+ * @link httpPut@.
*
* @since CUPS 1.3/macOS 10.5@
*/
@@ -2820,7 +2821,7 @@ httpSetTimeout(
http_t *http, /* I - HTTP connection */
double timeout, /* I - Number of seconds for timeout,
must be greater than 0 */
- http_timeout_cb_t cb, /* I - Callback function or NULL */
+ http_timeout_cb_t cb, /* I - Callback function or @code NULL@ */
void *user_data) /* I - User data pointer */
{
if (!http || timeout <= 0.0)
@@ -2864,6 +2865,8 @@ httpShutdown(http_t *http) /* I - HTTP connection */
/*
* 'httpTrace()' - Send an TRACE request to the server.
+ *
+ * @exclude all@
*/
int /* O - Status of call (0 = success) */
@@ -3898,7 +3901,7 @@ static http_t * /* O - HTTP connection */
http_create(
const char *host, /* I - Hostname */
int port, /* I - Port number */
- http_addrlist_t *addrlist, /* I - Address list or NULL */
+ http_addrlist_t *addrlist, /* I - Address list or @code NULL@ */
int family, /* I - Address family or AF_UNSPEC */
http_encryption_t encryption, /* I - Encryption to use */
int blocking, /* I - 1 for blocking mode */
diff --git a/cups/options.c b/cups/options.c
index 901c75df3..9aa20f895 100644
--- a/cups/options.c
+++ b/cups/options.c
@@ -1,7 +1,7 @@
/*
* Option routines for CUPS.
*
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -35,7 +35,7 @@ static int cups_find_option(const char *name, int num_options,
* New option arrays can be initialized simply by passing 0 for the
* "num_options" parameter.
*
- * @since CUPS 2.2.4@
+ * @since CUPS 2.2.4/macOS 10.13@
*/
int /* O - Number of options */
@@ -185,7 +185,7 @@ cupsFreeOptions(
* INT_MIN is returned when the option does not exist, is not an integer, or
* exceeds the range of values for the "int" type.
*
- * @since 2.2.4@
+ * @since CUPS 2.2.4/macOS 10.13@
*/
int /* O - Option value or @code INT_MIN@ */
diff --git a/cups/usersys.c b/cups/usersys.c
index b4fa81f78..88cccfa23 100644
--- a/cups/usersys.c
+++ b/cups/usersys.c
@@ -147,7 +147,7 @@ cupsGetPassword(const char *prompt) /* I - Prompt string */
/*
- * 'cupsGetPassword2()' - Get a password from the user using the advanced
+ * 'cupsGetPassword2()' - Get a password from the user using the current
* password callback.
*
* Uses the current password callback function. Returns @code NULL@ if the
@@ -155,8 +155,8 @@ cupsGetPassword(const char *prompt) /* I - Prompt string */
*
* Note: The current password callback function is tracked separately for each
* thread in a program. Multi-threaded programs that override the setting via
- * the @link cupsSetPasswordCB@ or @link cupsSetPasswordCB2@ functions need to
- * do so in each thread for the same function to be used.
+ * the @link cupsSetPasswordCB2@ function need to do so in each thread for the
+ * same function to be used.
*
* @since CUPS 1.4/macOS 10.6@
*/
diff --git a/doc/help/api-admin.html b/doc/help/api-admin.html
index 2d2d96a71..c3f6838fc 100644
--- a/doc/help/api-admin.html
+++ b/doc/help/api-admin.html
@@ -508,70 +508,54 @@ show_devices(void)
Create the Windows PPD file for a printer.
-char *cupsAdminCreateWindowsPPD (
- http_t *http,
- const char *dest,
- char *buffer,
- int bufsize
-);
+char *cupsAdminCreateWindowsPPD(http_t *http, const char *dest, char *buffer, int bufsize);
Parameters
-
-- http
- - Connection to server or
CUPS_HTTP_DEFAULT
-- dest
- - Printer or class
-- buffer
- - Filename buffer
-- bufsize
- - Size of filename buffer
-
+
+http |
+ Connection to server or CUPS_HTTP_DEFAULT |
+dest |
+ Printer or class |
+buffer |
+ Filename buffer |
+bufsize |
+ Size of filename buffer |
+
Return Value
PPD file or NULL
Export a printer to Samba.
-int cupsAdminExportSamba (
- const char *dest,
- const char *ppd,
- const char *samba_server,
- const char *samba_user,
- const char *samba_password,
- FILE *logfile
-);
+int cupsAdminExportSamba(const char *dest, const char *ppd, const char *samba_server, const char *samba_user, const char *samba_password, FILE *logfile);
Parameters
-
-- dest
- - Destination to export
-- ppd
- - PPD file
-- samba_server
- - Samba server
-- samba_user
- - Samba username
-- samba_password
- - Samba password
-- logfile
- - Log file, if any
-
+
+dest |
+ Destination to export |
+ppd |
+ PPD file |
+samba_server |
+ Samba server |
+samba_user |
+ Samba username |
+samba_password |
+ Samba password |
+logfile |
+ Log file, if any |
+
Return Value
1 on success, 0 on failure
Get settings from the server.
-int cupsAdminGetServerSettings (
- http_t *http,
- int *num_settings,
- cups_option_t **settings
-);
+int cupsAdminGetServerSettings(http_t *http, int *num_settings, cups_option_t **settings);
Parameters
-
-- http
- - Connection to server or
CUPS_HTTP_DEFAULT
-- num_settings
- - Number of settings
-- settings
- - Settings
-
+
+http |
+ Connection to server or CUPS_HTTP_DEFAULT |
+num_settings |
+ Number of settings |
+settings |
+ Settings |
+
Return Value
1 on success, 0 on failure
Discussion
@@ -582,48 +566,37 @@ you are done with them.
Set settings on the server.
-int cupsAdminSetServerSettings (
- http_t *http,
- int num_settings,
- cups_option_t *settings
-);
+int cupsAdminSetServerSettings(http_t *http, int num_settings, cups_option_t *settings);
Parameters
-
-- http
- - Connection to server or
CUPS_HTTP_DEFAULT
-- num_settings
- - Number of settings
-- settings
- - Settings
-
+
+http |
+ Connection to server or CUPS_HTTP_DEFAULT |
+num_settings |
+ Number of settings |
+settings |
+ Settings |
+
Return Value
1 on success, 0 on failure
Get available printer devices.
-ipp_status_t cupsGetDevices (
- http_t *http,
- int timeout,
- const char *include_schemes,
- const char *exclude_schemes,
- cups_device_cb_t callback,
- void *user_data
-);
+ipp_status_t cupsGetDevices(http_t *http, int timeout, const char *include_schemes, const char *exclude_schemes, cups_device_cb_t callback, void *user_data);
Parameters
-
-- http
- - Connection to server or
CUPS_HTTP_DEFAULT
-- timeout
- - Timeout in seconds or
CUPS_TIMEOUT_DEFAULT
-- include_schemes
- - Comma-separated URI schemes to include or
CUPS_INCLUDE_ALL
-- exclude_schemes
- - Comma-separated URI schemes to exclude or
CUPS_EXCLUDE_NONE
-- callback
- - Callback function
-- user_data
- - User data pointer
-
+
+http |
+ Connection to server or CUPS_HTTP_DEFAULT |
+timeout |
+ Timeout in seconds or CUPS_TIMEOUT_DEFAULT |
+include_schemes |
+ Comma-separated URI schemes to include or CUPS_INCLUDE_ALL |
+exclude_schemes |
+ Comma-separated URI schemes to exclude or CUPS_EXCLUDE_NONE |
+callback |
+ Callback function |
+user_data |
+ User data pointer |
+
Return Value
Request status - IPP_OK
on success.
Discussion
diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html
index 7614f6961..94fec4955 100644
--- a/doc/help/api-filter.html
+++ b/doc/help/api-filter.html
@@ -1320,20 +1320,16 @@ void *my_data;
Read data from the backchannel.
-ssize_t cupsBackChannelRead (
- char *buffer,
- size_t bytes,
- double timeout
-);
+ssize_t cupsBackChannelRead(char *buffer, size_t bytes, double timeout);
Parameters
-
-- buffer
- - Buffer to read into
-- bytes
- - Bytes to read
-- timeout
- - Timeout in seconds, typically 0.0 to poll
-
+
+buffer |
+ Buffer to read into |
+bytes |
+ Bytes to read |
+timeout |
+ Timeout in seconds, typically 0.0 to poll |
+
Return Value
Bytes read or -1 on error
Discussion
@@ -1345,20 +1341,16 @@ return immediately if there is no data, -1.0 to wait for data indefinitely.
Write data to the backchannel.
-ssize_t cupsBackChannelWrite (
- const char *buffer,
- size_t bytes,
- double timeout
-);
+ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes, double timeout);
Parameters
-
-- buffer
- - Buffer to write
-- bytes
- - Bytes to write
-- timeout
- - Timeout in seconds, typically 1.0
-
+
+buffer |
+ Buffer to write |
+bytes |
+ Bytes to write |
+timeout |
+ Timeout in seconds, typically 1.0 |
+
Return Value
Bytes written or -1 on error
Discussion
@@ -1371,14 +1363,12 @@ indefinitely.
Get the device URI for a backend.
-const char *cupsBackendDeviceURI (
- char **argv
-);
+const char *cupsBackendDeviceURI(char **argv);
Parameters
-
-- argv
- - Command-line arguments
-
+
+argv |
+ Command-line arguments |
+
Return Value
Device URI or NULL
Discussion
@@ -1388,34 +1378,26 @@ variable or the device URI passed in argv[0], whichever is found
first.
-
- PPD attribute
+
+ Write a device line from a backend.
-void cupsBackendReport (
- const char *device_scheme,
- const char *device_uri,
- const char *device_make_and_model,
- const char *device_info,
- const char *device_id,
- const char *device_location
-);
+void cupsBackendReport(const char *device_scheme, const char *device_uri, const char *device_make_and_model, const char *device_info, const char *device_id, const char *device_location);
Parameters
-
-- device_scheme
- - device-scheme string
-- device_uri
- - device-uri string
-- device_make_and_model
- - device-make-and-model string or
NULL
-- device_info
- - device-info string or
NULL
-- device_id
- - device-id string or
NULL
-- device_location
- - device-location string or
NULL
-
-Return Value
- Write a device line from a backend.
+
+device_scheme |
+ device-scheme string |
+device_uri |
+ device-uri string |
+device_make_and_model |
+ device-make-and-model string or NULL |
+device_info |
+ device-info string or NULL |
+device_id |
+ device-id string or NULL |
+device_location |
+ device-location string or NULL |
+
+Discussion
This function writes a single device line to stdout for a backend.
It handles quoting of special characters in the device-make-and-model,
device-info, device-id, and device-location strings.
@@ -1424,23 +1406,18 @@ device-info, device-id, and device-location strings.
Send a side-channel command to a backend and wait for a response.
-cups_sc_status_t cupsSideChannelDoRequest (
- cups_sc_command_t command,
- char *data,
- int *datalen,
- double timeout
-);
+cups_sc_status_t cupsSideChannelDoRequest(cups_sc_command_t command, char *data, int *datalen, double timeout);
Parameters
-
-- command
- - Command to send
-- data
- - Response data buffer pointer
-- datalen
- - Size of data buffer on entry, number of bytes in buffer on return
-- timeout
- - Timeout in seconds
-
+
+command |
+ Command to send |
+data |
+ Response data buffer pointer |
+datalen |
+ Size of data buffer on entry, number of bytes in buffer on return |
+timeout |
+ Timeout in seconds |
+
Return Value
Status of command
Discussion
@@ -1458,26 +1435,20 @@ update the value to contain the number of data bytes in the buffer.
Read a side-channel message.
-int cupsSideChannelRead (
- cups_sc_command_t *command,
- cups_sc_status_t *status,
- char *data,
- int *datalen,
- double timeout
-);
+int cupsSideChannelRead(cups_sc_command_t *command, cups_sc_status_t *status, char *data, int *datalen, double timeout);
Parameters
-
-- command
- - Command code
-- status
- - Status code
-- data
- - Data buffer pointer
-- datalen
- - Size of data buffer on entry, number of bytes in buffer on return
-- timeout
- - Timeout in seconds
-
+
+command |
+ Command code |
+status |
+ Status code |
+data |
+ Data buffer pointer |
+datalen |
+ Size of data buffer on entry, number of bytes in buffer on return |
+timeout |
+ Timeout in seconds |
+
Return Value
0 on success, -1 on error
Discussion
@@ -1494,23 +1465,18 @@ update the value to contain the number of data bytes in the buffer.
Query a SNMP OID's value.
-cups_sc_status_t cupsSideChannelSNMPGet (
- const char *oid,
- char *data,
- int *datalen,
- double timeout
-);
+cups_sc_status_t cupsSideChannelSNMPGet(const char *oid, char *data, int *datalen, double timeout);
Parameters
-
-- oid
- - OID to query
-- data
- - Buffer for OID value
-- datalen
- - Size of OID buffer on entry, size of value on return
-- timeout
- - Timeout in seconds
-
+
+oid |
+ OID to query |
+data |
+ Buffer for OID value |
+datalen |
+ Size of OID buffer on entry, size of value on return |
+timeout |
+ Timeout in seconds |
+
Return Value
Query status
Discussion
@@ -1535,23 +1501,18 @@ the printer does not respond to the SNMP query.
Query multiple SNMP OID values.
-cups_sc_status_t cupsSideChannelSNMPWalk (
- const char *oid,
- double timeout,
- cups_sc_walk_func_t cb,
- void *context
-);
+cups_sc_status_t cupsSideChannelSNMPWalk(const char *oid, double timeout, cups_sc_walk_func_t cb, void *context);
Parameters
-
-- oid
- - First numeric OID to query
-- timeout
- - Timeout for each query in seconds
-- cb
- - Function to call with each value
-- context
- - Application-defined pointer to send to callback
-
+
+oid |
+ First numeric OID to query |
+timeout |
+ Timeout for each query in seconds |
+cb |
+ Function to call with each value |
+context |
+ Application-defined pointer to send to callback |
+
Return Value
Status of first query of CUPS_SC_STATUS_OK
on success
Discussion
@@ -1581,26 +1542,20 @@ the printer does not respond to the first SNMP query.
Write a side-channel message.
-int cupsSideChannelWrite (
- cups_sc_command_t command,
- cups_sc_status_t status,
- const char *data,
- int datalen,
- double timeout
-);
+int cupsSideChannelWrite(cups_sc_command_t command, cups_sc_status_t status, const char *data, int datalen, double timeout);
Parameters
-
-- command
- - Command code
-- status
- - Status code
-- data
- - Data buffer pointer
-- datalen
- - Number of bytes of data
-- timeout
- - Timeout in seconds
-
+
+command |
+ Command code |
+status |
+ Status code |
+data |
+ Data buffer pointer |
+datalen |
+ Number of bytes of data |
+timeout |
+ Timeout in seconds |
+
Return Value
0 on success, -1 on error
Discussion
@@ -1648,105 +1603,69 @@ typedef void (*cups_sc_walk_func_t)(const char *oid, const char *data, int datal
Backend exit codes
Constants
-
- - CUPS_BACKEND_AUTH_REQUIRED
- - Job failed, authentication required
- - CUPS_BACKEND_CANCEL
- - Job failed, cancel job
- - CUPS_BACKEND_FAILED
- - Job failed, use error-policy
- - CUPS_BACKEND_HOLD
- - Job failed, hold job
- - CUPS_BACKEND_OK
- - Job completed successfully
- - CUPS_BACKEND_RETRY
- - Job failed, retry this job later
- - CUPS_BACKEND_RETRY_CURRENT
- - Job failed, retry this job immediately
- - CUPS_BACKEND_STOP
- - Job failed, stop queue
-
+
+ CUPS_BACKEND_AUTH_REQUIRED | Job failed, authentication required |
+ CUPS_BACKEND_CANCEL | Job failed, cancel job |
+ CUPS_BACKEND_FAILED | Job failed, use error-policy |
+ CUPS_BACKEND_HOLD | Job failed, hold job |
+ CUPS_BACKEND_OK | Job completed successfully |
+ CUPS_BACKEND_RETRY | Job failed, retry this job later |
+ CUPS_BACKEND_RETRY_CURRENT | Job failed, retry this job immediately |
+ CUPS_BACKEND_STOP | Job failed, stop queue |
+
Bidirectional capability values
Constants
-
- - CUPS_SC_BIDI_NOT_SUPPORTED
- - Bidirectional I/O is not supported
- - CUPS_SC_BIDI_SUPPORTED
- - Bidirectional I/O is supported
-
+
+ CUPS_SC_BIDI_NOT_SUPPORTED | Bidirectional I/O is not supported |
+ CUPS_SC_BIDI_SUPPORTED | Bidirectional I/O is supported |
+
Request command codes
Constants
-
- - CUPS_SC_CMD_DRAIN_OUTPUT
- - Drain all pending output
- - CUPS_SC_CMD_GET_BIDI
- - Return bidirectional capabilities
- - CUPS_SC_CMD_GET_CONNECTED CUPS 1.5/macOS 10.7
- - Return whether the backend is "connected" to the printer
- - CUPS_SC_CMD_GET_DEVICE_ID
- - Return the IEEE-1284 device ID
- - CUPS_SC_CMD_GET_STATE
- - Return the device state
- - CUPS_SC_CMD_SNMP_GET CUPS 1.4/macOS 10.6
- - Query an SNMP OID
- - CUPS_SC_CMD_SNMP_GET_NEXT CUPS 1.4/macOS 10.6
- - Query the next SNMP OID
- - CUPS_SC_CMD_SOFT_RESET
- - Do a soft reset
-
+
+ CUPS_SC_CMD_DRAIN_OUTPUT | Drain all pending output |
+ CUPS_SC_CMD_GET_BIDI | Return bidirectional capabilities |
+ CUPS_SC_CMD_GET_CONNECTED CUPS 1.5/macOS 10.7 | Return whether the backend is "connected" to the printer |
+ CUPS_SC_CMD_GET_DEVICE_ID | Return the IEEE-1284 device ID |
+ CUPS_SC_CMD_GET_STATE | Return the device state |
+ CUPS_SC_CMD_SNMP_GET CUPS 1.4/macOS 10.6 | Query an SNMP OID |
+ CUPS_SC_CMD_SNMP_GET_NEXT CUPS 1.4/macOS 10.6 | Query the next SNMP OID |
+ CUPS_SC_CMD_SOFT_RESET | Do a soft reset |
+
Connectivity values
Constants
-
- - CUPS_SC_CONNECTED
- - Backend is "connected" to printer
- - CUPS_SC_NOT_CONNECTED
- - Backend is not "connected" to printer
-
+
+ CUPS_SC_CONNECTED | Backend is "connected" to printer |
+ CUPS_SC_NOT_CONNECTED | Backend is not "connected" to printer |
+
Printer state bits
Constants
-
- - CUPS_SC_STATE_BUSY
- - Device is busy
- - CUPS_SC_STATE_ERROR
- - Other error condition
- - CUPS_SC_STATE_MARKER_EMPTY
- - Toner/ink out condition
- - CUPS_SC_STATE_MARKER_LOW
- - Toner/ink low condition
- - CUPS_SC_STATE_MEDIA_EMPTY
- - Paper out condition
- - CUPS_SC_STATE_MEDIA_LOW
- - Paper low condition
- - CUPS_SC_STATE_OFFLINE
- - Device is offline
- - CUPS_SC_STATE_ONLINE
- - Device is online
-
+
+ CUPS_SC_STATE_BUSY | Device is busy |
+ CUPS_SC_STATE_ERROR | Other error condition |
+ CUPS_SC_STATE_MARKER_EMPTY | Toner/ink out condition |
+ CUPS_SC_STATE_MARKER_LOW | Toner/ink low condition |
+ CUPS_SC_STATE_MEDIA_EMPTY | Paper out condition |
+ CUPS_SC_STATE_MEDIA_LOW | Paper low condition |
+ CUPS_SC_STATE_OFFLINE | Device is offline |
+ CUPS_SC_STATE_ONLINE | Device is online |
+
Response status codes
Constants
-
- - CUPS_SC_STATUS_BAD_MESSAGE
- - The command/response message was invalid
- - CUPS_SC_STATUS_IO_ERROR
- - An I/O error occurred
- - CUPS_SC_STATUS_NONE
- - No status
- - CUPS_SC_STATUS_NOT_IMPLEMENTED
- - Command not implemented
- - CUPS_SC_STATUS_NO_RESPONSE
- - The device did not respond
- - CUPS_SC_STATUS_OK
- - Operation succeeded
- - CUPS_SC_STATUS_TIMEOUT
- - The backend did not respond
- - CUPS_SC_STATUS_TOO_BIG
- - Response too big
-
+
+ CUPS_SC_STATUS_BAD_MESSAGE | The command/response message was invalid |
+ CUPS_SC_STATUS_IO_ERROR | An I/O error occurred |
+ CUPS_SC_STATUS_NONE | No status |
+ CUPS_SC_STATUS_NOT_IMPLEMENTED | Command not implemented |
+ CUPS_SC_STATUS_NO_RESPONSE | The device did not respond |
+ CUPS_SC_STATUS_OK | Operation succeeded |
+ CUPS_SC_STATUS_TIMEOUT | The backend did not respond |
+ CUPS_SC_STATUS_TOO_BIG | Response too big |
+