Chapter 3. Internal Structures

Table of Contents

3.1. Queue Structure
3.2. Detected Printer Structure

3.1. Queue Structure

The information about a queue is stored as a map with the following keys:

  • "name" : string contains name of the printer queue

  • "uri" : string contains the URI of the printer. The URI can be then passed to the spooler. The URI for CUPS classes is "class".

  • "info" : string contains a human-readable information about the printer queue

  • "location" : string contains a description of the location of the printer queue

  • "accepting" : boolean is true if the queue is accepting jobs, false otherwise

  • "bannerstart" : string is the name of the banner page to be printed at the beginning of each job. The available banners are files under /usr/share/cups/banners

  • "bannerend" : string is the name of the banner page to be printed after each job. The available banners are the same as for bannerstart

  • "allowusers" : list<string> is a list of users allowed to printing. Only one of "allowusers" and "denyusers" can be set. If none of them is set, all users are allowed to print.

  • "denyusers" : list<string> is a list of users not allowed to printing. Only one of "allowusers" and "denyusers" can be set. If none of them is set, all users are allowed to print.

  • "raw" : boolean says if the queue is raw (non-filtering - true) or filtering (false). Filtering queue must have PPD file defined.

  • "changed" : boolean says if the queue was modified and needs to be saved. Queues that weren't modified aren't saved by default.

  • "valid" : boolean says if the queue is valid (supported) for the spooler that is being used. Invalid (unsupported) queues aren't saved. This value is automatically computed.

  • "ppd" : string is the name of the PPD file used for filtering. It must be uncompressed. When queue is read from spooler, the PPD file is taken from the information got by the spooler. If queue is new created, it is taken from the database.

  • "ppd_info" : map holds information got from the PPD file:

    • "filter" : string contains filter to be used when printing. Is used only internally (when detecting if the PPD file can be used for the used spooler

    • "manufacturer" : string contains the name of the manufacturer in user-readable form (the way it will be displayed to user)

    • "model" : string contains the printer model in user-readable form (the way it will be displayed to user)

    • "manufacturer_db" : string contains the manufacturer transformated to the key of the database

    • "model_db" : string contains the model name transformated to the key of the database

    • "nick" : string contains the nick name of the PPD file

    • "lang_version" : string contains the language the PPD file is in

    • "lang_encoding" : string contains the character encoding the PPD file is in

    • "language_level" : string contains the supported level of the PostScript language that can be passed to the filter or printer as its input

  • "ppd_options" : map contains options to be changed in the PPD file before saving. The keys and their values depend on the particular PPD file

  • "options" : map contains options to be stored for the queue in /etc/cups/lpoptions.

  • "state" : string, contains the state of the printer (usual values are "idle" or "stopped")

  • "statemessage" : string contains message describing the state of the queue got by the spooler

  • "default" : boolean is true if the queue is the default queue

  • "type" : string contains the type of the queue. Queues YaST is able to modify have this value set to "yast2".

Example 3.1. Queue Structure

$[
  "accepting":true,
  "allowusers":[],
  "bannerend":"none",
  "bannerstart":"none",
  "changed":false,
  "default":false,
  "denyusers":[],
  "info":"EPSON Stylus Photo 810",
  "location":"USB tisk\303\241rna na //EPSON/Stylus%20Photo%20810",
  "name":"stylusphoto810",
  "options":$[
    "job-sheets":"none,none"
  ],
  "ppd":"/tmp/YaST2-14612-RwCaQh/ppd_fOJ9JTa",
  "ppd_info":$[
    "filter":"foomatic-rip",
    "lang_encoding":"ISOLatin1",
    "lang_version":"English",
    "language_level":3,
    "manufacturer":"Epson",
    "manufacturer_db":"EPSON",
    "model":" Stylus Photo 810",
    "model_db":"STYLUSPHOTO810",
    "nick":"Epson Stylus Photo 810 Foomatic/gimp-print (recommended)"
  ],
  "ppd_options":$[],
  "raw":false,
  "state":"idle",
  "statemessage":"Media tray empty!",
  "type":"yast2",
  "uri":"usb://EPSON/Stylus%20Photo%20810",
  "valid":true
]