Skip to content

Use generated CUPS constants for destination and printer flags#17

Open
Abd002 wants to merge 1 commit into
OpenPrinting:mainfrom
Abd002:cups3-pr-constants
Open

Use generated CUPS constants for destination and printer flags#17
Abd002 wants to merge 1 commit into
OpenPrinting:mainfrom
Abd002:cups3-pr-constants

Conversation

@Abd002
Copy link
Copy Markdown
Contributor

@Abd002 Abd002 commented May 25, 2026

This PR replaces hard-coded CUPS destination/printer flag values with the constants generated from the local CUPS headers.

Previously, cups-rs used hard-coded values that matched older CUPS 2.x headers:

  • DEST_FLAGS_MORE = 1
  • DEST_FLAGS_REMOVED = 2
  • PRINTER_DISCOVERED = 8

However, with CUPS 3 headers these values are different. For example, on my local CUPS 3 setup:

  • DEST_FLAGS_MORE = 2
  • DEST_FLAGS_REMOVED = 4
  • PRINTER_DISCOVERED = 16777216

Because of this mismatch, cupsEnumDests() could return a destination with flags = 2, and cups-rs incorrectly treated it as REMOVED, causing valid printers such as PDF to be filtered out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant