Some convinience functions dealing with jobs.
More...
- Copyright
- GNU General Public License 2 or later
- Author
- Jürgen Borleis
- Warning
- Use as experimental
◆ job_file_seek()
Wrapper to read some data from the document
- Parameters
-
| [in] | job | The job data collection |
| [in] | offset | The read offset in the document's file |
- Return values
-
| 0 | Successful |
| Negative | An errno code from the lseek syscall |
◆ job_file_read()
| ssize_t job_file_read |
( |
struct document_desc * |
job, |
|
|
void * |
buf, |
|
|
size_t |
count |
|
) |
| |
Wrapper to read some data from the document
- Parameters
-
| [in] | job | The job data collection |
| [in,out] | buf | Where to store the read data |
| [in] | count | Size in bytes of buf |
- Return values
-
| Positive | The count of bytes read from the file into buf |
| Negative | An errno code from the read syscall |
◆ job_is_duplex()
Check if this job should be printed in duplex mode
- Parameters
-
| [in] | job | The job data collection |
- Return values
-
| true | Print in duplex mode |
| false | Print in simplex mode |
◆ job_is_collating()
Check if this job should be printed in collating mode
- Parameters
-
| [in] | job | The job data collection |
- Return values
-
| true | Print collated |
| false | Print non-collated |
◆ job_copies_get()
Read the amount of media copies to print
- Parameters
-
| [in] | job | The job data collection |
- Returns
- Amount of copies to print (never '0')
TODO can this ever happen?
◆ job_value_get()
| static const char * job_value_get |
( |
struct document_desc * |
job, |
|
|
const char * |
keyword, |
|
|
const char * |
name |
|
) |
| |
|
static |
Get the attached job specific PPD value with a special keyword out of the run-time information
- Parameters
-
| [in] | job | The description of the currently attached print job |
| [in] | keyword | Keyword to query for |
| [in] | name | Name of the parameter (can be NULL) |
- Return values
-
| Pointer | Pointer to the parameter's value |
| NULL | If the keyword does not exist or has no value |
- Attention
- A
keyword/name option without a value cannot be distinguished from a nonexistent keyword/name option.
Refer caps_ppd_option for details about the meaning of keyword and name.
◆ get_color_model_macro()
Convert the colour name (PPD related) to the corresponding colour macro
- Parameters
-
| [in] | job | The description of the currently attached print job |
- Returns
- The colour macro
Relies on the existence of the DefaultColorModel entry in the PPD option list.
- Note
- This function does not return in the case the given name is invalid
Valid colour names are listed in cmodels
◆ job_medium_format_name_get()
| static const char * job_medium_format_name_get |
( |
struct document_desc * |
job | ) |
|
|
static |
Get the format name of the user selected print medium (or the default one defined by the printer driver)
- Parameters
-
| [in] | job | The description of the currently attached print job |
- Returns
- The format name based on the PPD content (e.g. the corresponding option table)
Relies on the existence of the DefaultPageSize entry in the PPD option list.
- Note
- Does not return in the case the
DefaultPageSize isn't set in the option list and in this case it seems libcapsppd is broken.
-
The returned string is valid, as long as the document_desc::ppd_options is valid
◆ job_medium_leading_edge_get()
Get the the user selected leading edge of print medium
- Parameters
-
| [in] | job | The description of the currently attached print job |
- Returns
- The leading edge macro
Relies on the existence of the DefaultLeadingEdge entry in the PPD option list.
- Note
- Does not return in the case the
DefaultLeadingEdge isn't set in the option list and in this case it seems libcapsppd is broken.
◆ list_ppd_db_entries()
Print the whole list of available job configuration options for debugging purposes
- Parameters
-
| [in] | db | The table with job configuration options |
The list is only visible in the logs if the library was compiled with DEBUG enabled and the run-time loglevel is at debug as well.
◆ job_choice_get()
| static const char * job_choice_get |
( |
struct document_desc * |
job, |
|
|
const char * |
keyword |
|
) |
| |
|
static |
◆ cmodels
Initial value:= {
{ .val = 0, },
}
@ LIBCAPS_CT_RGB
Definition: libcapsppd.h:204
@ LIBCAPS_CT_GRAY
Definition: libcapsppd.h:203
@ LIBCAPS_CT_MONOCHROME
Definition: libcapsppd.h:202
@ LIBCAPS_CT_CMYK
Definition: libcapsppd.h:205
The used names here rely on the used names in libcapsppd!