Skip to content

Allow NULL for the callback in cpdbGetNewFrontendObj()#82

Merged
tillkamppeter merged 2 commits intoOpenPrinting:masterfrom
prab0007al:dev
Mar 15, 2025
Merged

Allow NULL for the callback in cpdbGetNewFrontendObj()#82
tillkamppeter merged 2 commits intoOpenPrinting:masterfrom
prab0007al:dev

Conversation

@prab0007al
Copy link

@tillkamppeter

Description

This pull request enhances the cpdbGetNewFrontendObj() function to accept NULL for the callback parameter. When NULL is passed, the function will use the default cpdbPrinterCallback() function, which logs printer updates to the console. This makes the API simpler to use for applications that don't need custom printer update handling.

Changes

  • Modified cpdbGetNewFrontendObj() in cpdb-frontend.c to use the default callback when NULL is passed
  • Added a declaration for cpdbPrinterCallback() in cpdb-frontend.h to make it accessible to users
  • Updated documentation in cpdb-frontend.h to reflect this change
  • Updated the example in cpdb-text-frontend.c to demonstrate using NULL for the callback
  • Updated CHANGES.md to document this enhancement

Fixes #80 - Allow NULL for the callback in cpdbGetNewFrontendObj()

@tillkamppeter tillkamppeter merged commit 1e4af28 into OpenPrinting:master Mar 15, 2025
@prab0007al prab0007al deleted the dev branch March 19, 2025 10:09
@prab0007al prab0007al restored the dev branch March 19, 2025 10:09
@prab0007al prab0007al deleted the dev branch March 19, 2025 10:51
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.

cpdbGetNewFrontendObj(): Allow NULL for the callback to use default callback function

2 participants