4.2. Building the Database

When building the database, all PPD files that are present in /usr/share/cups/model are parsed and information about the PPD file is stored. The information that is important for the configuration of the printers is described in Section 3.1, “Queue Structure”, the "ppd_info" part of the PPD file. If a PPD file contains information about multiple printer models, multiple entries are created in the database.

The database has a tree structure. The top-level key is the printer manufacturer in the form used for printer detection (with other chars than A-Za-z0-9 left out, in uppercase). The value is a map where key can be a symbol or a string.

The only possible symbol key is `label containing the printable name of the printer vendor. All string keys are printer models of the manufacturer (in the same form as the manufacturer key) and value is a map where key is a symbol or a string.

Two symbol values are possible. The `label key holds the printable label of the the printer model. `support holds the support status of the printer with possible values "full", "not" and "problematic. If the key is a string, it is a file name of a PPD file and value contains a map containing information about the PPD file.

The information about the PPD file contains the nick name (in order to be displayed to the user), the size and MD5 checksum of the PPD file (for detecting if the file was changed), the used filer (for checking if it is supported by the spooler) and possibly other information got from the PPD file.

Example 4.1. Structure of the database

$[
  "EPSON" : $[
    `label : "EPSON",
    "STYLUSPHOTO810" : $[
      `label : "Stylus Photo 810",
      `support : "full",
      "/usr/share/cups/model/Epson/Stylus_Photo_810-gimp-print.ppd.gz" : $[
        "nickname" : "Epson Stylus Photo 810 Foomatic/gimp-print (recommended)",
        "pnp_vendor" : "",
        "pnp_printer" : "",
        "checksum" : "5208b2414fd9eb9ab6c161196cf79352",
        "size" : 10631,
        "filter" : "foomatic-rip",
      ],
      .... // other PPD files for this model
    ],
    .... // other models of this manufacturer
  ],
  .... // other manufacturers