![]() |
CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Connect to the Printing Coordinator. More...
Functions | |
| struct caps_cl_handle * | caps_cl_instance_create (void) |
| int | caps_cl_instance_register (struct caps_cl_handle *instance, const struct caps_cl_notifier *notifier, void *data) |
| void | caps_cl_instance_unregister (struct caps_cl_handle *instance) |
| void | caps_cl_instance_destroy (struct caps_cl_handle *instance) |
In order to deal with printers and documents to print, a connection must be established to the Printing Coordinator first.
A simple use case contains the following steps:
In your program it looks like this:
Refer Deal with printers and Print documents for what you can do in the Do all the hard work block.
| struct caps_cl_handle * caps_cl_instance_create | ( | void | ) |
Create a client instance handle
This is the first call to be done in order to connect to the Printing Coordinator from the client side. All further functions mentioned here depend on this client instance handle.
| int caps_cl_instance_register | ( | struct caps_cl_handle * | instance, |
| const struct caps_cl_notifier * | notifier, | ||
| void * | data | ||
| ) |
Register your client instance handle to the Printing Coordinator
| [in,out] | instance | Client instance handle to register |
| [in] | notifier | Notifier definitions (can be NULL) |
| [in] | data | Some anonymous data to be forwarded to the notifier functions (as their parameter data, can be NULL) |
| 0 | Client instance handle successfully registered at the Printing Coordinator |
| -EIO | Real communication error with the Printing Coordinator |
| -EINVAL | Bad/unexpected reply from the Printing Coordinator (should not happen) |
| -ENOMSG | Notifiers aren't possible (should not happen) |
| -ENOSYS | Unsupported client version |
After a successful call, the client instance handle is a registered client instance and can be used by all other functions from this library.
The notifier and data parameter are optional. Refer Receive state change notifiers for details how to use it.
| void caps_cl_instance_unregister | ( | struct caps_cl_handle * | instance | ) |
Unregister your client instance from the Printing Coordinator
| [in] | instance | Client instance to unregister |
Always call this function prior exiting your application and prior caps_cl_instance_destroy().
| void caps_cl_instance_destroy | ( | struct caps_cl_handle * | instance | ) |
Free all client instance handle resources
| [in] | instance | Client instance handle to destroy |
Always call this function prior exiting your application and after caps_cl_instance_unregister().