CAPS Universe documentation
1.0.4
All you need to know to be successful
|
"Line PRinter" tool frontend to libcapsclient More...
Data Structures | |
struct | lpr_exchange |
Functions | |
static void | printer_job_unref (struct lpr_exchange *job) |
static int | get_first_available_printer (struct caps_cl_handle *instance, caps_identifier *id) |
static caps_identifier | printer_by_name_get (struct caps_cl_handle *clh, const char *name) |
static int | commit_document (struct lpr_exchange *lpr) |
static int | copies_set_from_string (struct lpr_exchange *lpr, const char *string) |
static int | port_set_from_string (struct lpr_exchange *lpr, const char *string) |
static int | host_name_and_port_set_from_string (struct lpr_exchange *lpr, const char *string) |
static int | document_set_from_name (struct lpr_exchange *lpr, const char *document_name) |
static void | document_params_set_from_string (struct lpr_exchange *lpr, const char *string) |
static void | copies_parameter_on_demand (struct lpr_exchange *lpr) |
static void | handle_nls (void) |
static void | caps_lpr_print_help_message (void) |
int | main (int argc, char *argv[]) |
Variables | |
static struct lpr_exchange | print_job |
static const struct option | caps_lpr_long_options [] |
|
static |
|
static |
Retrieve ID of first available printer
[in] | instance | The library instance handle |
[in] | id | Pointer where to store the printer's ID |
0 | On success (*id is valid), |
-ENODEV | No printer found |
negative | Failed to retrieve the printer list from the coordinator |
Used if no printer was specified on the command line.
|
static |
Try harder to get the printer ID
[in] | clh | CAPS client library handle to communicate with the printing coordinator |
[in] | name | The printer name to search for |
CAPS_INVALID_IDENTIFIER | If no printer was found |
Positive | Printer's ID |
The CUPS world tends to combine the printer's name¹ and its instance¹ into one printer name. E.g. with name="foo" and instance="bar" the used printer name is something like "foo/bar". But in the CAPS universe only "foo" is used to identify the printer.
¹) From their 'cups_dest_t' structure.
|
static |
Print document from file handle
[in] | lpr | All available information about the printing job |
EXIT_SUCCESS | On success |
EXIT_FAILURE | Else |
|
static |
Set the printing copy count from a string
[in,out] | lpr | The instance to work on |
[in] | string | The copy number string |
EXIT_SUCCESS | On success |
EXIT_FAILURE | If the format wasn't usable |
|
static |
Set the port from a string
[in,out] | lpr | The instance to work on |
[in] | string | The port number string |
EXIT_SUCCESS | On success |
EXIT_FAILURE | If the format wasn't usable |
|
static |
Extract server name and port from the string
[in,out] | lpr | The instance to work on |
[in] | string | The string in the format the -H parameter expects (e.g. <server>[:<port>]) |
EXIT_SUCCESS | On success |
EXIT_FAILURE | If the format wasn't usable |
|
static |
Open the to be printerd document file for reading
[in,out] | lpr | The instance to work on |
[in] | document_name | The name of the document to print |
EXIT_SUCCESS | On success |
EXIT_FAILURE | If the format wasn't usable |
|
static |
Concatenate a string as the document's print parameters for this print transaction
[in] | lpr | The instance to work on |
[in] | string | The print parameters |
|
static |
Add the copies
printing parameter on demand
[in] | lpr | The instance to work on |
"On demand" means: add this printing parameter only, if not already done or more copies than 1 should be printed. Since the user can add this parameter manually via the -o
option, we should not overwrite it.
|
static |
|
static |
int main | ( | int | argc, |
char * | argv[] | ||
) |
|
static |
|
static |
this parser uses a free argument: the number of copies to print. This isn't currently supported by the capscmdparser. Thus, we stay with getopt_long() for now.